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

AttributeError: 'TriMesh' object has no attribute 'texture' #34

Open
xuexiaoxiaohu opened this issue Apr 8, 2020 · 3 comments
Open

Comments

@xuexiaoxiaohu
Copy link

Hi,I do not know whether this project were maintained. I am very interested in it.
my input dir are mesh obj and mtl and png ,but when i run the code it shows AttributeError: 'TriMesh' object has no attribute 'texture'.
(lsfm) lii@lii:~$ lsfm -o /media/lii/dataset/300id/output51 -i /media/lirui/dataset/300id/prepared51

Input directory provided - scanning for importable meshes
Found 4 input meshes under: /media/lii/dataset/300id/prepared51
Resuming processing for output directory: /media/lii/dataset/300id/output51
Current meshes are the same as the meshes in the input dir - resuming
Outputting results to /media/lii/dataset/300id/output51

****** 1. DENSE CORRESPONDENCE **********

Traceback (most recent call last):
File "/home/lii/anaconda3/envs/lsfm/bin/lsfm", line 285, in
main(docopt(doc))
File "/home/lii/anaconda3/envs/lsfm/bin/lsfm", line 269, in main
correspond_and_save(r, id_, path, verbose=verbose)
File "/home/lii/anaconda3/envs/lsfm/bin/lsfm", line 76, in correspond_and_save
mesh = lio.import_mesh(path)
File "/home/lii/anaconda3/envs/lsfm/lib/python3.5/site-packages/lsfm/io.py", line 41, in import_mesh
if mesh.texture.pixels.dtype != np.float64:
AttributeError: 'TriMesh' object has no attribute 'texture'

Thank you and look forward to your reply

@cvmaker93
Copy link

Hi,I also encountered the same problem. How did you solve it?

@a78239636
Copy link

a78239636 commented Oct 30, 2020

Hi,I also encountered the same problem. How did you solve it?

It seemed your input file dont't satify some requirements.
your input file will satify one of :

  1. (texture, tcoords) , then will be treated as TexturedTriMesh
  2. (colour_per_verte), then will be treated as ColouredTriMesh
  3. none, will be treated as TriMesh.

After above step, whaterver your TriMesh type is , will execute (if mesh.texture.pixels.dtype != np.float64:), so if it's not TexturedTriMesh, will get this error. If I misunderstand something, please correct.

@cavalier501
Copy link

Hi,I also encountered the same problem. How did you solve it?

It seemed your input file dont't satify some requirements. your input file will satify one of :

  1. (texture, tcoords) , then will be treated as TexturedTriMesh
  2. (colour_per_verte), then will be treated as ColouredTriMesh
  3. none, will be treated as TriMesh.

After above step, whaterver your TriMesh type is , will execute (if mesh.texture.pixels.dtype != np.float64:), so if it's not TexturedTriMesh, will get this error. If I misunderstand something, please correct.

thanks for answering, there is an obj and a mesh where color of any vertex is stored in "v" line, no extra uv map. it seems like "ColouredTriMesh".
there is another warning:

/data3/zh/anaconda3/envs/lsfm/lib/python3.5/site-packages/menpo3d/io/input/mesh/base.py:53: UserWarning: texture was found, but no tcoords were recovered, reverting to an untextured mesh.

finally, the error says:

warnings.warn('texture was found, but no tcoords were recovered, '
Traceback (most recent call last):
File "/data3/zh/anaconda3/envs/lsfm/bin/lsfm", line 285, in
main(docopt(doc))
File "/data3/zh/anaconda3/envs/lsfm/bin/lsfm", line 269, in main
correspond_and_save(r, id_, path, verbose=verbose)
File "/data3/zh/anaconda3/envs/lsfm/bin/lsfm", line 76, in correspond_and_save
mesh = lio.import_mesh(path)
File "/data3/zh/anaconda3/envs/lsfm/lib/python3.5/site-packages/lsfm/io.py", line 41, in import_mesh
if mesh.texture.pixels.dtype != np.float64:
AttributeError: 'TriMesh' object has no attribute 'texture'

so, could you please tell how to solve the probem?

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

No branches or pull requests

4 participants