Skip to content

Commit 4ad8576

Browse files
bottlerfacebook-github-bot
authored andcommitted
rasterization header comment fixes
Summary: Fix some missing or misplaced argument descriptions. Reviewed By: nikhilaravi Differential Revision: D31305132 fbshipit-source-id: af4fcee9766682b2b7f7f16327e839090e377be2
1 parent a5cbb62 commit 4ad8576

File tree

4 files changed

+31
-8
lines changed

4 files changed

+31
-8
lines changed

pytorch3d/csrc/rasterize_meshes/rasterize_meshes.h

+21
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ RasterizeMeshesNaiveCuda(
7575
// coordinates for each pixel; if this is False then
7676
// this function instead returns screen-space
7777
// barycentric coordinates for each pixel.
78+
// clip_barycentric_coords: Whether, after any perspective correction
79+
// is applied but before the depth is calculated (e.g. for
80+
// z clipping), to "correct" a location outside the face (i.e. with
81+
// a negative barycentric coordinate) to a position on the edge of the
82+
// face.
7883
// cull_backfaces: Bool, Whether to only rasterize mesh faces which are
7984
// visible to the camera. This assumes that vertices of
8085
// front-facing triangles are ordered in an anti-clockwise
@@ -191,6 +196,11 @@ torch::Tensor RasterizeMeshesBackwardCuda(
191196
// coordinates for each pixel; if this is False then
192197
// this function instead returns screen-space
193198
// barycentric coordinates for each pixel.
199+
// clip_barycentric_coords: Whether, after any perspective correction
200+
// is applied but before the depth is calculated (e.g. for
201+
// z clipping), to "correct" a location outside the face (i.e. with
202+
// a negative barycentric coordinate) to a position on the edge of the
203+
// face.
194204
//
195205
// Returns:
196206
// grad_face_verts: float32 Tensor of shape (F, 3, 3) giving downstream
@@ -352,6 +362,11 @@ RasterizeMeshesFineCuda(
352362
// coordinates for each pixel; if this is False then
353363
// this function instead returns screen-space
354364
// barycentric coordinates for each pixel.
365+
// clip_barycentric_coords: Whether, after any perspective correction
366+
// is applied but before the depth is calculated (e.g. for
367+
// z clipping), to "correct" a location outside the face (i.e. with
368+
// a negative barycentric coordinate) to a position on the edge of the
369+
// face.
355370
// cull_backfaces: Bool, Whether to only rasterize mesh faces which are
356371
// visible to the camera. This assumes that vertices of
357372
// front-facing triangles are ordered in an anti-clockwise
@@ -441,6 +456,7 @@ RasterizeMeshesFine(
441456
// blur_radius: float distance in NDC coordinates uses to expand the face
442457
// bounding boxes for the rasterization. Set to 0.0 if no blur
443458
// is required.
459+
// faces_per_pixel: the number of closeset faces to rasterize per pixel.
444460
// bin_size: Bin size (in pixels) for coarse-to-fine rasterization. Setting
445461
// bin_size=0 uses naive rasterization instead.
446462
// max_faces_per_bin: The maximum number of faces allowed to fall into each
@@ -451,6 +467,11 @@ RasterizeMeshesFine(
451467
// coordinates for each pixel; if this is False then
452468
// this function instead returns screen-space
453469
// barycentric coordinates for each pixel.
470+
// clip_barycentric_coords: Whether, after any perspective correction
471+
// is applied but before the depth is calculated (e.g. for
472+
// z clipping), to "correct" a location outside the face (i.e. with
473+
// a negative barycentric coordinate) to a position on the edge of the
474+
// face.
454475
// cull_backfaces: Bool, Whether to only rasterize mesh faces which are
455476
// visible to the camera. This assumes that vertices of
456477
// front-facing triangles are ordered in an anti-clockwise

pytorch3d/csrc/rasterize_points/rasterize_points.h

+8-6
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ RasterizePointsNaiveCuda(
4848
// in the batch where N is the batch size.
4949
// num_points_per_cloud: LongTensor of shape (N) giving the number of points
5050
// for each pointcloud in the batch.
51-
// radius: FloatTensor of shape (P) giving the radius (in NDC units) of
52-
// each point in points.
5351
// image_size: Tuple (H, W) giving the size in pixels of the output
5452
// image to be rasterized.
53+
// radius: FloatTensor of shape (P) giving the radius (in NDC units) of
54+
// each point in points.
5555
// points_per_pixel: (K) The number closest of points to return for each pixel
5656
//
5757
// Returns:
@@ -126,11 +126,13 @@ torch::Tensor RasterizePointsCoarseCpu(
126126
// in the batch where N is the batch size.
127127
// num_points_per_cloud: LongTensor of shape (N) giving the number of points
128128
// for each pointcloud in the batch.
129-
// radius: FloatTensor of shape (P) giving the radius (in NDC units) of
130-
// each point in points.
131129
// image_size: Tuple (H, W) giving the size in pixels of the output
132130
// image to be rasterized.
131+
// radius: FloatTensor of shape (P) giving the radius (in NDC units) of
132+
// each point in points.
133133
// bin_size: Size of each bin within the image (in pixels)
134+
// max_points_per_bin: The maximum number of points allowed to fall into each
135+
// bin when using coarse-to-fine rasterization.
134136
//
135137
// Returns:
136138
// points_per_bin: Tensor of shape (N, num_bins, num_bins) giving the number
@@ -303,10 +305,10 @@ torch::Tensor RasterizePointsBackward(
303305
// in the batch where N is the batch size.
304306
// num_points_per_cloud: LongTensor of shape (N) giving the number of points
305307
// for each pointcloud in the batch.
306-
// radius: FloatTensor of shape (P) giving the radius (in NDC units) of
307-
// each point in points.
308308
// image_size: Tuple (H, W) giving the size in pixels of the output
309309
// image to be rasterized.
310+
// radius: FloatTensor of shape (P) giving the radius (in NDC units) of
311+
// each point in points.
310312
// points_per_pixel: (K) The number of points to return for each pixel
311313
// bin_size: Bin size (in pixels) for coarse-to-fine rasterization. Setting
312314
// bin_size=0 uses naive rasterization instead.

pytorch3d/renderer/mesh/rasterize_meshes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def rasterize_meshes(
7171
bin_size=0 uses naive rasterization; setting bin_size=None attempts to
7272
set it heuristically based on the shape of the input. This should not
7373
affect the output, but can affect the speed of the forward pass.
74-
faces_per_bin: Only applicable when using coarse-to-fine rasterization
74+
max_faces_per_bin: Only applicable when using coarse-to-fine rasterization
7575
(bin_size > 0); this is the maximum number of faces allowed within each
7676
bin. This should not affect the output values, but can affect
7777
the memory usage in the forward pass.

pytorch3d/renderer/points/rasterize_points.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def rasterize_points(
6262
bin_size=0 uses naive rasterization; setting bin_size=None attempts to
6363
set it heuristically based on the shape of the input. This should not
6464
affect the output, but can affect the speed of the forward pass.
65-
points_per_bin: Only applicable when using coarse-to-fine rasterization
65+
max_points_per_bin: Only applicable when using coarse-to-fine rasterization
6666
(bin_size > 0); this is the maximum number of points allowed within each
6767
bin. This should not affect the output values, but can affect
6868
the memory usage in the forward pass.

0 commit comments

Comments
 (0)