avoid deprecated raysamplers

Summary: Migrate away from NDCGridRaysampler and GridRaysampler to their more flexible replacements.

Reviewed By: patricklabatut

Differential Revision: D33281584

fbshipit-source-id: 65f8702e700a32d38f7cd6bda3924bb1707a0633
This commit is contained in:
Jeremy Reizenstein
2022-01-24 10:51:03 -08:00
committed by Facebook GitHub Bot
parent 3eb4233844
commit 67778caee8
6 changed files with 30 additions and 30 deletions

View File

@@ -8,7 +8,7 @@ import math
from typing import List
import torch
from pytorch3d.renderer import MonteCarloRaysampler, NDCGridRaysampler, RayBundle
from pytorch3d.renderer import MonteCarloRaysampler, NDCMultinomialRaysampler, RayBundle
from pytorch3d.renderer.cameras import CamerasBase
from pytorch3d.renderer.implicit.sample_pdf import sample_pdf
@@ -150,7 +150,7 @@ class NeRFRaysampler(torch.nn.Module):
self._stratified_test = stratified_test
# Initialize the grid ray sampler.
self._grid_raysampler = NDCGridRaysampler(
self._grid_raysampler = NDCMultinomialRaysampler(
image_width=image_width,
image_height=image_height,
n_pts_per_ray=n_pts_per_ray,