From d3e391bcfedb3b2023cc452ac8b425b92d2c6ade Mon Sep 17 00:00:00 2001 From: AdamRashid96 Date: Wed, 23 Aug 2023 20:59:38 +0000 Subject: [PATCH] fix pair sampler bug with rays_to_sample --- nerfstudio/data/pixel_samplers.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nerfstudio/data/pixel_samplers.py b/nerfstudio/data/pixel_samplers.py index 41d457458..4126b96df 100644 --- a/nerfstudio/data/pixel_samplers.py +++ b/nerfstudio/data/pixel_samplers.py @@ -171,7 +171,6 @@ class PixelSampler: collated_batch = { key: value[c, y, x] for key, value in batch.items() if key != "image_idx" and value is not None } - assert collated_batch["image"].shape[0] == num_rays_per_batch # Needed to correct the random indices to their actual camera idx locations. @@ -367,8 +366,8 @@ class PairPixelSampler(PixelSampler): # pylint: disable=too-few-public-methods def __init__(self, config: PairPixelSamplerConfig, **kwargs) -> None: self.config = config self.radius = self.config.radius - self.rays_to_sample = self.config.num_rays_per_batch // 2 super().__init__(self.config, **kwargs) + self.rays_to_sample = self.num_rays_per_batch // 2 # overrides base method def sample_method( # pylint: disable=no-self-use