14
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ポンコツPCでstyle2paintsによるAI自動着色を試す

Posted at

最近は誰でもAIによる自動着色が手軽に試せるらしい

デモページ https://style2paints.github.io/ があるらしいのでアクセスしてみたが死んでいて話にならない。
ソースは https://github.com/lllyasviel/style2paints で公開されているので自分でサーバを立てればいいらしい。

インストール手順

基本的に http://miyako.hatenablog.jp/entry/2018/03/02/021544 に書いてある通りにすればいい。おしまい。
・・・のだが、CPUがCore i7 950のポンコツなので tensorflow==1.5 に落としてやらないと動かなかった。

$ sudo yum update -y
$ sudo reboot
$ sudo firewall-cmd --add-port=8000/tcp --permanent && sudo firewall-cmd --reload
$ sudo yum install -y git unzip
$ sudo yum install -y https://centos7.iuscommunity.org/ius-release.rpm
$ sudo yum install -y python36u python36u-libs python36u-devel python36u-pip python36u-tools
$ sudo yum install -y libSM-devel libXext-devel
$ sudo pip3.6 install --upgrade pip 
$ sudo pip3.6 install tensorflow==1.5 keras bottle gevent h5py paste opencv-python scikit-image
$ git clone https://github.com/lllyasviel/style2paints.git
$ unzip model.zip
$ cd ~/style2paints/server
$ mv ~/model/* .
$ python3.6 server.py cpu
Using TensorFlow backend.
2018-10-26 15:23:44.302276: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2
/usr/lib64/python3.6/site-packages/keras/engine/saving.py:292: UserWarning: No training configuration found in save file: the model was *not* compiled. Compile it manually.
  warnings.warn('No training configuration found in save file: '
Bottle v0.12.13 server starting up (using PasteServer())...
Listening on http://0.0.0.0:8000/
Hit Ctrl-C to quit.

serving on 0.0.0.0:8000 view at http://127.0.0.1:8000

何もヒントを与えない状態だと、どうやら女の子しか真面目に塗ってくれないらしい。
reference や color anchor や accurate point を使ってヒントを与えると、もっと綺麗に塗れるのかも知れない。

image.png
image.png
image.png
image.png
image.png

14
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?