From a2f7599d172198290be5316aa4dc8e4830ccb673 Mon Sep 17 00:00:00 2001 From: AdamRashid96 Date: Tue, 1 Aug 2023 23:01:23 +0000 Subject: [PATCH] removed defaulting to base pixel sampler with mask --- nerfstudio/data/pixel_samplers.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nerfstudio/data/pixel_samplers.py b/nerfstudio/data/pixel_samplers.py index 6780703b5..068bbb9d1 100644 --- a/nerfstudio/data/pixel_samplers.py +++ b/nerfstudio/data/pixel_samplers.py @@ -318,8 +318,8 @@ class PatchPixelSampler(PixelSampler): device: Union[torch.device, str] = "cpu", ) -> Int[Tensor, "batch_size 3"]: if isinstance(mask, Tensor): - # Note: if there is a mask, sampling reduces back to uniform sampling - indices = super().sample_method(batch_size, num_images, image_height, image_width, mask=mask, device=device) + # Note: if there is a mask, should switch to the base PixelSampler class + raise NotImplementedError() else: sub_bs = batch_size // (self.config.patch_size**2) indices = torch.rand((sub_bs, 3), device=device) * torch.tensor( @@ -380,7 +380,8 @@ class PairPixelSampler(PixelSampler): # pylint: disable=too-few-public-methods device: Union[torch.device, str] = "cpu", ) -> Int[Tensor, "batch_size 3"]: if mask: - # Note: if there is a mask, sampling reduces back to uniform sampling + # Note: if there is a mask, should switch to the base PixelSampler class + raise NotImplementedError() else: s = (self.rays_to_sample, 1)