[PYTHON] [Edge2Imori] Epi.2 pix What if you add Gradient Penalty to pix? ??

Struggle to make Edge2Imori that converts a line into a newt image after inputting

Previous article I tried to make edge2imori by applying pix2pix

Created using pix2pix.

This time, I applied Gradient-Penalty of WGAN-GP.

First of all, collecting images

Images of newts were collected using iCrawler.

The story that iCrawler was the strongest in image crawling

This has collected 630 images of newts.

Add Gradient Penalty to pix2pix

I did the manmakoto of the title.

Gradient Penalty was proposed in WGAN-GP and is a term that plays a role of regularization to bring the gradient closer to 1.

Code created this time >> https://github.com/yoyoyo-yo/DeepLearningMugenKnock/blob/master/Question_imageGenerate/answers/pix2pixGP_pytorch.py

result

The result looks like this

The input was an image in which edges were extracted from the correct image by the canny method.

There are quite a few images of newts. It seemed that the part where the line was thin was a newt, and when the line was dense, it was a grass.

Left: Input, Center: pix2 pix-GP result, Right: Correct answer

Recommended Posts

[Edge2Imori] Epi.2 pix What if you add Gradient Penalty to pix? ??
Workaround if you cannot add to LD_LIBRARY_PATH
What to do if you can't pipenv shell
What to do if you can't pip install mysqlclient
No module named What to do if you get'libs.resources'
ModuleNotFoundError: No module What to do if you get'tensorflow.contrib'
[* CentOS 6.10] What to do if you cannot add the IUS Community Project repository on CentOS 6.5 (VirtualBox)
What to do if you are addicted to Windows character code
What to do if you get "coverage unknown" in Coveralls
What to do if you can't sort files with subscripts
What to do if you can't log in as root
What to do if you can't use WiFi on Linux
What to do if you lose your EC2 key pair
What to do if you can't install pyaudio with pip #Python
What to do if you get a minus zero in Python
What to do if you get a UnicodeDecodeError with pip install
What to do if you can't build your project with Maven
What to do if you can't use the trash in Lubuntu 18.04.
What to do if yum breaks
What to do if you can't find well with grep's -f option
What to do if you can't find PDO in Laravel or CakePHP
What to do if you couldn't send an email to Yahoo with Python.
What to do if you can't use scikit grid search in Python
What to do if you forget your login password on Manjaro Linux
What to do if you get lost in file reference with FileNotFoundError
What to do if you get angry in TensorFlow v2 without attribute'app'
What to do if you get stuck during Anaconda installation on Linux
What to do if you get a TypeError with numpy min, max
What to do if you get an error when trying to load mnist
What to do if you can't install with pip in babun environment
What to do if you get Could not fetch URL 443 with pip
What to do if you get an error when installing Dlib (Ubuntu)
"Lie ... What have you been up to?"
What I always add to my ~ / .bashrc
Let's summarize what you want to do.
What to do if you get a "No versions found" error in pipenv
What to do if you get angry with swapon failed: Operation not permitted
What to do if you get an error when installing python with pyenv
What to do if you get "Python not configured." Using PyDev in Eclipse