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

@@ -12,13 +12,13 @@ from common_testing import TestCaseMixin
from pytorch3d.renderer import (
BlendParams,
EmissionAbsorptionRaymarcher,
GridRaysampler,
ImplicitRenderer,
Materials,
MeshRasterizer,
MeshRenderer,
MonteCarloRaysampler,
NDCGridRaysampler,
MultinomialRaysampler,
NDCMultinomialRaysampler,
PointLights,
RasterizationSettings,
RayBundle,
@@ -142,7 +142,7 @@ class TestRenderImplicit(TestCaseMixin, unittest.TestCase):
# init a trivial renderer
renderer = ImplicitRenderer(
raysampler=NDCGridRaysampler(
raysampler=NDCMultinomialRaysampler(
image_width=100,
image_height=100,
n_pts_per_ray=10,
@@ -180,7 +180,7 @@ class TestRenderImplicit(TestCaseMixin, unittest.TestCase):
sphere_centroid.requires_grad = True
# init the grid raysampler with the ndc grid
raysampler = NDCGridRaysampler(
raysampler = NDCMultinomialRaysampler(
image_width=image_size[1],
image_height=image_size[0],
n_pts_per_ray=256,
@@ -355,7 +355,7 @@ class TestRenderImplicit(TestCaseMixin, unittest.TestCase):
cameras = init_cameras(n_frames, image_size=image_size)
# init the grid raysampler
raysampler = GridRaysampler(
raysampler = MultinomialRaysampler(
min_x=0.5,
max_x=image_size[1] - 0.5,
min_y=0.5,