"...text-generation-inference.git" did not exist on "dae3bf1d87c13f1186eead4afbfb4a29e4a59f84"
Unverified Commit 9f0468ad authored by Matthew Tancik's avatar Matthew Tancik Committed by GitHub
Browse files

Minor type fixes (#24)

parent 93c059ea
...@@ -47,7 +47,7 @@ def volumetric_marching( ...@@ -47,7 +47,7 @@ def volumetric_marching(
render_step_size: float = 1e-3, render_step_size: float = 1e-3,
near_plane: float = 0.0, near_plane: float = 0.0,
stratified: bool = False, stratified: bool = False,
) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor]: ) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor]:
"""Volumetric marching with occupancy test. """Volumetric marching with occupancy test.
Note: this function is not differentiable to inputs. Note: this function is not differentiable to inputs.
......
...@@ -69,10 +69,10 @@ def volumetric_rendering_pipeline( ...@@ -69,10 +69,10 @@ def volumetric_rendering_pipeline(
rays_d = rays_d.contiguous() rays_d = rays_d.contiguous()
scene_aabb = scene_aabb.contiguous() scene_aabb = scene_aabb.contiguous()
scene_occ_binary = scene_occ_binary.contiguous() scene_occ_binary = scene_occ_binary.contiguous()
render_bkgd = render_bkgd.contiguous()
with torch.no_grad(): with torch.no_grad():
# Ray marching and occupancy check. # Ray marching and occupancy check.
assert scene_resolution is not None
packed_info, frustum_starts, frustum_ends = volumetric_marching( packed_info, frustum_starts, frustum_ends = volumetric_marching(
rays_o, rays_o,
rays_d, rays_d,
...@@ -126,6 +126,7 @@ def volumetric_rendering_pipeline( ...@@ -126,6 +126,7 @@ def volumetric_rendering_pipeline(
# ) # )
if render_bkgd is not None: if render_bkgd is not None:
render_bkgd = render_bkgd.contiguous()
colors = colors + render_bkgd * (1.0 - opacities) colors = colors + render_bkgd * (1.0 - opacities)
return colors, opacities, n_marching_samples, n_rendering_samples return colors, opacities, n_marching_samples, n_rendering_samples
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment