Emilien Garreau 3d011a9198 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
2023-07-06 02:41:15 -07:00
..
2022-03-21 13:20:10 -07:00
2023-05-19 06:41:33 -07:00
2023-06-16 04:49:02 -07:00
2023-04-25 09:56:15 -07:00
2022-05-25 06:16:03 -07:00
2022-06-10 12:22:46 -07:00
2023-01-24 15:26:52 -08:00
2022-10-03 08:36:47 -07:00
2022-06-28 16:11:49 -07:00
2022-05-12 12:50:03 -07:00