- Notifications
You must be signed in to change notification settings - Fork133
Larger resolution face masked, weirdly warped, deepfake,
License
dfaker/df
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Larger resolution face masked, weirdly warped, deepfake, requireshttps://github.com/keras-team/keras-contrib.git andhttps://github.com/1adrianb/face-alignment.git to be cloned into the root of the repo and A and B's alignments.json to be copied into the correct /data/* folder before training.
Inputs are 64x64 images outputs are a pair of 128x128 images one RGB with the reconstructed face, one B/W to be used as a mask to guide what sections of the image are to be replaced.
For the reconstrcuted face masked DSSIM loss is used that behaves as a standard SSIM difference measure in the central face area and always returns zero loss in the surrounding background area outside of the face so as as not to train irrelevant features.
MSE is used for the mask.
- Clone this repository
- cd into the folder df and clonehttps://github.com/keras-team/keras-contrib.git
- make sure that the folder keras_contrib is in the root of the df respository
- cd into the folder df and clonehttps://github.com/1adrianb/face-alignment.git
- make sure that the folder face-alignment is in the root of the df respository
- run align_images_masked on your source A and B image folders.
- copy the aligned cropped images into the A or B folder along with the alignments.json files from the source image folders.
- run train.py as usual
- wait
- run merge_faces_larger.py on your image folder.
Directory structure for training data should look like (image names for example purposes only):
df│└───data │ ├───A │ │ alignments.json │ │ trainingimageA1.jpg │ │ trainingimageA2.jpg │ ├───B │ │ alignments.json │ │ trainingimageB1.jpg │ │ trainingimageB2.jpgor as a file listing:
.\df\data\A\alignments.json.\df\data\A\trainingimageA1.jpg.\df\data\A\trainingimageA2.jpg.\df\data\B\alignments.json.\df\data\B\trainingimageB1.jpg.\df\data\B\trainingimageB2.jpgImage gaps scanner can be run with this command to scan both the A and B folders:
imageGapsScanner.py data\A data\Bit will pop open a new window showing two rows, the images in A that have the worst matches in B and the images in B that have the worst matches in A:
In that example the top row has some clear images that are totally different to the data in B, ideally these would be hunted down, you'd try to find some images of cage shouting at various angles, of the examples in the bottom row however only the first seems to be of a concern, you would consider deleting that image or finding a matching trump image for it, for the remaining images in the bottom row, although they are the top 9 "worst" matches they seem to be relatively nomal front-on shots and can be ignored.
About
Larger resolution face masked, weirdly warped, deepfake,
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.


