Skip to content

Commit

Permalink
diferentiate emo and pose loss
Browse files Browse the repository at this point in the history
  • Loading branch information
JaLnYn committed Jul 7, 2024
1 parent 178398f commit df2b03a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ def train_model(config, p, train_loader):
if p.config['weights']['irfd']['i'] != 0:
wandb_log['Identity IRFD Loss'] = Liep[1]['iden_loss'].item()
if p.config['weights']['irfd']['e'] != 0:
wandb_log['Identity IRFD Loss'] = Liep[1]['emot_loss'].item()
wandb_log['Emotion IRFD Loss'] = Liep[1]['emot_loss'].item()
if p.config['weights']['irfd']['p'] != 0:
wandb_log['Identity IRFD Loss'] = Liep[1]['pose_loss'].item()
wandb_log['Pose IRFD Loss'] = Liep[1]['pose_loss'].item()
if p.config['weights']['gan']['real'] + p.config['weights']['gan']['fake'] + p.config['weights']['gan'][
'feature_matching'] != 0:
wandb_log['GAN Loss'] = Lgan[0].item()
Expand Down

1 comment on commit df2b03a

@johndpope
Copy link

@johndpope johndpope commented on df2b03a Jul 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im running training now https://github.com/johndpope/talkinghead/tree/new_model

https://wandb.ai/snoozie/portrait_project/runs/yfkh0f8h?nw=nwusersnoozie

My repo hasn't successfully implemented the stylegan stuff - so this is a step forward.
I was eroneously using the resnet 2048 features - ( checking megaportrait code - i don't know why i was doing that)
https://github.com/johndpope/MegaPortrait-hack/blob/09c02f169ee64f6e55a1fe6fe530aebf20e29019/resnet50.py#L173
but couldn't get that working - so shrink them down to 512 as your encoders do - and then my adjusted code started working in place with yours.
UPDATE
rereading EmoPortrait it says you can go to 128.

 encoder.fc = nn.Sequential(
        nn.Linear(2048, 128),
        nn.Tanh()
    )

https://arxiv.org/pdf/2404.19110#page=3.35

Screenshot from 2024-07-08 14-34-44

in your code - your cherry picking a couple of frames from a mp4 - but why not stream through them all.....

in my affectnet dataset (just picture based) - i have the emotion detection already there - so it should return an index for each image.

UPDATE
got a bit tangle with steps - generator sizes -
just want to start with 64x64 - will look again later - gotta pick up the kids.

Please sign in to comment.