facebookresearch / pytorch3d

PyTorch3D is FAIR's library of reusable components for deep learning with 3D data
https://pytorch3d.org/
Other
8.81k stars 1.32k forks source link

Why pytorch3d render a mesh mask to different colors (i.e., surfaces are white, edges are gray)? #1632

Closed SwordHolderSH closed 1 year ago

SwordHolderSH commented 1 year ago

We would like to ask that why pytorch3d render a mesh mask to different colors (i.e., surfaces are white, edges are gray)?

As shown in the following Figure, in the rendered mask, the rendered surfaces are white and the rendered edges are gray.

Could you please tell me how to render the mesh mask to the ideal mask (rendered surfaces and edges are all white) in the Figure?

sample

bottler commented 1 year ago

Is the mesh watertight? If it is, perhaps you are seeing the edges due to soft blending. Can you try using a BlendParams with a lower sigma?

Feel free to share how you initialize the renderer.

SwordHolderSH commented 1 year ago

Is the mesh watertight? If it is, perhaps you are seeing the edges due to soft blending. Can you try using a BlendParams with a lower sigma?

Feel free to share how you initialize the renderer.

Thank you for your kind help!

We found that this is caused by the soft blending in Soft-Rasterizer, and gray edges can be avoided by reducing sigma.

unlugi commented 11 months ago

Could you please provide a code sample that solves this issue? thank you.