From ea358976683a75e66fea7ce9fa9274ce4099d6d9 Mon Sep 17 00:00:00 2001 From: Matias Turkulainen <30566358+maturk@users.noreply.github.com> Date: Wed, 3 May 2023 19:28:11 +0300 Subject: [PATCH] Remove unecessary assert in pixel sampler on image dimensions (#1861) remove uneccessary assert on image dimension --- nerfstudio/data/pixel_samplers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nerfstudio/data/pixel_samplers.py b/nerfstudio/data/pixel_samplers.py index b58d99fe3..f3a9bc2f7 100644 --- a/nerfstudio/data/pixel_samplers.py +++ b/nerfstudio/data/pixel_samplers.py @@ -101,7 +101,7 @@ class PixelSampler: # pylint: disable=too-few-public-methods 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 == (num_rays_per_batch, 3), collated_batch["image"].shape + assert collated_batch["image"].shape[0] == num_rays_per_batch # Needed to correct the random indices to their actual camera idx locations. indices[:, 0] = batch["image_idx"][c] @@ -172,7 +172,7 @@ class PixelSampler: # pylint: disable=too-few-public-methods collated_batch["image"] = torch.cat(all_images, dim=0) - assert collated_batch["image"].shape == (num_rays_per_batch, 3), collated_batch["image"].shape + assert collated_batch["image"].shape[0] == num_rays_per_batch # Needed to correct the random indices to their actual camera idx locations. indices[:, 0] = batch["image_idx"][c]