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

only paste back from already restored faces #46

Closed
NoUserNameForYou opened this issue Aug 18, 2021 · 6 comments
Closed

only paste back from already restored faces #46

NoUserNameForYou opened this issue Aug 18, 2021 · 6 comments

Comments

@NoUserNameForYou
Copy link

Is it possible to do this without restoring faces again just with 2x esrgan?

like

"python inference_gfpgan.py --upscale 2 --model_path nomodel --test_path results/restored_faces --save_root results/restored_images --paste_back_only"

?

@xinntao
Copy link
Member

xinntao commented Aug 19, 2021

Did you mean that you want to paste restored face (from other sources) to the images upsampled by real-esrgan?

@NoUserNameForYou
Copy link
Author

"(from other sources)"

Doesn't matter but also that, yes.

If I used gfpgan without paste back, I would like to continue with just pasteback without any restoration from beginning.

@xinntao
Copy link
Member

xinntao commented Aug 23, 2021

I think you can modify https://github.com/xinntao/facexlib/blob/master/facexlib/utils/face_restoration_helper.py

An easy way is to change the value face_helper.restored_faces with restored faces from other sources.

@NoUserNameForYou
Copy link
Author

There's no "face_helper.restored_faces" in the code, I ctrl+f and searched.

@xinntao
Copy link
Member

xinntao commented Aug 24, 2021

Sorry for the misunderstanding.

I mean in your script, you can re-set the restored_faces, for example:

...
face_helper = FaceRestoreHelper()

face_helper.read_img()
face_helper.get_face_landmarks_5()
face_helper.align_warp_face()
...
face_helper.restored_faces = #your custom restored faces#
...
face_helper.paste_faces_to_input_image()




@NoUserNameForYou
Copy link
Author

Thank you, will try it later.

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

2 participants