AnimeGAN Yaru (Windows10, Python3.6) that converts live-action into anime style

Introduction

I tried AnimeGAN, which converts live-action film into anime style.

System environment

Introduction

Clone AnimeGAN.

Create an environment for animegan.

$ conda create -n animegan python=3.6
$ conda activate animegan
$ pip install tensorflow-gpu==1.8.0
$ pip install tqdm
$ pip install scipy
$ pip install opencv-python
$ cd AnimeGAN-master

Place dataset on AnimeGAN-master.

Copy the contents of Haoyao-style to checkpoint \ AnimeGAN_Hayao_lsgan_300_300_1_3_10

Install CUDA 9.0. image.png

Copy and paste C: \ Program Files \ NVIDIA GPU Computing Toolkit \ CUDA \ v9.0 \ bin \ cudart64_90.dll into AnimeGAN-master.

If you do the following

$ python test.py --checkpoint_dir checkpoint/AnimeGAN_Hayao_lsgan_300_300_1_3_10 --test_dir dataset/test/real --style_name H

I got an error.

return _bootstrap._gcd_import(name[level:], package, level)
 ImportError: DLL load failed: The specified module cannot be found.

vc_redist.x64.exe by referring to Installing tensorflow on windows10 (for specific errors) -jp / help / 2977003 / the-latest-supported-visual-c-downloads) will be installed.

~~ Put vgg19.npy in vgg19_weight ~~

When I ran it, I got an error again.

tensorflow.python.framework.errors_impl.InternalError: Blas SGEMM launch failed : m=36864, n=128, k=64

Specify GPU1 by referring to What to do if "Blas GEMM launch failed" appears in TensorFlow. I needed to.

image.png

Change os.environ ["CUDA_VISIBLE_DEVICES"] = "0" to "1" on the 9th line of test.py and execute.

======================End of Report==========================
FLOPs: 7937325
 100%|██████████████████████████████████████████████████████████████████████████████████| 22/22 [01:24<00:00,  3.84s/it]
test-time: 84.46189665794373 s
one image test time : 3.839177120815624 s

It took 3.84 seconds per sheet!

before There is an input image in the dataset / test / real folder. image.png

after The output is in results \ H. image.png

Thank you for your hard work.

Recommended Posts

AnimeGAN Yaru (Windows10, Python3.6) that converts live-action into anime style
White-box Cartoonization that converts live-action into anime style (Windows10, Python3.6)
A Python program that converts ical data into text
I made a web application that converts photos into Van Gogh's style