Coder Social home page Coder Social logo

jensrahnfeld / deep-feature-consistent-vae Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 3.0 2.67 MB

Pytorch Implementation of Hou, Shen, Sun, Qiu, "Deep Feature Consistent Variational Autoencoder", 2016

Home Page: https://arxiv.org/abs/1610.00291

License: MIT License

Python 100.00%
variational-autoencoder perceptual-losses vae vae-pytorch deep-learning

deep-feature-consistent-vae's Introduction

Deep-Feature-Consistent-VAE

Pytorch Implementation of Hou, Shen, Sun, Qiu, "Deep Feature Consistent Variational Autoencoder", 2016

Requirements

  • Python 3.6.9
  • matplotlib 3.2.1
  • numpy 1.19.0
  • pillow 7.2.0
  • pytorch 1.5.1
  • tensorboard 2.2.2
  • torchvision 0.6.1

1) Installing Dependencies

pip3 install --upgrade pip
pip3 install -r requirements.txt

2) Train Vae

Either execute the (modified) example script, i.e.

cd examples
bash train_vae.sh

or

python3 train_vae.py --imgdir <path> --loss 0 -o pvae
python3 train_vae.py --imgdir <path> --loss 1 -o vae123
python3 train_vae.py --imgdir <path> --loss 2 -o vae345

3) Visualize Vae Reconstructions

Either execute the (modified) example script, i.e.

cd examples
bash visualize_vae.sh

or

python3 ../visualize_vae.py --vae pvae.pt vae123.pt vae345.pt --imgdir <path>

reconstruction From top to bottom: original image, pvae, vae123, vae345

4) Visualize Linear Interpolation of Latent Space

Either execute the (modified) example script, i.e.

cd examples
bash visualize_latent_interpolation.sh

or

python3 ../visualize_latent_interpolation.py --vae vae123.pt --img_left <path1> --img_right <path2>

linear interpolation original α=0 ---------------------------------------------------------------------------------------------------> α=1 original

5) Visualize Facial Attribute Manipulation

Either execute the (modified) example script, i.e.

cd examples
bash visualize_facial_attribute_manipulation.sh

or

python3 ../visualize_facial_attribute_manipulation.py --vae vae123.pt --list_attr <path1> --attr <attr> --imgdir <path2> --img <path3>

Example adding eyeglasses: facial attribute manipulation original α=0 ---------------------------------------------------------------------------------------------------> α=1

deep-feature-consistent-vae's People

Contributors

jensrahnfeld avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.