hq-liu / pytorch-glow

PyTorch implementation of "Glow: Generative Flow with Invertible 1x1 Convolutions"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pytorch-glow

PyTorch implementation of "Glow: Generative Flow with Invertible 1x1 Convolutions"

Usage

First you need to install all requirements by

pip3 install -r requirements.txt

Training

  1. Prepare dataset and corresponding profile file (like profile/celeba.json)
  2. Start training:
python3 train.py [profile] 

Inference

Usage: python3 infer.py [OPTIONS] COMMAND [ARGS]...

Options:
  --profile PATH
  --snapshot PATH
  --help           Show this message and exit.

Commands:
  compute_deltaz
  interpolate
  reconstruct
  sample

Result

Reconstruction

The upper is reconstructed image, the lower is original one. reconstructed result

Interpolation

From left to right, the attribute offset is from -1.0 to 1.0 by step 0.25.

  • Attractive

interpolation_attractive

  • Black hair

interpolation_black_hair

  • Blurry

interpolation_blurry

  • Mouth slightly open

interpolation_mouth_slightly_open

Acknowledgement

This project refers to:

About

PyTorch implementation of "Glow: Generative Flow with Invertible 1x1 Convolutions"

License:MIT License


Languages

Language:Python 100.0%