chaofengc / PSFRGAN

PyTorch codes for "Progressive Semantic-Aware Style Transformation for Blind Face Restoration", CVPR2021
Other
370 stars 68 forks source link

A question about training the FPN #45

Closed JimjimChen closed 2 years ago

JimjimChen commented 2 years ago

微信图片_20211126162849 微信图片_20211126162941

First of all, thank you very much for your work. I met the above problem when I trained FPN. Do you know how to solve it? Looking forward to your reply.

chaofengc commented 2 years ago

It seems that your data is incorrect. Please follow readme and generate the correct data.

Download CelebAHQ-Mask dataset. Generate CelebAMask-HQ-mask and CelebAMask-HQ-mask-color with the provided scripts in CelebAMask-HQ/face_parsing/Data_preprocessing/.

After that, put the folder CelebAMask-HQ-mask and CelebAMask-HQ-mask-color under ../datasets/CelebAMask-HQ

JimjimChen commented 2 years ago

It seems that your data is incorrect. Please follow readme and generate the correct data.

Download CelebAHQ-Mask dataset. Generate CelebAMask-HQ-mask and CelebAMask-HQ-mask-color with the provided scripts in CelebAMask-HQ/face_parsing/Data_preprocessing/.

After that, put the folder CelebAMask-HQ-mask and CelebAMask-HQ-mask-color under ../datasets/CelebAMask-HQ

Many thanks!I have another question: when I finished generating 'CelebAMask-HQ-mask' , is the next step to run 'g_color.py’ directly?
When I run 'g_color.py' , I met a error : NameError : name 'im_base' is not defined. Do you know how to fix it? 微信图片_20211128104100

chaofengc commented 2 years ago

Actually, training FPN does not need the colored mask. Please refer to the code:

https://github.com/chaofengc/PSFRGAN/blob/82a8755116d61e83a302b7e48fb61c53c36e34c9/data/celebahqmask_dataset.py#L28-L29

You may simply put the generated mask folder CelebAMask-HQ-mask and corresponding image folder CelebA-HQ-img under the dataroot.