facebookresearch / pytorch3d

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

Empty rendered image in official tutorial "deform_source_mesh_to_target_mesh" #1625

Closed aruiplex closed 4 months ago

aruiplex commented 1 year ago

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 commented 1 year ago

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.

bottler commented 4 months ago

I think this is a browser resources thing.