-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adapt RayPointRefiner and RayMarcher to support bins.
Summary: ## Context Bins are used in mipnerf to allow to manipulate easily intervals. For example, by doing the following, `bins[..., :-1]` you will obtain all the left coordinates of your intervals, while doing `bins[..., 1:]` is equals to the right coordinates of your intervals. We introduce here the support of bins like in MipNerf implementation. ## RayPointRefiner Small changes have been made to modify RayPointRefiner. - If bins is None ``` mids = torch.lerp(ray_bundle.lengths[..., 1:], ray_bundle.lengths[…, :-1], 0.5) z_samples = sample_pdf( mids, # [..., npt] weights[..., 1:-1], # [..., npt - 1] …. ) ``` - If bins is not None In the MipNerf implementation the sampling is done on all the bins. It allows us to use the full weights tensor without slashing it. ``` z_samples = sample_pdf( ray_bundle.bins, # [..., npt + 1] weights, # [..., npt] ... ) ``` ## RayMarcher Add a ray_deltas optional argument. If None, keep the same deltas computation from ray_lengths. Reviewed By: shapovalov Differential Revision: D46389092 fbshipit-source-id: d4f1963310065bd31c1c7fac1adfe11cbeaba606
- Loading branch information
1 parent
5910d81
commit 3d011a9
Showing
5 changed files
with
107 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters