rasterization header comment fixes

Summary: Fix some missing or misplaced argument descriptions.

Reviewed By: nikhilaravi

Differential Revision: D31305132

fbshipit-source-id: af4fcee9766682b2b7f7f16327e839090e377be2
This commit is contained in:
Jeremy Reizenstein 2021-09-30 10:39:50 -07:00 committed by Facebook GitHub Bot
parent a5cbb624c1
commit 4ad8576541
4 changed files with 31 additions and 8 deletions

View File

@ -75,6 +75,11 @@ RasterizeMeshesNaiveCuda(
// coordinates for each pixel; if this is False then // coordinates for each pixel; if this is False then
// this function instead returns screen-space // this function instead returns screen-space
// barycentric coordinates for each pixel. // barycentric coordinates for each pixel.
// clip_barycentric_coords: Whether, after any perspective correction
// is applied but before the depth is calculated (e.g. for
// z clipping), to "correct" a location outside the face (i.e. with
// a negative barycentric coordinate) to a position on the edge of the
// face.
// cull_backfaces: Bool, Whether to only rasterize mesh faces which are // cull_backfaces: Bool, Whether to only rasterize mesh faces which are
// visible to the camera. This assumes that vertices of // visible to the camera. This assumes that vertices of
// front-facing triangles are ordered in an anti-clockwise // front-facing triangles are ordered in an anti-clockwise
@ -191,6 +196,11 @@ torch::Tensor RasterizeMeshesBackwardCuda(
// coordinates for each pixel; if this is False then // coordinates for each pixel; if this is False then
// this function instead returns screen-space // this function instead returns screen-space
// barycentric coordinates for each pixel. // barycentric coordinates for each pixel.
// clip_barycentric_coords: Whether, after any perspective correction
// is applied but before the depth is calculated (e.g. for
// z clipping), to "correct" a location outside the face (i.e. with
// a negative barycentric coordinate) to a position on the edge of the
// face.
// //
// Returns: // Returns:
// grad_face_verts: float32 Tensor of shape (F, 3, 3) giving downstream // grad_face_verts: float32 Tensor of shape (F, 3, 3) giving downstream
@ -352,6 +362,11 @@ RasterizeMeshesFineCuda(
// coordinates for each pixel; if this is False then // coordinates for each pixel; if this is False then
// this function instead returns screen-space // this function instead returns screen-space
// barycentric coordinates for each pixel. // barycentric coordinates for each pixel.
// clip_barycentric_coords: Whether, after any perspective correction
// is applied but before the depth is calculated (e.g. for
// z clipping), to "correct" a location outside the face (i.e. with
// a negative barycentric coordinate) to a position on the edge of the
// face.
// cull_backfaces: Bool, Whether to only rasterize mesh faces which are // cull_backfaces: Bool, Whether to only rasterize mesh faces which are
// visible to the camera. This assumes that vertices of // visible to the camera. This assumes that vertices of
// front-facing triangles are ordered in an anti-clockwise // front-facing triangles are ordered in an anti-clockwise
@ -441,6 +456,7 @@ RasterizeMeshesFine(
// blur_radius: float distance in NDC coordinates uses to expand the face // blur_radius: float distance in NDC coordinates uses to expand the face
// bounding boxes for the rasterization. Set to 0.0 if no blur // bounding boxes for the rasterization. Set to 0.0 if no blur
// is required. // is required.
// faces_per_pixel: the number of closeset faces to rasterize per pixel.
// bin_size: Bin size (in pixels) for coarse-to-fine rasterization. Setting // bin_size: Bin size (in pixels) for coarse-to-fine rasterization. Setting
// bin_size=0 uses naive rasterization instead. // bin_size=0 uses naive rasterization instead.
// max_faces_per_bin: The maximum number of faces allowed to fall into each // max_faces_per_bin: The maximum number of faces allowed to fall into each
@ -451,6 +467,11 @@ RasterizeMeshesFine(
// coordinates for each pixel; if this is False then // coordinates for each pixel; if this is False then
// this function instead returns screen-space // this function instead returns screen-space
// barycentric coordinates for each pixel. // barycentric coordinates for each pixel.
// clip_barycentric_coords: Whether, after any perspective correction
// is applied but before the depth is calculated (e.g. for
// z clipping), to "correct" a location outside the face (i.e. with
// a negative barycentric coordinate) to a position on the edge of the
// face.
// cull_backfaces: Bool, Whether to only rasterize mesh faces which are // cull_backfaces: Bool, Whether to only rasterize mesh faces which are
// visible to the camera. This assumes that vertices of // visible to the camera. This assumes that vertices of
// front-facing triangles are ordered in an anti-clockwise // front-facing triangles are ordered in an anti-clockwise

View File

@ -48,10 +48,10 @@ RasterizePointsNaiveCuda(
// in the batch where N is the batch size. // in the batch where N is the batch size.
// num_points_per_cloud: LongTensor of shape (N) giving the number of points // num_points_per_cloud: LongTensor of shape (N) giving the number of points
// for each pointcloud in the batch. // for each pointcloud in the batch.
// radius: FloatTensor of shape (P) giving the radius (in NDC units) of
// each point in points.
// image_size: Tuple (H, W) giving the size in pixels of the output // image_size: Tuple (H, W) giving the size in pixels of the output
// image to be rasterized. // image to be rasterized.
// radius: FloatTensor of shape (P) giving the radius (in NDC units) of
// each point in points.
// points_per_pixel: (K) The number closest of points to return for each pixel // points_per_pixel: (K) The number closest of points to return for each pixel
// //
// Returns: // Returns:
@ -126,11 +126,13 @@ torch::Tensor RasterizePointsCoarseCpu(
// in the batch where N is the batch size. // in the batch where N is the batch size.
// num_points_per_cloud: LongTensor of shape (N) giving the number of points // num_points_per_cloud: LongTensor of shape (N) giving the number of points
// for each pointcloud in the batch. // for each pointcloud in the batch.
// radius: FloatTensor of shape (P) giving the radius (in NDC units) of
// each point in points.
// image_size: Tuple (H, W) giving the size in pixels of the output // image_size: Tuple (H, W) giving the size in pixels of the output
// image to be rasterized. // image to be rasterized.
// radius: FloatTensor of shape (P) giving the radius (in NDC units) of
// each point in points.
// bin_size: Size of each bin within the image (in pixels) // bin_size: Size of each bin within the image (in pixels)
// max_points_per_bin: The maximum number of points allowed to fall into each
// bin when using coarse-to-fine rasterization.
// //
// Returns: // Returns:
// points_per_bin: Tensor of shape (N, num_bins, num_bins) giving the number // points_per_bin: Tensor of shape (N, num_bins, num_bins) giving the number
@ -303,10 +305,10 @@ torch::Tensor RasterizePointsBackward(
// in the batch where N is the batch size. // in the batch where N is the batch size.
// num_points_per_cloud: LongTensor of shape (N) giving the number of points // num_points_per_cloud: LongTensor of shape (N) giving the number of points
// for each pointcloud in the batch. // for each pointcloud in the batch.
// radius: FloatTensor of shape (P) giving the radius (in NDC units) of
// each point in points.
// image_size: Tuple (H, W) giving the size in pixels of the output // image_size: Tuple (H, W) giving the size in pixels of the output
// image to be rasterized. // image to be rasterized.
// radius: FloatTensor of shape (P) giving the radius (in NDC units) of
// each point in points.
// points_per_pixel: (K) The number of points to return for each pixel // points_per_pixel: (K) The number of points to return for each pixel
// bin_size: Bin size (in pixels) for coarse-to-fine rasterization. Setting // bin_size: Bin size (in pixels) for coarse-to-fine rasterization. Setting
// bin_size=0 uses naive rasterization instead. // bin_size=0 uses naive rasterization instead.

View File

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

View File

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