All Projects → sshh12 → Inverse Style Gan

sshh12 / Inverse Style Gan

Licence: mit
Looking up a generative latent vectors from (face) reference images.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Inverse Style Gan

Facegan
TF implementation of our ECCV 2018 paper: Semi-supervised Adversarial Learning to Generate Photorealistic Face Images of New Identities from 3D Morphable Model
Stars: ✭ 176 (+576.92%)
Mutual labels:  gan, face-recognition
Facenet Face Recognition
This is the research product of the thesis manifold Learning of Latent Space Vectors in GAN for Image Synthesis. This has an application to the research, name a facial recognition system. The application was developed by consulting the FaceNet model.
Stars: ✭ 54 (+107.69%)
Mutual labels:  gan, face-recognition
Human Detection And Tracking
Human-detection-and-Tracking
Stars: ✭ 753 (+2796.15%)
Mutual labels:  face-recognition
Csmri Refinement
Code for "Adversarial and Perceptual Refinement Compressed Sensing MRI Reconstruction"
Stars: ✭ 21 (-19.23%)
Mutual labels:  gan
Tensorlayer
Deep Learning and Reinforcement Learning Library for Scientists and Engineers 🔥
Stars: ✭ 6,796 (+26038.46%)
Mutual labels:  gan
Anime Inpainting
An application tool of edge-connect, which can do anime inpainting and drawing. 动漫人物图片自动修复,去马赛克,填补,去瑕疵
Stars: ✭ 761 (+2826.92%)
Mutual labels:  gan
Face Recognition
Face Recognition Using Keras/tensorflow coupled with Node.js Server
Stars: ✭ 16 (-38.46%)
Mutual labels:  face-recognition
Facex Zoo
A PyTorch Toolbox for Face Recognition
Stars: ✭ 744 (+2761.54%)
Mutual labels:  face-recognition
Unsupnts
Unsupervised Neural Text Simplification
Stars: ✭ 23 (-11.54%)
Mutual labels:  gan
Generative Models
Collection of generative models, e.g. GAN, VAE in Pytorch and Tensorflow.
Stars: ✭ 6,701 (+25673.08%)
Mutual labels:  gan
Helloface
An awesome face technology repository.
Stars: ✭ 905 (+3380.77%)
Mutual labels:  face-recognition
Musegan
An AI for Music Generation
Stars: ✭ 794 (+2953.85%)
Mutual labels:  gan
Instagan
InstaGAN: Instance-aware Image Translation (ICLR 2019)
Stars: ✭ 761 (+2826.92%)
Mutual labels:  gan
Xdf Gan
A GAN for the generation of mock astronomical surveys
Stars: ✭ 17 (-34.62%)
Mutual labels:  gan
Deepcamera
Open source face recognition on Raspberry Pi. SharpAI is open source stack for machine learning engineering with private deployment and AutoML for edge computing. DeepCamera is application of SharpAI designed for connecting computer vision model to surveillance camera. Developers can run same code on Raspberry Pi/Android/PC/AWS to boost your AI production development.
Stars: ✭ 757 (+2811.54%)
Mutual labels:  face-recognition
Advanced Deep Learning With Keras
Advanced Deep Learning with Keras, published by Packt
Stars: ✭ 917 (+3426.92%)
Mutual labels:  gan
Gans In Action
Companion repository to GANs in Action: Deep learning with Generative Adversarial Networks
Stars: ✭ 748 (+2776.92%)
Mutual labels:  gan
Pytorch Pretrained Biggan
🦋A PyTorch implementation of BigGAN with pretrained weights and conversion scripts.
Stars: ✭ 779 (+2896.15%)
Mutual labels:  gan
Lightning Bolts
Toolbox of models, callbacks, and datasets for AI/ML researchers.
Stars: ✭ 829 (+3088.46%)
Mutual labels:  gan
Nag
[CVPR 2018] Tensorflow implementation of NAG : Network for Adversary Generation
Stars: ✭ 24 (-7.69%)
Mutual labels:  gan

Inverse Style GAN

Looking up a generative latent vectors from reference images.

example

Usage

$ git clone https://github.com/NVlabs/stylegan.git
$ git clone https://github.com/sshh12/Inverse-Style-GAN.git
$ cd Inverse-Style-GAN
$ echo Install Tensorflow For GPUs
$ pip install -r requirements.txt

Gradient Descent Algo

$ python grad-lookup.py --img_path face.jpg --max_iter 10000 --lr 0.1 --keras_verbose 1

or resume training given best.npy with

$ python grad-lookup.py --img_path face.jpg --max_iter 10000 --input_init_vec best.npy

This will iteratively output best.jpg/best.npy which correspond to the best matching generated image and its latent vector.

How?

The script creates a model (and sort of a pipeline) that takes a latent vector, converts it to a face (StyleGan), and then finds the facial features of that face (FaceNet). Since GANs don't normally work backward, this script leverages the fact that both StyleGAN and VGGFace are differentiable to find the latent vector that would produce a given target face. When trained, the model freezes its StyleGAN and VGGFace weights so the only update on each iteration of gradient descent is the input latent vector. The model's loss is a function of the L2 difference between the target face's embeddings and the generated face's embeddings.

Brute Force Algo

$ python brute-lookup.py --img_path face.jpg --max_iter 100

This will also iteratively output best.jpg/best.npy which correspond to the best matching generated image and its latent vector.

Related Research

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].