私的AI研究会 > QMUPD2
「QMUPD」GANモデルで、ポートレート写真を線画にする
ローカル環境で「QMUPD」を動かす
cd /anaconda_win/workspace_2 ← Windows の場合 cd ~/workspace_2 ← Linux の場合 git clone https://github.com/cedro3/QMUPD.git
project_QMUPD └─workspace_2 └─QMUPD ← GitHub からクローンしたプロジェクトに上書きする ├─checkpoints │ └─QMUPD_model ├─data ├─examples2 ├─models ├─options └─results・解凍してできる「project_QMUFD/」フォルダ内を次のフォルダの下に上書きコピーする
pip install pretrainedmodels
(py38_learn) python test_seq_style3.py results/QMUPD_model/test_200/indexstyle1-0-0.html processing (0000)-th image... ['examples\\00.jpg'] processing (0005)-th image... ['examples\\05.jpg'] processing (0010)-th image... ['examples\\10.jpg'] results/QMUPD_model/test_200/indexstyle0-1-0.html processing (0000)-th image... ['examples\\00.jpg'] processing (0005)-th image... ['examples\\05.jpg'] processing (0010)-th image... ['examples\\10.jpg'] results/QMUPD_model/test_200/indexstyle0-0-1.html processing (0000)-th image... ['examples\\00.jpg'] processing (0005)-th image... ['examples\\05.jpg'] processing (0010)-th image... ['examples\\10.jpg']
コマンドオプション | 引数 | 初期値 | 意味 |
--source_dir | str | '' (ダイアログによる指定) | 静止画ファイルフォルダ |
--result_path | str | './result' | 出力保存フォルダ |
--load_size | int | 1024 | 画像処理サイズ |
--cpu | bool | False | CPU指定 (指定のない場合は自動選択) |
(py38_learn) python qmupd_demo.py Portrait Line Drawing Generation Ver. 0.01: Starting application... - source_dir : ./examples - result_path : ./results - image_size : 512 - cpu : False <./results/QMUPD_model/test_200/imagesstyle1-0-0.html> processing (0000)-th image... examples/00.jpg processing (0001)-th image... examples/01.jpg processing (0002)-th image... examples/02.jpg processing (0003)-th image... examples/03.jpg processing (0004)-th image... examples/04.jpg processing (0005)-th image... examples/05.jpg processing (0006)-th image... examples/06.jpg processing (0007)-th image... examples/07.jpg processing (0008)-th image... examples/08.jpg processing (0009)-th image... examples/09.jpg processing (0010)-th image... examples/10.jpg processing (0011)-th image... examples/11.jpg <./results/QMUPD_model/test_200/imagesstyle0-1-0.html> processing (0000)-th image... examples/00.jpg processing (0001)-th image... examples/01.jpg processing (0002)-th image... examples/02.jpg processing (0003)-th image... examples/03.jpg processing (0004)-th image... examples/04.jpg processing (0005)-th image... examples/05.jpg processing (0006)-th image... examples/06.jpg processing (0007)-th image... examples/07.jpg processing (0008)-th image... examples/08.jpg processing (0009)-th image... examples/09.jpg processing (0010)-th image... examples/10.jpg processing (0011)-th image... examples/11.jpg <./results/QMUPD_model/test_200/imagesstyle0-0-1.html> processing (0000)-th image... examples/00.jpg processing (0001)-th image... examples/01.jpg processing (0002)-th image... examples/02.jpg processing (0003)-th image... examples/03.jpg processing (0004)-th image... examples/04.jpg processing (0005)-th image... examples/05.jpg processing (0006)-th image... examples/06.jpg processing (0007)-th image... examples/07.jpg processing (0008)-th image... examples/08.jpg processing (0009)-th image... examples/09.jpg processing (0010)-th image... examples/10.jpg processing (0011)-th image... examples/11.jpg Saving... → ./results/examples_00.jpg Saving... → ./results/examples_01.jpg Saving... → ./results/examples_02.jpg Saving... → ./results/examples_03.jpg Saving... → ./results/examples_04.jpg Saving... → ./results/examples_05.jpg Saving... → ./results/examples_06.jpg Saving... → ./results/examples_07.jpg Saving... → ./results/examples_08.jpg Saving... → ./results/examples_09.jpg Saving... → ./results/examples_10.jpg Saving... → ./results/examples_11.jpg processing start >> 2024/08/21 15:39:02 processing end >> 2024/08/21 15:39:33 processing time >> 0:00:31.081003 Finished.
データ | プログラム | GPU | CPU | ||||
RTX 4070Ti | RTX 4060 | GTX 1050 | i9-13900 | i7-14700 | i7-1260P | ||
examples/ | qmupd_demo.py | 29秒 | 30.7秒 | 1分13秒 | 2分23秒 | 2分27秒 | 3分4秒 |
import warnings warnings.simplefilter('ignore')
# print("dataset [%s] was created" % type(self.dataset).__name__)
# print("model [%s] was created" % type(instance).__name__)
# print('loading the model from %s' % load_path) : # print('---------- Networks initialized -------------') : # print('[Network %s] Total number of parameters : %.3f M' % (name, num_params / 1e6)) # print('-----------------------------------------------')
# print(message)
import warnings warnings.simplefilter('ignore')・main関数処理に変更
: # ** main関数 ** def main(opt): : # main関数エントリーポイント(実行開始) if __name__ == '__main__': :