Skip to content

Commit 7ea0756

Browse files
Krzysztof Chalupkafacebook-github-bot
Krzysztof Chalupka
authored andcommitted
fit_textured_mesh tutorial fixes
Summary: Updated to FoV cameras and added perspective_correct=False, otherwise it'll nan out. Reviewed By: bottler Differential Revision: D35970900 fbshipit-source-id: 569b8de0b124d415f4b841924ddc85585cee2dda
1 parent 96889de commit 7ea0756

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

docs/tutorials/fit_textured_mesh.ipynb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
"from pytorch3d.structures import Meshes\n",
119119
"from pytorch3d.renderer import (\n",
120120
" look_at_view_transform,\n",
121-
" OpenGLPerspectiveCameras, \n",
121+
" FoVPerspectiveCameras, \n",
122122
" PointLights, \n",
123123
" DirectionalLights, \n",
124124
" Materials, \n",
@@ -304,11 +304,11 @@
304304
"# broadcasting. So we can view the camera from the a distance of dist=2.7, and \n",
305305
"# then specify elevation and azimuth angles for each viewpoint as tensors. \n",
306306
"R, T = look_at_view_transform(dist=2.7, elev=elev, azim=azim)\n",
307-
"cameras = OpenGLPerspectiveCameras(device=device, R=R, T=T)\n",
307+
"cameras = FoVPerspectiveCameras(device=device, R=R, T=T)\n",
308308
"\n",
309309
"# We arbitrarily choose one particular view that will be used to visualize \n",
310310
"# results\n",
311-
"camera = OpenGLPerspectiveCameras(device=device, R=R[None, 1, ...], \n",
311+
"camera = FoVPerspectiveCameras(device=device, R=R[None, 1, ...], \n",
312312
" T=T[None, 1, ...]) \n",
313313
"\n",
314314
"# Define the settings for rasterization and shading. Here we set the output \n",
@@ -351,7 +351,7 @@
351351
"# Our multi-view cow dataset will be represented by these 2 lists of tensors,\n",
352352
"# each of length num_views.\n",
353353
"target_rgb = [target_images[i, ..., :3] for i in range(num_views)]\n",
354-
"target_cameras = [OpenGLPerspectiveCameras(device=device, R=R[None, i, ...], \n",
354+
"target_cameras = [FoVPerspectiveCameras(device=device, R=R[None, i, ...], \n",
355355
" T=T[None, i, ...]) for i in range(num_views)]"
356356
]
357357
},
@@ -708,6 +708,7 @@
708708
" image_size=128, \n",
709709
" blur_radius=np.log(1. / 1e-4 - 1.)*sigma, \n",
710710
" faces_per_pixel=50, \n",
711+
" perspective_correct=False, \n",
711712
")\n",
712713
"\n",
713714
"# Differentiable soft renderer using per vertex RGB colors for texture\n",

0 commit comments

Comments
 (0)