Lately we have seen some really high-quality artificial intelligence projects that can be used to artificially generate human faces or generate missing facial parts or replace faces. First, there was Deep Fake project that can replace someone’s face in a video with someone else’s face. Then we saw a project called fake face generator that can generate real-looking faces of people who never existed on this planet. And now we have SC-FEGAN (Face Editing Generative Adversarial Network with user’s Sketch and Color) a project from the computer science department of Cornell University.
SC-FEGAN allows you to edit and generate facial pictures by using free-form mask, sketch and color as the input. It is written in Python and before you can run it in your Windows PC, you have to download some files and install many components.
Here is how you can use it in Windows 10 PC:
- Download Python 3.7 and install it in your Windows PC. During the setup choose to set Python to PATH and associate Python files.
- Launch a command prompt (Win+X and select Command Prompt) and give the following commands one at a time:
pip install numpy pip install PyQt5 pip install pyyaml pip install opencv-python pip install tensorflow
- Download large model data file (SC-FEGAN.ckpt.data-00000-of-00001) from Google Drive and place in a folder C:\ckpt\.
- Download SC-FEGAN project from GitHub (https://github.com/JoYoungjoo/SC-FEGAN/archive/master.zip) and extract it in same folder as model data file (C:\ckpt\).
- Edit demo.yaml file and change the the model data folder which in our case is C:\ckpt\SC-FEGAN.ckpt. Save the file and now you are ready to go.
- Double-click on demo.py to launch the SC-FEGAN project. After a few seconds, the GUI will appear and you can now open an image for editing.
Basically if you want to modify a part of the face, first you have to use mask tool on that area. Then you can use sketch or color brush tool to redesign that part. Afterwards, you can click on the Complete button to see the results. The project comes with sample face images to work with. It works best with square sized images.
For more technical information, you can visit Cornell University website at https://arxiv.org/abs/1902.06838.