akanimax/T2F

★ 545⑂ 95

T2F: text to face generation using Deep Learning

About akanimax/T2F

akanimax/T2F is an open-source project on GitHub, mainly written in Python. T2F: text to face generation using Deep Learning It currently holds 545 stars and 95 forks with 0 open issues, and was last pushed on an unknown date (repository created unknown).

Project Overview

AI Homed tracks it on the AI Image Projects board and on the AI AI Image Projects list.

GitHub Repository Details

Repository akanimax/T2F · default branch - · size 0 KB · watchers 0 · source: GitHub REST API and repository README

README

! Attention !

This project is unfortunately not being worked upon

Please head over to the following much cooler project that takes the idea of Text-2-Image generation to the next level:

DallE: Original PyTorch

#

#

# :star: [NEW] :star:

T2F - 2.0 Teaser (coming soon ...)

https://github.com/akanimax/T2F/blob/HEAD/2.0 Teaser

Please note that all the faces in the above samples are generated ones. The T2F 2.0 will be using MSG-GAN for the image generation module instead of ProGAN. Please refer link for more info about MSG-GAN. This update to the repository will be comeing soon :+1:.

T2F

Text-to-Face generation using Deep Learning. This project combines two of the recent architectures StackGAN and ProGAN for synthesizing faces from textual descriptions.
The project uses Face2Text dataset which contains 400 facial images and textual captions for each of them. The data can be obtained by contacting either the RIVAL group or the authors of the aforementioned paper.

Some Examples:

https://github.com/akanimax/T2F/blob/HEAD/Examples

Architecture:

https://github.com/akanimax/T2F/blob/HEAD/Architecture Diagram The textual description is encoded into a summary vector using an LSTM network. The summary vector, i.e. Embedding (psy_t) as shown in the diagram is passed through the Conditioning Augmentation block (a single linear layer) to obtain the textual part of the latent vector (uses VAE like reparameterization technique) for the GAN as input. The second part of the latent vector is random gaussian noise. The latent vector so produced is fed to the generator part of the GAN, while the embedding is fed to the final layer of the discriminator for conditional distribution matching. The training of the GAN progresses exactly as mentioned in the ProGAN paper; i.e. layer by layer at increasing spatial resolutions. The new layer is introduced using the fade-in technique to avoid destroying previous learning.

Running the code:

The code is present in the implementation/ subdirectory. The implementation is done using the PyTorch framework. So, for running this code, please install PyTorch version 0.4.0 before continuing.

__Code organization:__
configs: contains the configuration files for training the network. (You can use any one, or create your own)
data_processing: package containing data processing and loading modules
networks: package contains network implementation
processed_annotations: directory stores output of running process_text_annotations.py script
process_text_annotations.py: processes the captions and stores output in processed_annotations/ directory. (no need to run this script; the pickle file is included in the repo.)
train_network.py: script for running the training the network

__Sample configuration:__

# All paths to different required data objects images_dir: "../data/LFW/lfw" processed_text_file: "processed_annotations/processed_text.pkl" log_dir: "training_runs/11/losses/" sample_dir: "training_runs/11/generated_samples/" save_dir: "training_runs/11/saved_models/"

# Hyperparameters for the Model captions_length: 100 img_dims:

# LSTM hyperparameters embedding_size: 128 hidden_size: 256 num_layers: 3 # number of LSTM cells in the encoder network

# Conditioning Augmentation hyperparameters ca_out_size: 178

# Pro GAN hyperparameters depth: 5 latent_size: 256 learning_rate: 0.001 beta_1: 0 beta_2: 0 eps: 0.00000001 drift: 0.001 n_critic: 1

# Training hyperparameters: epochs:

# % of epochs for fading in the new layer fade_in_percentage: batch_sizes: num_workers: 3 feedback_factor: 7 # number of logs generated per epoch checkpoint_factor: 2 # save the models after these many epochs use_matching_aware_discriminator: True # use the matching aware discriminator

Use the requirements.txt to install all the dependencies for the project. $ workon [your virtual environment] $ pip install -r requirements.txt

__Sample run:__

$ mkdir training_runs $ mkdir training_runs/generated_samples training_runs/losses training_runs/saved_models $ train_network.py --config=configs/11.comf

Other links:

blog: https://medium.com/@animeshsk3/t2f-text-to-face-generation-using-deep-learning-b3b6ba5a5a93
training_time_lapse video: https://www.youtube.com/watch?v=NO_l87rPDb8
ProGAN package (Seperate library): https://github.com/akanimax/pro_gan_pytorch

#TODO:

1.) Create a simple demo.py for running inference on the trained models

GitHub Stars & Activity

545Stars
95Forks
0Open issues
PythonLanguage

GitHub Popularity

GitHub stars545
Forks95
Open issues0
Primary languagePython
License-
Stars gained today0
Created-
Last pushed-

Trending History

Trending statusnot on today's boards

Related AI Projects

1

ultralytics / ultralytics

Python★ 61,829⑂ 11,787
2

ultralytics / yolov5

Python★ 58,057⑂ 17,469
3

roboflow / supervision

Python★ 50,960⑂ 4,848
4

lucidrains / vit-pytorch

Python★ 25,514⑂ 3,495
5

junyanz / pytorch-CycleGAN-and-pix2pix

Python★ 25,244⑂ 6,567
6

graphdeco-inria / gaussian-splatting

Python★ 23,930⑂ 3,434
7

pytorch / vision

Python★ 17,921⑂ 7,265
8

cvat-ai / cvat

Python★ 16,758⑂ 3,871

More AI Rankings