Skip to content

Commit

Permalink
Make loading of certain components optional
Browse files Browse the repository at this point in the history
  • Loading branch information
radekd91 committed Feb 10, 2023
1 parent c47f155 commit 9170ab5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gdl/models/DECA.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def _init_lipread_loss(self):
"""
Initialize the au perceptual loss (not currently used in EMOCA)
"""
if 'lipread_loss' in self.deca.config.keys():
if 'lipread_loss' in self.deca.config.keys() and self.deca.config.lipread_loss.get('load', True):
if self.lipread_loss is not None:
force_override = True if 'force_override' in self.deca.config.lipread_loss.keys() \
and self.deca.config.lipread_loss.force_override else False
Expand Down
9 changes: 6 additions & 3 deletions gdl/models/EmoDECA.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,12 @@ def __init__(self, config):
"stage_name": "testing",
}
# instantiate the face net
self.deca = instantiate_deca(config.model.deca_cfg, deca_stage , "test", deca_checkpoint, deca_checkpoint_kwargs)
self.deca.inout_params.full_run_dir = config.inout.full_run_dir
self._setup_deca(False)
if bool(deca_checkpoint):
self.deca = instantiate_deca(config.model.deca_cfg, deca_stage , "test", deca_checkpoint, deca_checkpoint_kwargs)
self.deca.inout_params.full_run_dir = config.inout.full_run_dir
self._setup_deca(False)
else:
self.deca = None

# which latent codes are being used
in_size = 0
Expand Down

0 comments on commit 9170ab5

Please sign in to comment.