From c17d1d7315ee256abb0dfbe3e1c8f7f676580e3a Mon Sep 17 00:00:00 2001 From: Chung Min Kim Date: Wed, 8 May 2024 10:45:58 -0700 Subject: [PATCH] Add kwargs handling for patchpixelsampler patch size (#2622) * Add kwargs handling for patchpixelsampler patch size * Run black --------- Co-authored-by: Justin Kerr Co-authored-by: J.Y <132313008+jb-ye@users.noreply.github.com> --- nerfstudio/data/pixel_samplers.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nerfstudio/data/pixel_samplers.py b/nerfstudio/data/pixel_samplers.py index 93de0a996..ad11ee409 100644 --- a/nerfstudio/data/pixel_samplers.py +++ b/nerfstudio/data/pixel_samplers.py @@ -396,6 +396,10 @@ class PatchPixelSampler(PixelSampler): config: PatchPixelSamplerConfig + def __init__(self, config: PatchPixelSamplerConfig, **kwargs) -> None: + super().__init__(config, **kwargs) + self.config.patch_size = self.kwargs.get("patch_size", self.config.patch_size) + def set_num_rays_per_batch(self, num_rays_per_batch: int): """Set the number of rays to sample per batch. Overridden to deal with patch-based sampling.