Skip to content

Commit b95535c

Browse files
mylafacebook-github-bot
authored andcommitted
Fixing bug in rasterizer.py caused by duplicate line (#1421)
Summary: The file [rasterizer.py](https://github.com/facebookresearch/pytorch3d/blob/de3a474d2b9e0f5d4a77c82106a4a8e7853a4e07/pytorch3d/renderer/mesh/rasterizer.py#L201) contains a duplicate line before the check if the projection_transform exists. This causes an exception in the case that a projection transform matrix is already provided. The corresponding lines should be (and are already) in the else case of the if-statement. Removing these lines fixes the bug and produces the desired behavior. Pull Request resolved: #1421 Reviewed By: shapovalov Differential Revision: D42450999 Pulled By: bottler fbshipit-source-id: f7464e87ec9ff8768455656324b0b008132c8a54
1 parent dcced4f commit b95535c

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

Diff for: pytorch3d/renderer/mesh/rasterizer.py

-3
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,6 @@ def transform(self, meshes_world, **kwargs) -> torch.Tensor:
198198
verts_view = cameras.get_world_to_view_transform(**kwargs).transform_points(
199199
verts_world, eps=eps
200200
)
201-
# Call transform_points instead of explicitly composing transforms to handle
202-
# the case, where camera class does not have a projection matrix form.
203-
verts_proj = cameras.transform_points(verts_world, eps=eps)
204201
to_ndc_transform = cameras.get_ndc_camera_transform(**kwargs)
205202
projection_transform = try_get_projection_transform(cameras, kwargs)
206203
if projection_transform is not None:

0 commit comments

Comments
 (0)