radekd91 / emoca

Official repository accompanying a CVPR 2022 paper EMOCA: Emotion Driven Monocular Face Capture And Animation. EMOCA takes a single image of a face as input and produces a 3D reconstruction. EMOCA sets the new standard on reconstructing highly emotional images in-the-wild
https://emoca.is.tue.mpg.de/
Other
686 stars 88 forks source link

Wrong checkpoint paths for emotion recognition #17

Open Alpe6825 opened 2 years ago

Alpe6825 commented 2 years ago

I tried to run python demos/test_emotion_recognition_on_images.py --model_type 3dmm --model_name EMOCA-emorec but always get an error that the model checkpoint does not exist - independent which model I choose.

my working directory is gdl_apps/EmotionRecognition

For example:

FileNotFoundError: [Errno 2] No such file or directory: '/is/cluster/work/rdanecek/emoca/finetune_deca/2021_11_09_19-05-01_5101174495546322475_ExpDECA_Affec_clone_NoRing_EmoB_F2_DeSegrend_BlackB_Aug_early/detail/checkpoints/last.ckpt'

Moon0316 commented 1 year ago

Hello, I've faced the same problem, it seems like a bug during the loading process of DECA model. Have you sloved it?

Moon0316 commented 1 year ago

I know, we don't need DECA in emotion recognition, you can set 'deca_checkpoint' in assets/EmotionRecognition/face_reconstruction_based/EMOCA-emorec/cfg.yaml as null

JSHZT commented 1 year ago

Does this mean that this part can be cleared? @Moon0316

Alpe6825 commented 1 year ago

Sorry for late answering. @JSHZT I will check the hint from @Moon0316 the next days and will close the issue if its works.

shuishiwojiade commented 1 year ago

Hello,Has the problem been solved?

magictower commented 1 year ago

I had the problem and got a solution. open the file gdl_apps.EmotionRecognition.utils.io, in def replace_asset_dirs(cfg, output_dir : Path, ): (about line 50) find if 'deca_cfg' in cfg.keys(): (about line 52) change to if 'deca_cfg' in cfg.model.keys(): second, at def load_model(output_dir): (about line 77) print cfg. find the key of error route. The key is "cfg.model.deca_checkpoint". Assign it your checkpoint route. After modifying 2 points above, save io.py and run demo code. It could carry out.

tanshuai0219 commented 9 months ago

I got the same problem and solved it by set: assets/EmotionRecognition/face_reconstruction_based/EMOCA-emorec/cfg.yaml line 31:as /your_path/emoca-release-EMOCA_v2/assets/EMOCA/models/DECA/detail/checkpoints/deca-epoch=00-val_loss/dataloader_idx_0=2.2233.ckpt

katariaak579 commented 8 months ago

Even after changing the line 31 as the correct .ckpt path still gives same error.

katariaak579 commented 8 months ago

@magictower can you please elaborate the second point a bit more exactly what are we supposed to do in the load_model function