mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-12-14 11:26:24 +08:00
Using the new dataset idx API everywhere.
Summary: Using the API from D35012121 everywhere. Reviewed By: bottler Differential Revision: D35045870 fbshipit-source-id: dab112b5e04160334859bbe8fa2366344b6e0f70
This commit is contained in:
committed by
Facebook GitHub Bot
parent
c0bb49b5f6
commit
e2622d79c0
@@ -25,7 +25,7 @@ class MockDataset(ImplicitronDatasetBase):
|
||||
Makes a gap of max_frame_gap frame numbers in the middle of each sequence
|
||||
"""
|
||||
self.seq_annots = {f"seq_{i}": None for i in range(num_seq)}
|
||||
self.seq_to_idx = {
|
||||
self._seq_to_idx = {
|
||||
f"seq_{i}": list(range(i * 10, i * 10 + 10)) for i in range(num_seq)
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
import contextlib
|
||||
import copy
|
||||
import dataclasses
|
||||
import itertools
|
||||
import math
|
||||
import os
|
||||
import unittest
|
||||
@@ -285,6 +286,7 @@ class TestEvaluation(unittest.TestCase):
|
||||
|
||||
def test_full_eval(self, n_sequences=5):
|
||||
"""Test evaluation."""
|
||||
for _, idx in list(self.dataset.seq_to_idx.items())[:n_sequences]:
|
||||
for seq in itertools.islice(self.dataset.sequence_names(), n_sequences):
|
||||
idx = list(self.dataset.sequence_indices_in_order(seq))
|
||||
seq_dataset = torch.utils.data.Subset(self.dataset, idx)
|
||||
self._one_sequence_test(seq_dataset)
|
||||
|
||||
Reference in New Issue
Block a user