/salvaedor-dali

Generate classical paintings using Variational Autoencoders (VAEs).

Primary LanguagePython

Salvaedor Dali

Reproduce classical paintings using Conditional Variational Autoencoder (CVAE).

alt text

Install and run

Installation

git clone https://github.com/karinazad/salvaedor-dali.git
cd salvaedor-dali
pip install -r requirements.txt

Run

python run_vae.py

The following prompt will appear:

Please type in the name of a painter (e.g.: Salvador Dali, Vincent van Gogh etc.)

Type in the name of a painter. So far, the model supports:

Vincent Van Gogh, Andy Warhol, Claude Monet, Salvador Dali, Paul Gauguin, Pablo Picasso, and Frid Kahlo.

Conditional Variational Autoencoder

Variational Autoencoders (VAEs) learn a regularized distributions of the training data during training. Regularization ensures thtat the latent space has good properties (i.e., most commonly, is a normal distribution). The model is able to reconstruct images (see Reconstruction by VAE) by passing into the encoder and the decoder but generate new data as well. This is done by sampling from the latent space and passing it to the generator.

Conditional VAE is an extension of VAE which enables us to specify the type of samples that should be generated. In this case, it corresponds to the name of the author.

Dataset

The dataset was obtained from Kaggle (https://www.kaggle.com/ikarus777/best-artworks-of-all-time). Images were resized to 64x64. There are over 8500 images with the most common genres being Impressionism (1647), Post-Impressionism (1048), Symbolims (666), and Surrealism (435). And there are over 50 artists, such as Vincent van Gogh, Edgar Degas, Albrecht Durer, Pablo Picasso, and Salvador Dali.

Reconstruction by VAE

Examples of reconstructed paintings.

Frida Kahlo

alt text alt text

Andy Warhol

alt text alt text

Vincent van Gogh

alt text alt text

Salvador Dali

alt text alt text

Conditional Image Generation