menpo / lsfm

Large Scale Facial Model (LSFM) - an automatic pipeline for constructing 3D Morphable Models from large collections of facial meshes
http://ibug.doc.ic.ac.uk/resources/lsfm/
BSD 3-Clause "New" or "Revised" License
504 stars 117 forks source link

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

Open xuexiaoxiaohu opened 4 years ago

xuexiaoxiaohu commented 4 years ago

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_andsave(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 commented 4 years ago

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

a78239636 commented 4 years ago

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 commented 2 years ago

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_andsave(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?