macでインフォマティクス

macでインフォマティクス

HTS (NGS) 関連のインフォマティクス情報についてまとめています。

chainer-goghで画風を取り入れる

怒涛の勢いで機械学習ツールが発表されてきている。知識が化石化しないようにするには、手を動かしてやってみるのが一番なので、いくつか有名ツールの実行環境を構築してテストしてみた。

 

画風を変換するアルゴリズム | Preferred Research

 

これを入れて動かしてみる。

sudo apt update

sudo apt install python-pip

sudo pip install chainer #Chainerは国産機械学習フレームワーク

sudo apt install python-pip git

git clone https://github.com/mattya/chainer-gogh.git

cd chainer-gogh

gist.github.com のcaffemodel_url:のリンク先からnin_imagenet.caffemodelファイルをダウンロードし、chainer-goghディレクトリ内に置いておく。これが学習済みデータになる。

実行は

python chainer-gogh.py -i -s -o -g 0

-g -0 GPU ID (negative value indicates CPU) ;負の値だとCPUで計算

-i インプット画像(ベース画像)

-s 取り込む画風の画像

-w 画像サイズ。

 

 

 

 

sudo apt update

git clone https://github.com/torch/distro.git ~/torch --recursive

cd torch/

./install-deps

./install.sh

source ~/.bashrc

cd ./

git clone https://github.com/satoshiiizuka/siggraph2016_colorization.git

cd siggraph2016_colorization/

./download_model.sh