TencentARC / InstantMesh

InstantMesh: Efficient 3D Mesh Generation from a Single Image with Sparse-view Large Reconstruction Models
Apache License 2.0
3.03k stars 313 forks source link

texture problem #67

Open AzizAydin97 opened 4 months ago

AzizAydin97 commented 4 months ago

thanks for the great work. i have a problem when I am running the code on colab environment . the results given doesn't include the texture of the body. however , when I use the code on huggingface it give me the results with a textured 3d structure as shown in the below figure. Screenshot 2024-05-05 213932

when I use the code on colab it only give me this result image which has no texture.

please can you help me

thanks

AzizAydin97 commented 4 months ago

please i would appreciate your respond

bluestyle97 commented 4 months ago

How did you visualize the mesh? The huggingface demo exports a mesh with vertex color, while the colab script exports a mesh with texture map. Do you have the .mtl file and .png texture map under the same path with the `.obj' mesh?

AzizAydin97 commented 4 months ago

How did you visualize the mesh? The huggingface demo exports a mesh with vertex color, while the colab script exports a mesh with texture map. Do you have the .mtl file and .png texture map under the same path with the `.obj' mesh?

i visualized the model in windows using 3D viewer yes. actually i have the .PNG, .mtl, and .obj files together . they're generated. but i want to get the .obj file with colors and texture as the output in hugging face. or do i have to combine the .obj file alongside with the. mtl file ? i would appreciate your answer

sumanttyagi commented 4 months ago

@bluestyle97 can we play with render_resolution: 512 ? to get better resolution ?

christopi commented 1 month ago

Originally, obj file does not implemented texture. For texture embedding, should convert obj to ply or glb. To convert .obj files to other formats like .ply or .glb can be done with libraries such as trimesh, pyrender, and pygltflib

import trimesh

# Load the .obj file
mesh = trimesh.load('model.obj')

# Export to .ply
mesh.export('model.ply')

if you need more help, please contact me.

AbhinavJangra29 commented 3 weeks ago

hey @trueices thanks for the response, but is there a way we could integrate the obj,mtl and the png file to generate a colored mesh instead. could you provide a simple working code , thanks