Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hot to save ply with colors #942

Closed
YaroslavShchekaturov opened this issue Nov 18, 2021 · 16 comments
Closed

hot to save ply with colors #942

YaroslavShchekaturov opened this issue Nov 18, 2021 · 16 comments
Labels

Comments

@YaroslavShchekaturov
Copy link

YaroslavShchekaturov commented Nov 18, 2021

Tutorial :https://pytorch3d.org/tutorials/fit_textured_mesh

Follwing #913 I want to save my cow mesh as a ply with textures. To do that I've used

IO().save_mesh(new_mesh, "final_model.ply", binary=False, colors_as_uint8=True). but results seems weird in Meshlab.

image

image

How can I save ply such that Ill have the same colors as in my jupyter notebook?

@bottler
Copy link
Contributor

bottler commented Nov 18, 2021

I think meshlab has not read the colors at all and you are seeing a lighting effect.
What happens if you save with binary=False?
Note that you can't pass verts_colors to our IO().save_mesh - it will be ignored. The colors need to be in the mesh.

@YaroslavShchekaturov
Copy link
Author

Hi Jeremy!

I've tried both with binary=False and with binary=True - results are the same. This is the result without verts_colors which is the same
image

@YaroslavShchekaturov
Copy link
Author

I'm using pytorch3d 0.6 version now

@bottler
Copy link
Contributor

bottler commented Nov 18, 2021

Can you share the ply file here?

@bottler
Copy link
Contributor

bottler commented Nov 18, 2021

That file contains the same PLY data twice, not sure why. But the colors are as you've displayed in your meshlab screenshots: white with blue patches. I think the saving worked, it just doesn't look like the original cow.

@YaroslavShchekaturov
Copy link
Author

I did the same rutine once again and got this this ply file https://drive.google.com/file/d/178QgiqtAJJT132jrkxN5O8QtKDryvAy4/view?usp=sharing

@bottler
Copy link
Contributor

bottler commented Nov 18, 2021

It's also mostly white with some other colors. I think you are successfully writing data from PyTorch3D which can be read by meshlab. What is your question?

@YaroslavShchekaturov
Copy link
Author

I just do not understand why I have thsese magenta faces and how to get out of them

image

@bottler
Copy link
Contributor

bottler commented Nov 18, 2021

I think you have them in your notebook with PyTorch3D, which you have based on the tutorial. Can you look at that? And look what data is in the mesh you are saving and how it got there. Maybe use plot_batch_individually on the mesh object in the notebook.

@YaroslavShchekaturov
Copy link
Author

But why dont I see them during vizualisation? If I visualize my mesh I get
image

@bottler
Copy link
Contributor

bottler commented Nov 18, 2021

What's the difference between new_mesh and new_src_mesh? Could you share the whole ipynb?

@YaroslavShchekaturov
Copy link
Author

new_mesh and new_src_mesh are the same!
Sure! https://drive.google.com/file/d/1X6iZUrqLojhQVJVRC2_0eym2ZW-wL9rN/view?usp=sharing

@bottler
Copy link
Contributor

bottler commented Dec 9, 2021

I don't understand what has happened in your program. Could the colours in the PyTorch3D texture escape the [0,1] range?

@github-actions
Copy link

github-actions bot commented Jan 9, 2022

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Jan 9, 2022
@github-actions
Copy link

This issue was closed because it has been stalled for 5 days with no activity.

@klloggss
Copy link

klloggss commented Oct 4, 2022

I have exactly the same issue. The .ply model looks fine if I plot it in code, but if I want to export it has some strange blue areas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants