All Projects → robbiebarrat → Art Dcgan

robbiebarrat / Art Dcgan

Licence: other
Modified implementation of DCGAN focused on generative art. Includes pre-trained models for landscapes, nude-portraits, and others.

Programming Languages

lua
6591 projects
python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to Art Dcgan

text2painting
Convert text into beautiful artistic images
Stars: ✭ 55 (-97.08%)
Mutual labels:  art, gan, painting
Snek
See https://github.com/inconvergent/weir instead
Stars: ✭ 696 (-63.02%)
Mutual labels:  generative-art, art
Party Mode
An experimental music visualizer using d3.js and the web audio api.
Stars: ✭ 690 (-63.34%)
Mutual labels:  generative-art, art
Galeri Www
A perpetual artwork streaming app. (Website Repo)
Stars: ✭ 46 (-97.56%)
Mutual labels:  painting, art
Pts
A library for visualization and creative-coding
Stars: ✭ 4,628 (+145.91%)
Mutual labels:  generative-art, art
Weir
A system for making generative systems
Stars: ✭ 451 (-76.04%)
Mutual labels:  generative-art, art
Sofloo Spot
Click Randomize
Stars: ✭ 37 (-98.03%)
Mutual labels:  generative-art, art
frameV
Framed Visuals: collaborative generative art.
Stars: ✭ 20 (-98.94%)
Mutual labels:  art, generative-art
Mopaint
🎨💪 Modern, modular paint and more! (pre-alpha, not much done yet)
Stars: ✭ 50 (-97.34%)
Mutual labels:  painting, art
Cyclegan Qp
Official PyTorch implementation of "Artist Style Transfer Via Quadratic Potential"
Stars: ✭ 59 (-96.87%)
Mutual labels:  gan, generative-art
Geopattern
📐 Create beautiful generative image patterns from a string in golang.
Stars: ✭ 1,113 (-40.86%)
Mutual labels:  generative-art, art
Flutter D Art
Generative d.Art with Flutter
Stars: ✭ 356 (-81.08%)
Mutual labels:  generative-art, art
Context Free
Context Free is a program that generates images from written instructions called a grammar. The program follows the instructions in a few seconds to create images that can contain millions of shapes.
Stars: ✭ 326 (-82.68%)
Mutual labels:  generative-art, art
Cartoongan Tensorflow
Generate your own cartoon-style images with CartoonGAN (CVPR 2018), powered by TensorFlow 2.0 Alpha.
Stars: ✭ 587 (-68.81%)
Mutual labels:  gan, generative-art
glitch-image
🖼 Generate and save unique glitchy images
Stars: ✭ 46 (-97.56%)
Mutual labels:  art, generative-art
Awesome Creative Coding
Creative Coding: Generative Art, Data visualization, Interaction Design, Resources.
Stars: ✭ 8,696 (+362.06%)
Mutual labels:  generative-art, art
samila
Generative Art Generator
Stars: ✭ 750 (-60.15%)
Mutual labels:  art, generative-art
Pxlsrt
Pixel sorter written in Ruby
Stars: ✭ 119 (-93.68%)
Mutual labels:  generative-art, art
001
draw_code.001 — ThreeJS, WebGL & GLSL
Stars: ✭ 48 (-97.45%)
Mutual labels:  generative-art, art
Generative.fm
A platform for playing generative music in the browser.
Stars: ✭ 1,534 (-18.49%)
Mutual labels:  generative-art, art

contact: robbiebarrat (at) gmail (dot) com

art-DCGAN

Modified version of Soumith Chintala's torch implementation of DCGAN with a focus on generating artworks.

Examples / Pre-trained networks

Due to the nature of github, and the 100+ MB nature of the pre-trained networks, you'll have to click a link to get the pre-trained models, but it's worth it. Below are some of them and examples of what they can generate. When using any outputs of the models, credit me. Don't sell the outputs of the pre-trained models, modified or not. If you have any questions email me before doing anything.

Abstract Landscape GAN

Batch of Abstract Landscapes

Download the weights!

There is no download for abstract landscapes, yet. Scroll to the bottom to find out how to train your own from the regular landscapes network (involves switching the dataset towards the end of training).

Landscape GAN

Batch of Landscapes

Download the weights!

Generator (CPU)
Discriminator (CPU)

Nude-Portrait GAN

Batch of Nude-Portraits

Download the weights!

Generator (CPU)
Discriminator (CPU)

Portrait GAN

Batch of Portraits

Download the weights

Generator (CPU)
Discriminator (CPU)

The most notable changes are:

  • Doubled image size - now 128x128 instead of 64x64 (added a layer in both networks)

  • Ability to resume training from checkpoints (simply pass -netG=[path_to_network], and -netD=[path_to_network]). While this is convenient, it also allows for experimentation with training on one set of images, and then later in training shifting to another set of images. This allows you to train a landscape network, and then shift to abstract for a very short duration to get abstract landscapes (see example below in the "resume from checkpoint" section) - acting like a sort of style transfer for GANs.

  • Included a simple shell script that will keep the checkpoints folder reasonably empty - it is meant for leaving running when training a GAN. Default behavior is to keep the most recent 5 checkpoints of both the discriminator and generator for each different experiment name.

  • Added a python 3 script (utils/genre-scraper.py) that allows easy image-scraping from wikiart into the format the GAN can draw from.

  • Added a script (utils/gpu2cpu.lua) that converts checkpoints trained on a gpu to models that can be used by a cpu.

  • The inclusion of multiple pre-trained GAN's (.t7 files) that can generate various types of images, including 128x128 landscape oil paintings, 128x128 nude oil paintings, and others highlighted below.

Usage:

Prerequisites:

See INSTALL.md

General Usage:

The usage is identical to Soumith's - with the exception of loading from a checkpoint, and the fact that an artwork scraper is included with this project.

Scraping Images from Wikiart

genre-scraper.py will allow you to scrape artworks from wikiart based on their genres. The usage is quite simple. In genre-scraper.py there is a variable called genre_to_scrape - simply change that to any of the genre's listed on this page, or to any of the values in the huge list of comments right after genre_to_scrape is defined.

Run the program with python3 and a folder with the name of your genre will be created, with a subdirectory "images/" containing all of the jpgs. Point your GAN to the directory with the name of your genre (so if I did landscapes, i'd just change genre_to_scrape to "landscape", and then run my GAN with DATA_ROOT=landscape)

Train a GAN on a folder of images

Start Training

DATA_ROOT=myimages dataset=folder ndf=50 ngf=150 th main.lua

You can adjust ndf (number of filters in discriminator's first layer) and ngf (number of filters in generator's first layer) freely, although it's reccomended that the generator has ~2x the filters as the discriminator to prevent the discriminator from beating the generator out, since the generator has a much much harder job.

Keep in mind, you can also pass these arguments when training:

batchSize=64              -- Batchsize - didn't get very good results with this over 128...
noise=normal, uniform     -- pass ONE Of these. It seems like normal works a lot better, though.
nz=100                    -- number of dimensions for Z
nThreads=1                -- number of data loading threads
gpu=1                     -- gpu to use
name=experiment1          -- just to make sure you don't overwrite anything cool, change the checkpoint filenames with this

Resume from checkpoint

DATA_ROOT=myimages dataset=folder netD=checkpoints/your_discriminator_net.t7 netG=your_driscriminator_net.t7 th main.lua Passing ndf and ngf will have no effect here - as the networks are loaded from the checkpoints. Resuming from the checkpoint and training on different data can have very interesting effects. Below, a GAN trained on generating landscapes is trained on abstract art for half of an epoch.

difference

Generate images with a pre-trained net

net=your_generator_net.t7 th generate.lua Very straightforward... I hope. Keep in mind; you can also pass these when generating images:

batchSize=36                      -- How many images to generate - keep a multiple of six for unpadded output.
imsize=1                          -- How large the image(s) should be (not in pixels!)
noisemode=normal, line, linefull  -- pass ONE of these. If you pass line, pass batchSize > 1 and imsize = 1, too.
name=generation1                  -- just to make sure you don't overwrite anything cool, change the filename with this

####There are more passable arguments on the unmodified network's page - I think I included the more important ones here though####

Coming soon

  • Pre-trained networks: flower paintings, cityscapes (comment in the open issue if you have suggestions!)
  • creating animated gifs of walks throughout latent space
  • a GUI for this whole thing... maybe...
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].