AIRI-Institute/HairFastGAN

how to corp a face

Closed this issue · 2 comments

The examples looks very good, but my own picture is very bad. So, how to corp a face as examples in the input folder

Hello,
Since the method works in StyleGAN space, the images for the method really need to be cropped.

The simplest way to achieve this is by running the method with the align=True flag enabled. For example:

hair_fast.swap(face, shape, color, align=True)

You can observe the inference with such a command in the Colab notebook on internet pictures.

Alternatively, you can utilize the scripts/align_face.py script that has been added in the latest version. This script will crop all images to the format required by the method. To do this, simply create an ‘unprocessed’ folder with all the unprocessed photos and run the script:

python scripts/align_face.py

All processed photos will be saved in the input directory.

I hope this helps! If you encounter any additional issues, please let me know.

it works, thanks