GFPGAN icon indicating copy to clipboard operation
GFPGAN copied to clipboard

Hair cut off

Open CommanderLake opened this issue 1 year ago • 7 comments

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?

CommanderLake avatar Mar 30 '23 19:03 CommanderLake

Capture

CommanderLake avatar Mar 30 '23 19:03 CommanderLake

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...

Loacoon1 avatar Jul 18 '23 07:07 Loacoon1

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.

Luzifr avatar Jul 27 '23 14:07 Luzifr

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

sutte avatar Mar 23 '24 19:03 sutte

Can you be more specific please? I'd really appreciate it

johnbilnn avatar May 09 '24 14:05 johnbilnn

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

sutte avatar May 10 '24 17:05 sutte