Fix dynamic batch logic during inference (#1160)

This commit is contained in:
Matthew Tancik authored and GitHub committed 2022-12-21 22:50:05 -07:00
1 parent 8d4a82ef0b
commit 335c5c3661
2 files changed
+8 -2

No files matched your search

@@ -298,6 +298,8 @@ class VanillaDataManager(DataManager): # pylint: disable=abstract-method
train_dataset: InputDataset
eval_dataset: InputDataset
train_dataparser_outputs: DataparserOutputs
train_pixel_sampler: Optional[PixelSampler] = None
eval_pixel_sampler: Optional[PixelSampler] = None
def __init__(
self,
@@ -408,6 +410,7 @@ class VanillaDataManager(DataManager): # pylint: disable=abstract-method
"""Returns the next batch of data from the train dataloader."""
self.train_count += 1
image_batch = next(self.iter_train_image_dataloader)
assert self.train_pixel_sampler is not None
batch = self.train_pixel_sampler.sample(image_batch)
ray_indices = batch["indices"]
ray_bundle = self.train_ray_generator(ray_indices)
@@ -417,6 +420,7 @@ class VanillaDataManager(DataManager): # pylint: disable=abstract-method
"""Returns the next batch of data from the eval dataloader."""
self.eval_count += 1
image_batch = next(self.iter_eval_image_dataloader)
assert self.eval_pixel_sampler is not None
batch = self.eval_pixel_sampler.sample(image_batch)
ray_indices = batch["indices"]
ray_bundle = self.eval_ray_generator(ray_indices)