TimoBolkart / BFM_to_FLAME

Convert from Basel Face Model (BFM) to the FLAME head model
http://flame.is.tue.mpg.de
411 stars 50 forks source link

error when running col_to_tex.py #10

Closed cysmith closed 2 years ago

cysmith commented 3 years ago

I downloaded the models from the links as shown. The model file had a different name, so I updated in the code: bfm_model = load_BFM_2017('./model/model2017-1_face12_nomouth.h5')

Then when I ran python col_to_tex.py, I get this error:

Conversion started......
Traceback (most recent call last):
  File "col_to_tex.py", line 200, in <module>
    main()
  File "col_to_tex.py", line 193, in main
    transfer_BFM_textures_to_FLAME_uv()
  File "col_to_tex.py", line 158, in transfer_BFM_textures_to_FLAME_uv
    bfm_verts_color[valid_BFM_faces[:, 1], :] * valid_BFM_b_coords[:, 1][:, np.newaxis] + \
IndexError: index 42692 is out of bounds for axis 0 with size 28588
TimoBolkart commented 3 years ago

You are using the model2017-1_face12_nomouth model which is just the face part of BFM 2017, which is not the correct file. As you use the face only mesh, the pre-computed indices exceed the number of vertices of the model. Instead, please use the full BFM 2017 model model2017-1_bfm_nomouth.