From d8f24461228e8ef0b1d4903031fd49d9b71338bc Mon Sep 17 00:00:00 2001 From: Lukas Hoellein Date: Mon, 22 May 2023 19:43:14 +0200 Subject: [PATCH] Fix mask check in PatchPixelSampler (#1971) * fix mask check in PatchPixelSampler * change torch.Tensor to Tensor --- nerfstudio/data/pixel_samplers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nerfstudio/data/pixel_samplers.py b/nerfstudio/data/pixel_samplers.py index 0451e1fe9..396ba57a1 100644 --- a/nerfstudio/data/pixel_samplers.py +++ b/nerfstudio/data/pixel_samplers.py @@ -278,7 +278,7 @@ class PatchPixelSampler(PixelSampler): mask: Optional[Tensor] = None, device: Union[torch.device, str] = "cpu", ) -> Int[Tensor, "batch_size 3"]: - if mask: + 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) else: