Difference between revisions of "DCGAN"

From Interaction Station Wiki
Jump to navigation Jump to search
Line 22: Line 22:
 
[[File:Dcgan_1.png|600px]]
 
[[File:Dcgan_1.png|600px]]
  
3: Navigate to the folder where the DCGAN script is stored (/home/interactionstation/dcgan.epoch) by typing
+
3: Navigate to the folder where the DCGAN script is stored (/home/interactionstation/dcgan.epoch)
 +
 
 +
$ cd dcgan.epoch
 +
 
 +
[[File:Dcgan_2.png|600px]]
 +
 
 +
4: '''If you have your own dataset ready, you can skip part 4 till part ...'''
 +
 
 +
This script also includes a dataset downloader. This allows you to download from Wikiart based on their genres. The usage is quite simple, but requires a bit of attention. In the script 'genre-scraper.py' there is a variable called 'genre_to_scrape' - simply change that to any of the genres listen on the Wikiart [https://www.wikiart.org/en/paintings-by-genre/] website.  After changing the variable to the desired genre, run the script with python3. This will create a folder named after the genre inside '/home/interactionstation/dcgan.epoch/', containing all the download images. Note: the script takes a while to finish!
 +
 
 +
[[File:Dcgan_3.png|600px]]
 +
 
 +
$ sudo nano genre-scraper.py
 +
 
 +
[[File:Dcgan_4.png|600px]]
 +
 
 +
use the arrow keys to move the variable 'genre_to_scrape' and change it to the desired genre from Wikiart. Example:
 +
 
 +
genre_to_scrape = "nude-painting-nu"
 +
 
 +
[[File:Dcgan_5.png|600px]]
 +
 
 +
[[File:Dcgan_6.png|600px]]
 +
 
 +
save the changes you've made by pressing the following keys in the same order
 +
ctrl+X
 +
Y
 +
enter
 +
 
 +
[[File:Dcgan_7.png|600px]]
 +
 
 +
Run the script! Note: this is going to take a while, grab a coffee.
 +
python3 genre-scraper.py

Revision as of 13:54, 16 January 2018

Generating images using A "Deep Convolutional Generative Adversarial Network"

In this tutorial we will be using a modified version of Soumith Chintala's torch implementation (https://github.com/soumith/dcgan.torch) of DCGAN - Deep Convolutional Generative Adversarial Network (https://arxiv.org/pdf/1511.06434.pdf) with a focus on generating images.

Getting started

Because training a DCGAN requires a lot of computing power, head over to the interaction station and sit behind the computer with the 'ml machineq' sticker. This computer runs a Ubuntu installation with (almost) every dependencies required to run some machine learning scripts/programs.

DCGAN

1: Log in to the computer by using the 'interactionstation' account.

username: interactionstation
password: interactionstation

2: Start a new 'terminal' window by pressing the windows key (⊞) and typing 'term', followed by pressing 'enter'

⊞
term
enter

Dcgan 1.png

3: Navigate to the folder where the DCGAN script is stored (/home/interactionstation/dcgan.epoch)

$ cd dcgan.epoch

Dcgan 2.png

4: If you have your own dataset ready, you can skip part 4 till part ...

This script also includes a dataset downloader. This allows you to download from Wikiart based on their genres. The usage is quite simple, but requires a bit of attention. In the script 'genre-scraper.py' there is a variable called 'genre_to_scrape' - simply change that to any of the genres listen on the Wikiart [1] website. After changing the variable to the desired genre, run the script with python3. This will create a folder named after the genre inside '/home/interactionstation/dcgan.epoch/', containing all the download images. Note: the script takes a while to finish!

Dcgan 3.png

$ sudo nano genre-scraper.py

Dcgan 4.png

use the arrow keys to move the variable 'genre_to_scrape' and change it to the desired genre from Wikiart. Example:

genre_to_scrape = "nude-painting-nu"

Dcgan 5.png

Dcgan 6.png

save the changes you've made by pressing the following keys in the same order

ctrl+X
Y
enter

Dcgan 7.png

Run the script! Note: this is going to take a while, grab a coffee.

python3 genre-scraper.py