Description
I use batch render for different model with different pose. I found that if the models on a batch are different, the render color image will go wrong, but the silhouette is ok. (not sure for depth image.)
The color image is fetched by:
phong_raster_settings = RasterizationSettings(image_size=image_size, blur_radius=0.0, faces_per_pixel=1) phong_renderer = MeshRendererDepth( rasterizer=MeshRasterizer(cameras=cameras, raster_settings=phong_raster_settings), shader=TexturedSoftPhongShader(device=device)).to(device)
and the silhouette is fetched by:
`
# To blend the 100 faces we set a few parameters which control the opacity and the sharpness of edges. Refer to blending.py for more details.
blend_params = BlendParams(sigma=1e-4, gamma=1e-4)
# Define the settings for rasterization and shading. Here we set the output image to be of size 640x640. To form the blended image we use 100 faces for each pixel. Refer to rasterize_meshes.py for an explanation of this parameter.
silhouette_raster_settings = RasterizationSettings(
image_size=image_size, # longer side or scaled longer side
# blur_radius=np.log(1. / 1e-4 - 1.) * blend_params.sigma,
blur_radius=0.0,
# The nearest faces_per_pixel points along the z-axis.
faces_per_pixel=1)
# Create a silhouette mesh renderer by composing a rasterizer and a shader
silhouete_renderer = MeshRenderer(
rasterizer=MeshRasterizer(cameras=cameras,
raster_settings=silhouette_raster_settings),
shader=SoftSilhouetteShader(blend_params=blend_params)).to(device)
`
Can anyone tell me that, is it a feature or it is a bug?
The wrong result is look like:
(left is expected, right is rendered by pytorch3d.)