Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how can i change the face area to be cropped larger? #53

Open
nowfalsalahudeen opened this issue Aug 27, 2021 · 3 comments
Open

how can i change the face area to be cropped larger? #53

nowfalsalahudeen opened this issue Aug 27, 2021 · 3 comments

Comments

@nowfalsalahudeen
Copy link

No description provided.

@shubhamcodez
Copy link

There should be some cropping & scaling options for that or just crop before input.

@xinntao
Copy link
Member

xinntao commented Aug 29, 2021

GFPGAN currently requires cropped and aligned face.
The cropping and aligning procedures are the same as FFHQ dataset.

I think if you want to use larger cropped face area, you also need to re-train the model~

@Kazioo
Copy link

Kazioo commented Oct 27, 2022

Not sure if this is the best way to do it, but it works.
You can make the cropped area bigger, by editing lines 81 nad 82 in in utils.py.
It will improve hair and ears (if they are cut in 1.0 crop) but it will degrade the face identity.
So you may need to overlay a properly upscaled face on top of it later in editing software.

For example:

face_size=512,            crop_ratio=(1, 1)                # original, the only correct one!
face_size=420,            crop_ratio=(1.22, 1.22),
face_size=394,            crop_ratio=(1.3, 1.3),          
face_size=320,            crop_ratio=(1.6, 1.6),         # good for hair and ears, but will mess the face up really badly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants