GFPGAN
GFPGAN copied to clipboard
Hair cut off
I'm using 1.4 with amazing results but where it crops the faces it cuts off half of the hair and there's a plainly visible line where sharp turns to blurry, can i make it expand the face crop to include the hair?
I have the same problem... I believe that everyone does. Couldn't figure out a way to solve this. It should either include all the hair or none. The way it actually is the photos are mostly unusable sadly. Sadly this project seems pretty much abandoned...
I found that also other image enhancer + upscaler AI webpages have similar problems, like https://replicate.com/tencentarc/gfpgan. Probably they all use same/similar models. But the border between sharp and blurry hair is not so clear on other models, it seems. Strange thing here is, that the line is always slanted, never exactly horizontal. I wonder why. Too sad this model has this flaw, it's the only image enhancer which has this great nearly freely adjustable upscaling functionality! And i need that really often.
This problem is caused by facexlib, the algorithm of mask blur is not well. So we can replace it with facelib(from codeformer). We need to replace 2 files : facexlib/utils/face_restoration_helper.py, misc.py. Then the problem will be solved
Can you be more specific please? I'd really appreciate it
You can download facelib from https://github.com/sczhou/CodeFormer, then replace 2 files: face_restoration_helper.py and misc.py, 2 files are in the following path: %Your Python Path%/Lib/site-packages/facexlib/utils