# faceswap **Repository Path**: minskyli/faceswap ## Basic Information - **Project Name**: faceswap - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2018-10-24 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README --- # deepfakes_faceswap Faceswap is a tool that utilizes deep learning to recognize and swap faces in pictures and videos. ## introduction we do four experiments in this project, you can find experiments-record word file, train data, target data(videos:frame), experiment videos in the Enterprise cloud disk of our team. you can download the train data in exp_1/exp_2 in https://anonfile.com/p7w3m0d5be/face-swap.zip. ## overview The project has multiple entry points. You will have to: extract, train, convert. ### extract at first, you can use `ffmpeg -i ../trump.mp4 -vf fps=30 -qscale:v 2 "trump1%04d.jpg` to convert your video in image. and then, you can `python faceswap.py extract -h`to see what args you can use and change, now you can extract the faces in train data `python faceswap.py extract`,and don't forget to change which GPU you want to use, you can change that in `faceswap.py`. ### train now, you can train your data `nohup python faceswap.py train -A ./ae/ac/fallon -B ./ae/ac/trump -m ./models/ae/ac -s 100 -t Original -bs 64 -it 400000 -g 1 -pl > logs.txt 2>&1 &` ### convert finally, you can convert the face A to face B `nohup python faceswap.py convert -i ./target_data/cage_target/ -o ./transfer_data/cage/ -m ./models/exp_4/models/ae/ab/ -c Masked -t Original -b=9 -D mtcnn -M facehullandrect -g=1 > logs_gan_ab.txt 2>&1 &` and ues `ffmpeg -f image2 -i cage%04d.jpg -vcodec libx264 -crf 15 -pix_fmt yuv420p ./cage_ae_ac_b9.mp4`to convert images to a video. ## tip you can see what we did before in our Enterprise cloud disk, the file name is **video faceswap experiments** this project has a relevant paper named **Fast Face-swap Using Convolutional Neural Networks**