2024年4月14日
『BlendGAN』は、顔のブレンドができます。
オリジナル:https://onion-liu.github.io/BlendGAN/
Windows環境でもにあつかい易いように改良してみました。
おいらのGithubに上げてあります。
https://github.com/supplepentan/penta-blendgan
Windows11 pro (Windows Insier Program)
マウスコンピューター製G-Tune E5-144
CPU:インテル(R) Core(TM) i7-10875H プロセッサー
メモリ:32GB メモリ
SSD (M.2):512GB NVMe SSD
グラフィックス:NVIDIA GeForce RTX2060 / 6GB
『PowerShell』や『Visual Studio Code』などでコマンド実行してください。
1 2 |
git clone https://github.com/supplepentan/penta-blendgan.git cd penta-blendgan |
1 2 3 4 5 6 |
wsl pyenv local 3.8.6 python -m venv venv-wsl source venv-wsl/bin/activate python -m venv venv-wsl source venv-wsl/scripts/activate |
1 2 |
python -m pip install -r requirements.txt python -m pip install torch==1.6.0+cu101 torchvision==0.7.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html |
1 |
python setup.py |
『input』フォルダに元となる顔の画像を、『style_imgs』フォルダにブレンドしたい顔の画像を入れてください。
下記のコマンドで実行すると『output』フォルダに出力されます。
複数のファイルを一気に実行できます。
1 |
python run.py |
(左)元の画像、(中)混ぜたい画像、(右)ブレンド画像
実装してしまえば、かなり遊べます。
生成画像も高画質☆
個人的にWSLを使うのは、おっくうなので、
『Visual Studio Container Remote Container』でも作成しようと思います。(‘ω’)ノ