mirror of
https://github.com/TencentARC/GFPGAN.git
synced 2026-04-27 00:01:00 +00:00
Restore face without colorizing them #14
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @syfbme on GitHub (Jul 5, 2021).
I wonder if your model be able to do this. Thanks.
@xinntao commented on GitHub (Jul 5, 2021):
The model can be fine-tuned to restore face w/o color. You could fine-tune it with the training codes (turn off the color augmentations in the config file).
We will upload such a model later~
@syfbme commented on GitHub (Jul 5, 2021):
Thanks for your quick reply. But how to turn off the color augmentations? I only find 4 settings in file train_gfpgan_v1.yml:
color_jitter_prob: 0.3
color_jitter_shift: 20
color_jitter_pt_prob: 0.3
gray_prob: 0.01
@syfbme commented on GitHub (Jul 5, 2021):
Do you mean that we set gray_prob to 0 so that model won't colorize it?
@xinntao commented on GitHub (Jul 5, 2021):
@syfbme
You can try:
have a very slight color jitter
or
totally no color jitter
@syfbme commented on GitHub (Jul 6, 2021):
Hi @xinntao
Thanks for your advise. But i am confused. What i want is to keep black white photo the same color without colorizing them. So i think set "gray_prob" to 0 so that model won't learn the mapping from gray to color. The settings you advised is no color jitter but the model is still able to learn the mapping from gray to color(RGB). Please correct me if i am wrong. Looking forward to your reply~
@xinntao commented on GitHub (Jul 6, 2021):
we also set
gt_gray, which means we also make the targets to be gray. Such a setting is for better generalization for gray photos.@syfbme commented on GitHub (Jul 12, 2021):
Hi @xinntao
When do you plan to upload the model? Looking forward to it.
@syfbme commented on GitHub (Jul 19, 2021):
Hi @xinntao How to set the config file when fin-tuning the pretrained model.


There are 4 pretrained models but there are much more pretrained path in yml file:
How do i set each value?
Maybe just load pretrained network g and training others from beginning?
@xinntao commented on GitHub (Jul 21, 2021):
@syfbme
modify the
pretrain_network_gto the path to GFPGANv1.pthAnd you can train others from scratch ~
@syfbme commented on GitHub (Jul 21, 2021):
I am already doing this. Since the training is slow, i will paste the result later
@syfbme commented on GitHub (Jul 27, 2021):
Hi @xinntao

Current result is promising. I have set parameters as you suggested.
color_jitter_prob: ~ color_jitter_shift: 20 color_jitter_pt_prob: ~ gray_prob: 0.01 gt_gray: TrueAfter 572k training steps, the result is as below:
The color is fading. However, it still colorize the below part of face. I will set the gray_prob larger(such as 0.2) to continue fine-tuning current model. Do you have any suggestions?
@xinntao commented on GitHub (Jul 27, 2021):
If you do not want to have any color enhancement, you may set
color_jitter_shift: ~@syfbme commented on GitHub (Jul 27, 2021):
I have already set "color_jitter_prob: ~", so the "color_jitter_shift" will never be used, right?
@xinntao commented on GitHub (Jul 27, 2021):
OK, you are right.
@tachikoma777 commented on GitHub (Jul 31, 2021):
May I ask when you plan to release pretrain mode w/o color change? Looking forward to it!
@xinntao commented on GitHub (Aug 3, 2021):
@tachikoma777
If the training is OK, I will release it this week;-)
@xinntao commented on GitHub (Aug 6, 2021):
@tachikoma777 @syfbme
I have updated the model without colorization. Colab demo: https://colab.research.google.com/drive/1sVsoBd9AjckIXThgtZhGrHRfFI6UUYOo
@TracelessLe commented on GitHub (Nov 11, 2021):
Hi @xinntao @syfbme, I have set "color_jitter_prob: ~" and retrain, but the restore results of gray images are still with colorization. Would you please give some advice.
The config of dataset is listed below: