johndpope / MegaPortrait-hack

Using Claude Opus to reverse engineer code from MegaPortraits: One-shot Megapixel Neural Head Avatars
https://arxiv.org/abs/2207.07621
82 stars 8 forks source link

Stage 1 - training losses - todo contrastive_loss #14

Closed johndpope closed 6 months ago

johndpope commented 6 months ago

https://github.com/johndpope/MegaPortrait-hack/blob/main/train.py#L196

adding any of the others hits a bug with gradients.

Jie-zju commented 6 months ago

Have you noticed "losses are calculated using only foreground regions" mentioned in Paper? I tried implement the network (include somewhat different from paper ) and train it. However, just use loss on all images for training seems fail, since the training stage is not stable. I think "losses are calculated using only foreground regions" May Be Important ! Please attention on it!

johndpope commented 6 months ago

thanks for pointing this out. I fix later.

johndpope commented 6 months ago

i draft this - yet to test it out. https://github.com/johndpope/MegaPortrait-hack/pull/21/files

so much flux - needs stabilising. fyi @robinchm

I look at the patchgan stuff

johndpope commented 6 months ago

warped_driving_frame:torch.Size([3, 129, 129])

on my training branch - i implement and fix - but now the warped / cropped image is small.... i can make it bigger - or I have to work out how the network can accept smaller images.... not sure. https://github.com/johndpope/MegaPortrait-hack/tree/feat/14-training

johndpope commented 6 months ago

Screenshot from 2024-05-30 12-15-54

some progress.