Skip to content

Commit

Permalink
pulsar image size bug fix
Browse files Browse the repository at this point in the history
Summary: Small change to swap how height/width are inferred from the image_size setting.

Reviewed By: gkioxari

Differential Revision: D26648340

fbshipit-source-id: 2c657a115c96cadf3ac63be87b0e1bfba10c9315
  • Loading branch information
nikhilaravi authored and facebook-github-bot committed Feb 26, 2021
1 parent 9c161d1 commit 4bb3fff
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/examples/pulsar_basic_unified.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ def cli():
focal_length=(5.0 * 2.0 / 2.0,),
R=torch.eye(3, dtype=torch.float32, device=device)[None, ...],
T=torch.zeros((1, 3), dtype=torch.float32, device=device),
image_size=((width, height),),
image_size=((height, width),),
device=device,
)
vert_rad = torch.rand(n_points, dtype=torch.float32, device=device)
raster_settings = PointsRasterizationSettings(
image_size=(width, height),
image_size=(height, width),
radius=vert_rad,
)
rasterizer = PointsRasterizer(cameras=cameras, raster_settings=raster_settings)
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/pulsar_cam_unified.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,11 @@ def __init__(self):
focal_length=self.focal_length,
R=self.cam_rot[None, ...],
T=self.cam_pos[None, ...],
image_size=((WIDTH, HEIGHT),),
image_size=((HEIGHT, WIDTH),),
device=DEVICE,
)
raster_settings = PointsRasterizationSettings(
image_size=(WIDTH, HEIGHT),
image_size=(HEIGHT, WIDTH),
radius=self.vert_rad,
)
rasterizer = PointsRasterizer(
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/pulsar_optimization_unified.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ def __init__(self):
focal_length=5.0,
R=torch.eye(3, dtype=torch.float32, device=DEVICE)[None, ...],
T=torch.zeros((1, 3), dtype=torch.float32, device=DEVICE),
image_size=((WIDTH, HEIGHT),),
image_size=((HEIGHT, WIDTH),),
device=DEVICE,
)
raster_settings = PointsRasterizationSettings(
image_size=(WIDTH, HEIGHT),
image_size=(HEIGHT, WIDTH),
radius=self.vert_rad,
)
rasterizer = PointsRasterizer(
Expand Down
2 changes: 1 addition & 1 deletion pytorch3d/renderer/points/pulsar/unified.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def __init__(
"by the pulsar backend."
)
if isinstance(rasterizer.raster_settings.image_size, tuple):
width, height = rasterizer.raster_settings.image_size
height, width = rasterizer.raster_settings.image_size
else:
width = rasterizer.raster_settings.image_size
height = rasterizer.raster_settings.image_size
Expand Down

0 comments on commit 4bb3fff

Please sign in to comment.