tutorial fixes. validate #cameras

Summary:
Update the installation cells to import torch.
Replace use of deprecated Textures in deform tutorial.
Correct the deform tutorial's idea of its own name.
Fix typo in batched part of render_textured_meshes which meant only one mesh was being rendered with a batch of cameras.
Add an error check in the rasterizer to make the error friendly from such a mistake elsewhere.

Reviewed By: gkioxari

Differential Revision: D23345462

fbshipit-source-id: 1d5bd25db052f7ef687b7168d7aee5cc4dce8952
This commit is contained in:
Jeremy Reizenstein
2020-08-26 08:26:04 -07:00
committed by Facebook GitHub Bot
parent 32484500be
commit 9aeb88b48e
8 changed files with 18 additions and 5 deletions

View File

@@ -94,6 +94,12 @@ class MeshRasterizer(nn.Module):
msg = "Cameras must be specified either at initialization \
or in the forward pass of MeshRasterizer"
raise ValueError(msg)
n_cameras = len(cameras)
if n_cameras != 1 and n_cameras != len(meshes_world):
msg = "Wrong number (%r) of cameras for %r meshes"
raise ValueError(msg % (n_cameras, len(meshes_world)))
verts_world = meshes_world.verts_padded()
# NOTE: Retaining view space z coordinate for now.