Skip to content

A TensorLayer implementation of BiGAN (Adversarial Feature Learning).

License

Notifications You must be signed in to change notification settings

YOUSIKI/TensorLayer-BiGAN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TensorLayer-BiGAN

A TensorLayer implementation of Adversarial Feature Learning, which is also known as BiGAN.

model-structure

Prerequisites

  • Python 3.7
  • TensorFlow 2.0.0
  • TensorLayer 2.1.1

We highly recommend you to install the packages above using Anaconda (or Miniconda).

Install TensorFlow with GPU support

conda create -n bigan python=3.7 tensorflow-gpu

Install TensorFlow with only CPU support

conda create -n bigan python=3.7 tensorflow

Install TensorLayer

conda activate bigan && pip install tensorlayer

Usage

Evaluation

First, download the pre-trained weights from here.

Second, use the follow script to generate an images.

python eval.py

This will ganerate 8x8 fake human faces and save the image to samples.png. For further evaluation usage, please read the code in eval.py and modify it as you like.

Training

Clone this repository to your computer.

git clone https://github.com/YOUSIKI/BiGAN.TensorLayer.git

To train a BiGAN network from nothing, please download CelebA Dataset from eigher Google Drive or Baidu Netdisk.

Here, I recommend you to download only Img/img_align_celeba.zip to save some time. Moreover, you may look for this dataset on other unofficial sites such as BYR.

After downloading the zip file, extract it to a fold such as data under the project directory. You can also extract it to other directories you like, but remember to modify DATA_PATH in data.py if you do so.

Next, use the follow script to train.

python train.py

The training configurations can be found and modified in config.py.

If you want to train the network on your own dataset, please view every .py file and change them as your will.

Result on CelebA

result

For more sample images saved during training, check samples folder.

More

This project is mostly based on dcgan implementation of tensorlayer, you may find this repository useful while reviewing the code. Many thanks to its contributors (zsdonghao et al.)

We are just beginners of neural networks (and TensorLayer). There may be many mistakes in this project. Please contact us if you found. All issues and pull requests are welcomed.

About

A TensorLayer implementation of BiGAN (Adversarial Feature Learning).

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages