"...text-generation-inference.git" did not exist on "bd405e035b9e05d4b1e74e029ff1d5de86854ea0"
Commit 4bb3fff5 authored by Nikhila Ravi's avatar Nikhila Ravi Committed by Facebook GitHub Bot
Browse files

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
parent 9c161d1d
...@@ -56,12 +56,12 @@ def cli(): ...@@ -56,12 +56,12 @@ def cli():
focal_length=(5.0 * 2.0 / 2.0,), focal_length=(5.0 * 2.0 / 2.0,),
R=torch.eye(3, dtype=torch.float32, device=device)[None, ...], R=torch.eye(3, dtype=torch.float32, device=device)[None, ...],
T=torch.zeros((1, 3), dtype=torch.float32, device=device), T=torch.zeros((1, 3), dtype=torch.float32, device=device),
image_size=((width, height),), image_size=((height, width),),
device=device, device=device,
) )
vert_rad = torch.rand(n_points, dtype=torch.float32, device=device) vert_rad = torch.rand(n_points, dtype=torch.float32, device=device)
raster_settings = PointsRasterizationSettings( raster_settings = PointsRasterizationSettings(
image_size=(width, height), image_size=(height, width),
radius=vert_rad, radius=vert_rad,
) )
rasterizer = PointsRasterizer(cameras=cameras, raster_settings=raster_settings) rasterizer = PointsRasterizer(cameras=cameras, raster_settings=raster_settings)
......
...@@ -123,11 +123,11 @@ class SceneModel(nn.Module): ...@@ -123,11 +123,11 @@ class SceneModel(nn.Module):
focal_length=self.focal_length, focal_length=self.focal_length,
R=self.cam_rot[None, ...], R=self.cam_rot[None, ...],
T=self.cam_pos[None, ...], T=self.cam_pos[None, ...],
image_size=((WIDTH, HEIGHT),), image_size=((HEIGHT, WIDTH),),
device=DEVICE, device=DEVICE,
) )
raster_settings = PointsRasterizationSettings( raster_settings = PointsRasterizationSettings(
image_size=(WIDTH, HEIGHT), image_size=(HEIGHT, WIDTH),
radius=self.vert_rad, radius=self.vert_rad,
) )
rasterizer = PointsRasterizer( rasterizer = PointsRasterizer(
......
...@@ -84,11 +84,11 @@ class SceneModel(nn.Module): ...@@ -84,11 +84,11 @@ class SceneModel(nn.Module):
focal_length=5.0, focal_length=5.0,
R=torch.eye(3, dtype=torch.float32, device=DEVICE)[None, ...], R=torch.eye(3, dtype=torch.float32, device=DEVICE)[None, ...],
T=torch.zeros((1, 3), dtype=torch.float32, device=DEVICE), T=torch.zeros((1, 3), dtype=torch.float32, device=DEVICE),
image_size=((WIDTH, HEIGHT),), image_size=((HEIGHT, WIDTH),),
device=DEVICE, device=DEVICE,
) )
raster_settings = PointsRasterizationSettings( raster_settings = PointsRasterizationSettings(
image_size=(WIDTH, HEIGHT), image_size=(HEIGHT, WIDTH),
radius=self.vert_rad, radius=self.vert_rad,
) )
rasterizer = PointsRasterizer( rasterizer = PointsRasterizer(
......
...@@ -80,7 +80,7 @@ class PulsarPointsRenderer(nn.Module): ...@@ -80,7 +80,7 @@ class PulsarPointsRenderer(nn.Module):
"by the pulsar backend." "by the pulsar backend."
) )
if isinstance(rasterizer.raster_settings.image_size, tuple): if isinstance(rasterizer.raster_settings.image_size, tuple):
width, height = rasterizer.raster_settings.image_size height, width = rasterizer.raster_settings.image_size
else: else:
width = rasterizer.raster_settings.image_size width = rasterizer.raster_settings.image_size
height = rasterizer.raster_settings.image_size height = rasterizer.raster_settings.image_size
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment