All Projects → jinfagang → Faceswap_pytorch

jinfagang / Faceswap_pytorch

Deep fake ready to train on any 2 pair dataset with higher resolution

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Faceswap pytorch

T81 558 deep learning
Washington University (in St. Louis) Course T81-558: Applications of Deep Neural Networks
Stars: ✭ 4,152 (+2040.21%)
Mutual labels:  gan, deeplearning
Artificialintelligenceengines
Computer code collated for use with Artificial Intelligence Engines book by JV Stone
Stars: ✭ 35 (-81.96%)
Mutual labels:  gan, deeplearning
Deep Learning Resources
由淺入深的深度學習資源 Collection of deep learning materials for everyone
Stars: ✭ 422 (+117.53%)
Mutual labels:  gan, deeplearning
HistoGAN
Reference code for the paper HistoGAN: Controlling Colors of GAN-Generated and Real Images via Color Histograms (CVPR 2021).
Stars: ✭ 158 (-18.56%)
Mutual labels:  gan, deeplearning
Spectralnormalizationkeras
Spectral Normalization for Keras Dense and Convolution Layers
Stars: ✭ 100 (-48.45%)
Mutual labels:  gan, deeplearning
Deeplearning
深度学习入门教程, 优秀文章, Deep Learning Tutorial
Stars: ✭ 6,783 (+3396.39%)
Mutual labels:  gan, deeplearning
Dcgan Pytorch
PyTorch Implementation of DCGAN trained on the CelebA dataset.
Stars: ✭ 32 (-83.51%)
Mutual labels:  gan, deeplearning
Relativistic Average Gan Keras
The implementation of Relativistic average GAN with Keras
Stars: ✭ 36 (-81.44%)
Mutual labels:  gan, deeplearning
Specgan
SpecGAN - generate audio with adversarial training
Stars: ✭ 92 (-52.58%)
Mutual labels:  gan, deeplearning
Tensorflow 101
learn code with tensorflow
Stars: ✭ 1,116 (+475.26%)
Mutual labels:  gan, deeplearning
Person Reid Gan Pytorch
A Pytorch Implementation of "Unlabeled Samples Generated by GAN Improve the Person Re-identification Baseline in vitro"(ICCV17)
Stars: ✭ 147 (-24.23%)
Mutual labels:  gan, deeplearning
Awesome Gan For Medical Imaging
Awesome GAN for Medical Imaging
Stars: ✭ 1,814 (+835.05%)
Mutual labels:  gan, deeplearning
Cyclegan Vc2
Voice Conversion by CycleGAN (语音克隆/语音转换): CycleGAN-VC2
Stars: ✭ 158 (-18.56%)
Mutual labels:  gan, deeplearning
Deeplearning4j Examples
Deeplearning4j Examples (DL4J, DL4J Spark, DataVec)
Stars: ✭ 2,215 (+1041.75%)
Mutual labels:  deeplearning
Attentive Gan Derainnet
Unofficial tensorflow implemention of "Attentive Generative Adversarial Network for Raindrop Removal from A Single Image (CVPR 2018) " model https://maybeshewill-cv.github.io/attentive-gan-derainnet/
Stars: ✭ 184 (-5.15%)
Mutual labels:  gan
Gans From Theory To Production
Material for the tutorial: "Deep Diving into GANs: from theory to production"
Stars: ✭ 182 (-6.19%)
Mutual labels:  gan
Pose2pose
This is a pix2pix demo that learns from pose and translates this into a human. A webcam-enabled application is also provided that translates your pose to the trained pose. Everybody dance now !
Stars: ✭ 182 (-6.19%)
Mutual labels:  gan
Pytorch Generative Model Collections
Collection of generative models in Pytorch version.
Stars: ✭ 2,296 (+1083.51%)
Mutual labels:  gan
Coral Cnn
Rank Consistent Ordinal Regression for Neural Networks with Application to Age Estimation
Stars: ✭ 186 (-4.12%)
Mutual labels:  deeplearning
Distancegan
Pytorch implementation of "One-Sided Unsupervised Domain Mapping" NIPS 2017
Stars: ✭ 180 (-7.22%)
Mutual labels:  gan

High Resolution Face Swap

A face swap implementation with much more higher resolution result (128x128), this is a promoted and optimized swap face application based on deepfake tech. our implementation did those changes based on original deepfakes implementation:

  • deepfakes only support 64x64 input, we make it deeper and can output 128x128 size;
  • we proposed a new network called SwapNet, SwapNet128;
  • we changed the pre-proccess step with input data (such as warp face), make it more clear;
  • we make the dataset loader more efficient, load pair face data directly from 2 dir;
  • we proposed a new face outline replace tech to get a much more combination result with original image, their differences are like below image.

we will continuely update this repo, and make face swap much more intuitive and simple, anyone can build there own face changing model. Here are some result for 128x128 higher resolution face swap:

We have train on trump-cage and fanbingbing-galgadot convert model. The result is not fully trained yet, but it shows a promising result, the face in most situation can works perfect!

final result on face swap directly from original big image:

As you can see above, we can achieve high resolution and seamlessly combination with face transformation. final result on face swap directly from video (to be added soon):

Dependencies

our face swap implementation need alfred-py which can installed with:

sudo pip3 install alfred-py

Pretrained Model

We only provided pretrained model for 128x128 model, and it was hosted by StrangeAI (http://codes.strangeai.pro). For train from scratch, you can download the trump cage dataset from: https://anonfile.com/p7w3m0d5be/face-swap.zip . For those already StrangeAI VIP membership users, you can download the whole codes and models from http://strangeai.pro .

Train & Predict

the run, simply using:

python3 predict.py
# train fanbingbing-galgadot face swap
python3 train_trump_cage_64x64.py
python3 train_fbb_gal_128x128.py

this will predict on a trump face and convert it into cage face.

More Info

if you wanna be invited to our computer vision discussion wechat group, you can add me via wechat or found us at: http://strangeai.pro which is the biggest AI codes sharing platform in China.

Note About FaceSwap

We have did some failure attempt and experiments lots of combination to produce a good result, here are some notes you need to know to build a face swap tech:

  • Size is everything: we have try maximum 256x256 as input size, but it fails to swap face style between 2 faces;
  • Warp preprocess does not really matter, we have also trying to remove warp preprocess step and directly using target images for train, it can also success train a face swap model, but for dataset augumentation, better to warp it and make some random transform;
  • loss is not really matter. Just kick of train, and train about 15000 epochs, and you can get good result;
  • For data preparing, better extract faces first using dlib or alfred

Faceswap Datasets

Actually, we gathered a lot of faces datasets. beside the default one, you may also access them via Baidu cloud disk.

Copyright

FaceSwap is a project opensourced under MIT license, all right reserved by StrangeAI authors. website: http://strangeai.pro

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].