Exemple #1
0
 def test_build_iterable_dataloader_inference(self):
     # Test that build_detection_test_loader supports iterable dataset
     N = 50
     ds = DatasetFromList(list(range(N)))
     ds = ToIterableDataset(ds, InferenceSampler(len(ds)))
     dl = build_detection_test_loader(dataset=ds, mapper=lambda x: x, num_workers=3)
     self._check_is_range(dl, N)
Exemple #2
0
 def test_build_iterable_dataloader_train(self):
     kwargs = self._get_kwargs()
     ds = DatasetFromList(kwargs.pop("dataset"))
     ds = ToIterableDataset(ds, TrainingSampler(len(ds)))
     dl = build_detection_train_loader(dataset=ds, **kwargs)
     next(iter(dl))