-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.txt
More file actions
45 lines (32 loc) · 2.59 KB
/
README.txt
File metadata and controls
45 lines (32 loc) · 2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Splice face images generated by a GAN (specificially Progressive GAN, but not restricted to it) into a face image patch in another image.
The GAN generated image is considered hereof as donor and the image into which the GAN face is spliced is hereof the recipient image.
It is assumed that the donor image has one and only one face, which is typically the case in progressive GAN generated images at the time of writing this code. If this assumption is falsified by modification in the GAN, then it is assumed that this code will become unstable and it is up to the user to modify the code accordingly.
author: Ashish Gupta
email: ashishagupta@gmail.com
version: 0.1.0
----------------------------------------------------------------------
usage: $python pGan_fSplice.py
$python pGan_fSplice.py [option] arg
options:
"-d", "--donor", dest="donor", default="./GAN_Faces", help="path to directory containing GAN generated faces"
"-r", "--recipient", dest="recipient", default="./MediFor_Images", help="path to directory containing images into which faces are spliced"
"-o", "--output", dest="output", default="./GAN_MediFor", help="output directory into which spliced images are saved"
----------------------------------------------------------------------
Steps to follow:
1. Download GAN generated images into a directory, default is "./GAN_Faces". You can create your own directory and specify it in the input arguments
2. Download images containing faces from the MediFor browser. Save these images in directory ./MediFor_Images
3. Create an output directory, default is ./GAN_MediFor, specify path in arguments if creating your own
4. Run the program. It will read the donor and recipient images and save the output spliced images into the output directory.
----------------------------------------------------------------------
Requirements:
This program uses:
dlib (http://dlib.net/)
opencv (https://github.com/opencv/opencv)
Seek help online on installing these libraries for use with Python 3.x
The installation procedure for these libraries can vary with local system configuration.
----------------------------------------------------------------------
output file naming convention:
The resulting file is named as: <donor image name>--<recipient image name>.png
You can use the '--' to split the result file name to acquire the donor/recipient image name and change it as desired.
The program is not designed to work in all circumstances, ie. face not detected or sufficient facial landmarks not found,
for the face path is too small, etc. In all such cases, the failed output file is recorded in a log file: ./log.txt