bump nerfacc to 0.2.0. bug fix for depth vis. (#744)

* bump nerfacc to 0.2.0. bug fix for depth vis.

* skip emtpy region for nerfacc raymarching
This commit is contained in:
Ruilong Li(李瑞龙) authored and GitHub committed 2022-10-09 19:16:30 -07:00
1 parent eeda90e697
commit e94b093b57
4 files changed
+6 -3

No files matched your search

+2 -1
View File
@@ -467,6 +467,7 @@ class VolumetricSampler(Sampler):
far_plane=far_plane,
stratified=self.training,
cone_angle=cone_angle,
alpha_thre=1e-2,
)
num_samples = starts.shape[0]
@@ -477,7 +478,7 @@ class VolumetricSampler(Sampler):
starts = torch.ones((1, 1), dtype=starts.dtype, device=rays_o.device)
ends = torch.ones((1, 1), dtype=ends.dtype, device=rays_o.device)
ray_indices = nerfacc.unpack_to_ray_indices(packed_info).long()
ray_indices = nerfacc.unpack_info(packed_info)
origins = rays_o[ray_indices]
dirs = rays_d[ray_indices]
if camera_indices is not None:
+1 -1
View File
@@ -236,7 +236,7 @@ class DepthRenderer(nn.Module):
else:
depth = torch.sum(weights * steps, dim=-2) / (torch.sum(weights, -2) + eps)
depth = torch.clip(depth, steps[..., 0, :], steps[..., -1, :])
depth = torch.clip(depth, steps.min(), steps.max())
return depth
+2
View File
@@ -139,6 +139,8 @@ class NGPModel(Model):
self, training_callback_attributes: TrainingCallbackAttributes
) -> List[TrainingCallback]:
def update_occupancy_grid(step: int):
# TODO: needs to get access to the sampler, on how the step size is determinated at each x. See
# https://github.com/KAIR-BAIR/nerfacc/blob/127223b11401125a9fce5ce269bb0546ee4de6e8/examples/train_ngp_nerf.py#L190-L213
self.occupancy_grid.every_n_step(
step=step,
occ_eval_fn=lambda x: self.field.get_opacity(x, self.config.render_step_size),
+1 -1
View File
@@ -30,7 +30,7 @@ dependencies = [
"mediapy==1.1.0",
"msgpack==1.0.4",
"msgpack_numpy==0.4.8",
"nerfacc==0.1.3",
"nerfacc==0.2.0",
"opencv-python==4.6.0.66",
"plotly==5.7.0",
"protobuf==3.20.0",