Remove occluded samples during training. (#530)

remove occluded samples during training.
This commit is contained in:
Matthew Tancik authored and GitHub committed 2022-09-23 16:24:32 -07:00
1 parent 9b7075e49a
commit 1044defd1b
1 file changed
+2 -2
+2 -2
View File
@@ -397,7 +397,7 @@ class VolumetricSampler(Sampler):
ray_bundle: RayBundle,
num_samples: Optional[int] = None,
near_plane: float = 0.0,
remove_occluded_samples: bool = False,
remove_occluded_samples: bool = True,
) -> Tuple[RaySamples, TensorType["total_samples", 3], TensorType["total_samples", 2]]:
"""Generate ray samples in a bounding box.
@@ -455,7 +455,7 @@ class VolumetricSampler(Sampler):
if camera_indices is not None:
camera_indices = camera_indices[ray_indices]
if remove_occluded_samples:
if remove_occluded_samples and self.training:
with torch.no_grad():
positions = origins + dirs * (starts + ends) / 2.0
densities = self.density_fn(positions)