mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-03 14:28:41 +08:00
fix pair sampler bug with rays_to_sample
This commit is contained in:
1 parent
42b223d74b
commit
d3e391bcfe
1 file changed
+1
-2
@@ -171,7 +171,6 @@ class PixelSampler:
|
|||||||
collated_batch = {
|
collated_batch = {
|
||||||
key: value[c, y, x] for key, value in batch.items() if key != "image_idx" and value is not None
|
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[0] == num_rays_per_batch
|
assert collated_batch["image"].shape[0] == num_rays_per_batch
|
||||||
|
|
||||||
# Needed to correct the random indices to their actual camera idx locations.
|
# Needed to correct the random indices to their actual camera idx locations.
|
||||||
@@ -367,8 +366,8 @@ class PairPixelSampler(PixelSampler): # pylint: disable=too-few-public-methods
|
|||||||
def __init__(self, config: PairPixelSamplerConfig, **kwargs) -> None:
|
def __init__(self, config: PairPixelSamplerConfig, **kwargs) -> None:
|
||||||
self.config = config
|
self.config = config
|
||||||
self.radius = self.config.radius
|
self.radius = self.config.radius
|
||||||
self.rays_to_sample = self.config.num_rays_per_batch // 2
|
|
||||||
super().__init__(self.config, **kwargs)
|
super().__init__(self.config, **kwargs)
|
||||||
|
self.rays_to_sample = self.num_rays_per_batch // 2
|
||||||
|
|
||||||
# overrides base method
|
# overrides base method
|
||||||
def sample_method( # pylint: disable=no-self-use
|
def sample_method( # pylint: disable=no-self-use
|
||||||
|
|||||||
Reference in new issue
Block a user