yfeng95 / DECA

DECA: Detailed Expression Capture and Animation (SIGGRAPH 2021)
Other
2.11k stars 420 forks source link

Lack of `template.mtl` file #67

Open pstorozenko opened 2 years ago

pstorozenko commented 2 years ago

Hi, these results are very interesting! However I keep getting the following warning:

UserWarning: Mtl file does not exist: /home/jupyter/DECA/data/template.mtl
  warnings.warn(f"Mtl file does not exist: {f}")

Where does template.mtl file should come from? There is no such file in yours archive, BFM nor FLAME model files. Am I missing something?

zhih-li commented 2 years ago

same issue

mkh321 commented 2 years ago

same issue

lin-girl commented 2 years ago

Enter on the command line:python demos/demo_reconstruct.py -i TestSamples/examples --saveDepth True --saveObj True

pstorozenko commented 2 years ago

@lin-girl, thanks for answering! I've tried what you've written but I get:

python demos/demo_reconstruct.py -i TestSamples/examples --saveDepth True --saveObj True
creating the FLAME Decoder
trained model found. load /home/jupyter/DECA/data/deca_model.tar
/opt/conda/envs/deca/lib/python3.7/site-packages/pytorch3d/io/obj_io.py:533: UserWarning: Mtl file does not exist: /home/jupyter/DECA/data/template.mtl
  warnings.warn(f"Mtl file does not exist: {f}")
  0%|                                                                                                                                                                     | 0/9 [00:00<?, ?it/s]/opt/conda/envs/deca/lib/python3.7/site-packages/torch/nn/functional.py:3458: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details.
  "See the documentation of nn.Upsample for details.".format(mode)
/opt/conda/envs/deca/lib/python3.7/site-packages/torch/nn/functional.py:3829: UserWarning: Default grid_sample and affine_grid behavior has changed to align_corners=False since 1.3.0. Please specify align_corners=True if the old behavior is desired. See the documentation of grid_sample for details.
  "Default grid_sample and affine_grid behavior has changed "
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 9/9 [00:20<00:00,  2.24s/it]
-- please check the results in TestSamples/examples/results

And resulting obj looks as following: image

It seems as template.mtl is not generated but should be delivered somewhere, am I right? Maybe I set something wrong and you quickly see what might be the issue, thanks helping :)

Nyquist0 commented 2 years ago

Add parameter --useTex True Try this command python demos/demo_reconstruct.py -i TestSamples/examples --saveDepth True --saveObj True --useTex True

pstorozenko commented 2 years ago

Thanks for answering @Nyquist0 !!! The results seem different but I still get the following error regarding template.mtl

python demos/demo_reconstruct.py -i TestSamples/examples --saveDepth True --saveObj True --useTex True
creating the FLAME Decoder
trained model found. load /home/jupyter/DECA/data/deca_model.tar
/opt/conda/envs/deca/lib/python3.7/site-packages/pytorch3d/io/obj_io.py:533: UserWarning: Mtl file does not exist: /home/jupyter/DECA/data/template.mtl
  warnings.warn(f"Mtl file does not exist: {f}")
  0%|                                                     | 0/9 [00:00<?, ?it/s]/opt/conda/envs/deca/lib/python3.7/site-packages/torch/nn/functional.py:3458: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details.
  "See the documentation of nn.Upsample for details.".format(mode)
/opt/conda/envs/deca/lib/python3.7/site-packages/torch/nn/functional.py:3829: UserWarning: Default grid_sample and affine_grid behavior has changed to align_corners=False since 1.3.0. Please specify align_corners=True if the old behavior is desired. See the documentation of grid_sample for details.
  "Default grid_sample and affine_grid behavior has changed "
100%|█████████████████████████████████████████████| 9/9 [00:13<00:00,  1.50s/it]
-- please check the results in TestSamples/examples/results

And the resulting obj looks like: image

However, resulting _vis file contains fitted texture, I don't know how to understand this.

IMG_0392_inputs_vis

Some help on how to obtain an obj with fitted texture, not glued photo will be much appreciated!.

arshamg commented 2 years ago

I am having a similar issue regarding the lack of template.mtl - would appreciate any help on how to resolve this issue.

zhih-li commented 2 years ago

I am having a similar issue regarding the lack of template.mtl - would appreciate any help on how to resolve this issue.

is it raise error from Pillow package? i guess you can follow this https://stackoverflow.com/questions/42462431/oserror-broken-data-stream-when-reading-image-file

from PIL import Image, ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
pstorozenko commented 2 years ago

Hmm, thanks for answering, but it's a raised by pytorch3d. Maybe I didn't explain it clearly, but the template.mtl file doesn't really exist anywhere on the disk. Should it be like that?

kevinlee9 commented 2 years ago

Hmm, thanks for answering, but it's a raised by pytorch3d. Maybe I didn't explain it clearly, but the template.mtl file doesn't really exist anywhere on the disk. Should it be like that?

Hi, have you found the mtl file finally?

lxzlwhy commented 2 years ago

@pstorozenko HI , is there only have 5023 vertices in the reconstruction result obj file? But I see that he display have more vertices.

Javisda commented 1 year ago

Hi guys, you can solve this error adding a template.mtl file on your own with this info inside: newmtl FaceTexture map_Kd mean_texture.jpg

lxdphys commented 1 year ago

Hi guys, you can solve this error adding a template.mtl file on your own with this info inside: newmtl FaceTexture map_Kd mean_texture.jpg @Javisda Hi, bro, I met the same issue at Emoca reference. Do you mean that I can write a template.mtl file with newmtl FaceTexture map_Kd mean_texture.jpg which can fix this issue?

zardamhussain commented 6 months ago

Hello @Javisda Can u tell where is map_Kd mean_texture.jpg

Pojzo commented 2 months ago

@zardamhussain It's located in the data directory under a different name - mean_texture.jpg. I created the mtl file manually and used the jpg file and it seems to be working.