Esempio n. 1
0
 def forward(
     ctx,
     points,  # (P, 3)
     cloud_to_packed_first_idx,
     num_points_per_cloud,
     image_size: int = 256,
     radius: float = 0.01,
     points_per_pixel: int = 8,
     bin_size: int = 0,
     max_points_per_bin: int = 0,
 ):
     # TODO: Add better error handling for when there are more than
     # max_points_per_bin in any bin.
     args = (
         points,
         cloud_to_packed_first_idx,
         num_points_per_cloud,
         image_size,
         radius,
         points_per_pixel,
         bin_size,
         max_points_per_bin,
     )
     # pyre-fixme[16]: Module `pytorch3d` has no attribute `_C`.
     idx, zbuf, dists = _C.rasterize_points(*args)
     ctx.save_for_backward(points, idx)
     ctx.mark_non_differentiable(idx)
     return idx, zbuf, dists
Esempio n. 2
0
 def forward(
     ctx,
     points,  # (P, 3)
     cloud_to_packed_first_idx,
     num_points_per_cloud,
     image_size: int = 256,
     radius: float = 0.01,
     points_per_pixel: int = 8,
     bin_size: int = 0,
     max_points_per_bin: int = 0,
 ):
     # TODO: Add better error handling for when there are more than
     # max_points_per_bin in any bin.
     args = (
         points,
         cloud_to_packed_first_idx,
         num_points_per_cloud,
         image_size,
         radius,
         points_per_pixel,
         bin_size,
         max_points_per_bin,
     )
     idx, zbuf, dists = _C.rasterize_points(*args)
     ctx.save_for_backward(points, idx)
     return idx, zbuf, dists