Skip to content

Commit 4db9fc1

Browse files
davnov134facebook-github-bot
authored andcommitted
Allow setting bin_size for render_point_clouds_pytorch3d
Summary: This is required to suppress a huge stdout full of warnings about overflown bins. Reviewed By: bottler Differential Revision: D35359824 fbshipit-source-id: 39214b1bdcb4a5d5debf8ed498b2ca81fa43d210
1 parent 3b8a33e commit 4db9fc1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pytorch3d/implicitron/tools/point_cloud_utils.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ def render_point_cloud_pytorch3d(
7474
topk: int = 10,
7575
eps: float = 1e-2,
7676
bg_color=None,
77+
bin_size: Optional[int] = None,
7778
**kwargs
7879
):
7980

@@ -86,13 +87,18 @@ def render_point_cloud_pytorch3d(
8687
camera_trivial.R[:] = torch.eye(3)
8788
camera_trivial.T *= 0.0
8889

90+
bin_size = (
91+
bin_size
92+
if bin_size is not None
93+
else (64 if int(max(render_size)) > 1024 else None)
94+
)
8995
rasterizer = PointsRasterizer(
9096
cameras=camera_trivial,
9197
raster_settings=PointsRasterizationSettings(
9298
image_size=render_size,
9399
radius=point_radius,
94100
points_per_pixel=topk,
95-
bin_size=64 if int(max(render_size)) > 1024 else None,
101+
bin_size=bin_size,
96102
),
97103
)
98104

0 commit comments

Comments
 (0)