pytorch3d icon indicating copy to clipboard operation
pytorch3d copied to clipboard

Empty rendered image in official tutorial "deform_source_mesh_to_target_mesh"

Open aruiplex opened this issue 2 years ago • 1 comments

Hi! I am new to Pytorch3d and I am learning the tutorial.

🐛 Bugs / Unexpected behaviors

But I find that there are empty outputs in these two lines:

plot_pointcloud(trg_mesh, "Target mesh")
plot_pointcloud(src_mesh, "Source mesh")

I tried on Colab and the local environment. Here are the screenshots:

The local env:

image

The Colab:

image

It seems like all the outputs in this tutorial not working.

aruiplex avatar Sep 03 '23 08:09 aruiplex

I find if I change the function to

def plot_pointcloud(mesh, title=""):
    # Sample points uniformly from the surface of the mesh.
    points = sample_points_from_meshes(mesh, 5000)
    x, y, z = points.clone().detach().cpu().squeeze().unbind(1)
    fig = plt.figure(figsize=(5, 5))
    ax = fig.add_subplot(projection='3d')
    ax.scatter(x, -y, z)
    ax.set_xlabel('x')
    ax.set_ylabel('z')
    ax.set_zlabel('y')
    ax.set_title(title)
    ax.view_init(190, 30)
    plt.show()

It works, but not that beautiful.

aruiplex avatar Sep 03 '23 09:09 aruiplex