4
0
mirror of https://github.com/nerfstudio-project/nerfstudio.git synced 2026-11-11 10:34:29 +08:00

Add kwargs handling for patchpixelsampler patch size (#2622)

* Add kwargs handling for patchpixelsampler patch size

* Run black

---------

Co-authored-by: Justin Kerr <justin.g.kerr@gmail.com>
Co-authored-by: J.Y <132313008+jb-ye@users.noreply.github.com>
This commit is contained in:
Chung Min Kim 2024-05-08 10:45:58 -07:00 committed by GitHub
parent 3d61d8cbdc
commit c17d1d7315
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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.