Patch Sampling bug fix (#1578)

quick fix.
This commit is contained in:
Alexander Kristoffersen authored and GitHub committed 2023-03-09 17:30:41 -08:00
1 parent ba8f9b48a4
commit 99afaa7164
1 file changed
+8
+8
View File
@@ -261,6 +261,14 @@ class PatchPixelSampler(PixelSampler): # pylint: disable=too-few-public-methods
num_rays = (num_rays_per_batch // (self.patch_size**2)) * (self.patch_size**2)
super().__init__(num_rays, keep_full_image, **kwargs)
def set_num_rays_per_batch(self, num_rays_per_batch: int):
"""Set the number of rays to sample per batch. Overrided to deal with patch-based sampling.
Args:
num_rays_per_batch: number of rays to sample per batch
"""
self.num_rays_per_batch = (num_rays_per_batch // (self.patch_size**2)) * (self.patch_size**2)
# overrides base method
def sample_method( # pylint: disable=no-self-use
self,