Skip to content

Commit 4bb3fff

Browse files
nikhilaravifacebook-github-bot
authored andcommitted
pulsar image size bug fix
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
1 parent 9c161d1 commit 4bb3fff

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

docs/examples/pulsar_basic_unified.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ def cli():
5656
focal_length=(5.0 * 2.0 / 2.0,),
5757
R=torch.eye(3, dtype=torch.float32, device=device)[None, ...],
5858
T=torch.zeros((1, 3), dtype=torch.float32, device=device),
59-
image_size=((width, height),),
59+
image_size=((height, width),),
6060
device=device,
6161
)
6262
vert_rad = torch.rand(n_points, dtype=torch.float32, device=device)
6363
raster_settings = PointsRasterizationSettings(
64-
image_size=(width, height),
64+
image_size=(height, width),
6565
radius=vert_rad,
6666
)
6767
rasterizer = PointsRasterizer(cameras=cameras, raster_settings=raster_settings)

docs/examples/pulsar_cam_unified.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,11 @@ def __init__(self):
123123
focal_length=self.focal_length,
124124
R=self.cam_rot[None, ...],
125125
T=self.cam_pos[None, ...],
126-
image_size=((WIDTH, HEIGHT),),
126+
image_size=((HEIGHT, WIDTH),),
127127
device=DEVICE,
128128
)
129129
raster_settings = PointsRasterizationSettings(
130-
image_size=(WIDTH, HEIGHT),
130+
image_size=(HEIGHT, WIDTH),
131131
radius=self.vert_rad,
132132
)
133133
rasterizer = PointsRasterizer(

docs/examples/pulsar_optimization_unified.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ def __init__(self):
8484
focal_length=5.0,
8585
R=torch.eye(3, dtype=torch.float32, device=DEVICE)[None, ...],
8686
T=torch.zeros((1, 3), dtype=torch.float32, device=DEVICE),
87-
image_size=((WIDTH, HEIGHT),),
87+
image_size=((HEIGHT, WIDTH),),
8888
device=DEVICE,
8989
)
9090
raster_settings = PointsRasterizationSettings(
91-
image_size=(WIDTH, HEIGHT),
91+
image_size=(HEIGHT, WIDTH),
9292
radius=self.vert_rad,
9393
)
9494
rasterizer = PointsRasterizer(

pytorch3d/renderer/points/pulsar/unified.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def __init__(
8080
"by the pulsar backend."
8181
)
8282
if isinstance(rasterizer.raster_settings.image_size, tuple):
83-
width, height = rasterizer.raster_settings.image_size
83+
height, width = rasterizer.raster_settings.image_size
8484
else:
8585
width = rasterizer.raster_settings.image_size
8686
height = rasterizer.raster_settings.image_size

0 commit comments

Comments
 (0)