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

quick fix for emotion recognition #64

Open
wants to merge 2 commits into
base: release/EMOCA_v2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions gdl_apps/EmotionRecognition/utils/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ def load_configs(run_path):



def replace_asset_dirs(cfg, output_dir : Path, ):
def replace_asset_dirs(cfg, output_dir : Path, deca_checkpoint_path : Path = None):
asset_dir = get_path_to_assets()
if 'deca_cfg' in cfg.keys():
if 'deca_cfg' in cfg.model.keys():
# cfg.model.deca_cfg.inout.output_dir = str(output_dir.parent)
# cfg.model.deca_cfg.inout.full_run_dir = str(output_dir / mode)
# cfg.model.deca_cfg.inout.checkpoint_dir = str(output_dir / mode / "checkpoints")
Expand All @@ -70,6 +70,12 @@ def replace_asset_dirs(cfg, output_dir : Path, ):
# cfg.model.emonet_model_path = str(asset_dir / "EmotionRecognition/image_based_networks/ResNet50")
cfg.model.deca_cfg.model.emonet_model_path = ""

if not bool(cfg.model.deca_checkpoint):
if deca_checkpoint_path is not None:
cfg.model.deca_checkpoint = str(deca_checkpoint_path)
else:
print("[WARNING] Pointing the EMOCA-based emotion recognition model to the original EMOCA version")
cfg.model.deca_checkpoint = str(asset_dir / "EMOCA/models/EMOCA/detail/checkpoints/deca-epoch=03-val_loss/dataloader_idx_0=9.44489288.ckpt")
return cfg


Expand Down
2 changes: 1 addition & 1 deletion requirements38.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ docker-pycreds~=0.4.0
docutils~=0.16
dominate~=2.6.0
easydict~=1.9
face-alignment~=1.3.3
face-alignment~=1.3.4
facenet-pytorch~=2.5.1
flatbuffers~=1.12
freetype-py~=2.2.0
Expand Down