DCGAN is an abbreviation for Deep Convolutional Generative Adversarial Networks, which is an algorithm that generates images using a convolutional neural network. In addition to the original paper, there are many articles that explain in Japanese.
-First GAN -Understanding GAN and DCGAN as carefully as possible --Nap 2:40
You can use this to generate an idol's face image, generate an illustration, and so on. If you google, you will find many interesting cases.
I had the image of such ** "somewhat amazing" ** DCGAN, ** "it seems difficult to use" **, but the implementation using TensorFlow has been released.
In fact, if you just want to try the demo, you can easily execute it by ** just executing the command according to the procedure **.
Below is a memo of the procedure I tried at hand. (Updated in May 2017)
git clone it and run the download script.
$ python download.py celebA
I got the following error in my environment.
Traceback (most recent call last):
File "download.py", line 20, in <module>
from tqdm import tqdm
ImportError: No module named 'tqdm'
It seems that there is no module called tqdm, so install it.
$ pip install tqdm
Run download.py
again to start downloading and unzipping the data.
By the way, celebA
in the argument of the above command example specifies the data for the celebrity face generation demo, and if you want to try the demo that generates handwritten numbers
$ python download.py mnist
will do.
Just run main.py with TensorFlow active.
(tensorflow)$ python main.py --dataset celebA --input_height=108 --train --crop
For MNIST
(tensorflow)$ python main.py --dataset mnist --input_height=28 --output_height=28 --train
It takes a long time, but it outputs ** generated sample images ** in the middle of the process to the samples
folder, so you can see how the model is trained without waiting for the training to complete. ..
(CELEB, Epoch0, 100 sheets learning)
(CELEB, Epoch0, 500 sheets learning)
(CELEB, Epoch0, 1100 sheets learning)
(CELEB, Epoch1)
(MNIST, Epoch0)
(MNIST, Epoch1)
・
・
・
(MNIST, Epoch6)
(MNIST, Epoch8)
You can see that the accuracy of image generation improves as the learning progresses.
After training is complete, you can use the model to perform image generation as follows:
$ python main.py --dataset mnist --input_height=28 --output_height=28
$ python main.py --dataset celebA --input_height=108 --crop
When this happens, you will want to try it with your own data. Continue to another article (planned)
→ I tried & wrote: Automatically generate "dot picture" of game application by deep learning
Recommended Posts