lazy all_train_cameras

Summary: Avoid calculating all_train_cameras before it is needed, because it is slow in some datasets.

Reviewed By: shapovalov

Differential Revision: D38037157

fbshipit-source-id: 95461226655cde2626b680661951ab17ebb0ec75
This commit is contained in:
Jeremy Reizenstein
2022-07-21 15:04:00 -07:00
committed by Facebook GitHub Bot
parent b2dc520210
commit 3783437d2f
6 changed files with 19 additions and 13 deletions

View File

@@ -10,6 +10,7 @@ from collections import defaultdict
from dataclasses import dataclass
from itertools import product
import numpy as np
from pytorch3d.implicitron.dataset.data_loader_map_provider import (
DoublePoolBatchSampler,
)
@@ -53,6 +54,7 @@ class MockDataset(DatasetBase):
class TestSceneBatchSampler(unittest.TestCase):
def setUp(self):
np.random.seed(42)
self.dataset_overfit = MockDataset(1)
def test_overfit(self):