Giter Club home page Giter Club logo

Comments (3)

shubhamcodez avatar shubhamcodez commented on July 28, 2024

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

from gfpgan.

xinntao avatar xinntao commented on July 28, 2024

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~

from gfpgan.

Kazioo avatar Kazioo commented on July 28, 2024

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

from gfpgan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.