mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-12-22 15:20:34 +08:00
Alpha channel to return the mask
Summary: Updated the alpha channel in the `hard_rgb_blend` function to return the mask of the pixels which have overlapping mesh faces. Reviewed By: bottler Differential Revision: D29001604 fbshipit-source-id: 22a2173d769f2d3ad34892d68ceb628f073bca22
This commit is contained in:
committed by
Facebook GitHub Bot
parent
ac6c07fa43
commit
a15c33a3cc
@@ -58,7 +58,8 @@ def hard_rgb_blend(colors, fragments, blend_params) -> torch.Tensor:
|
||||
) # (N, H, W, 3)
|
||||
|
||||
# Concat with the alpha channel.
|
||||
alpha = torch.ones((N, H, W, 1), dtype=colors.dtype, device=device)
|
||||
alpha = (~is_background).type_as(pixel_colors)[..., None]
|
||||
|
||||
return torch.cat([pixel_colors, alpha], dim=-1) # (N, H, W, 4)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user