様々なGAN(Generative Adversarial Network)を試してみる

GitHub – eriklindernoren/PyTorch-GAN: PyTorch implementations of Generative Adversarial Networks.

https://github.com/eriklindernoren/PyTorch-GAN

git clone https://github.com/eriklindernoren/PyTorch-GAN
cd PyTorch-GAN/
pip install -r requirements.txt

仮想環境を作ってインストールするバッチファイル

@echo off
call %~dp0\scripts\env_for_icons.bat  %*
SET PATH=%PATH%;%WINPYDIRBASE%\PortableGit;%WINPYDIRBASE%\PortableGit\bin
SET PATH=%PATH%;%WINPYDIRBASE%\ffmpeg\bin
If not exist %WINPYDIRBASE%\content mkdir  %WINPYDIRBASE%\content 

set APP_NAME=PyTorch-GAN
set APP_DIR=%WINPYDIRBASE%\content\%APP_NAME%
echo %APP_DIR%
cd %WINPYDIRBASE%\content\

If not exist  %APP_DIR% git clone https://github.com/eriklindernoren/PyTorch-GAN


cd %APP_DIR%
timeout /t 5
if not defined VENV_DIR (set "VENV_DIR=%APP_DIR%\venv")
if EXIST %VENV_DIR% goto :activate_venv

::python.exe -m venv "%VENV_DIR%" 
python.exe -m venv "%VENV_DIR%" --system-site-packages 
if %ERRORLEVEL% == 0 goto :pip
echo Unable to create venv 
goto :skip_venv

:pip
call "%VENV_DIR%\Scripts\activate"
pip install -r requirements.txt

cmd.exe /k

:activate_venv
call "%VENV_DIR%\Scripts\activate"
powershell -ExecutionPolicy  -command "$Obj = Start-Process  -FilePath timeout -argumentlist '/t 23' -PassThru ; Wait-Process -InputObject  $Obj  -Timeout 22 " > nul 2>&1
if %errorlevel% equ 0  "D:\WinPython\Spyder.exe" & cmd.exe /k 
cmd.exe /k

Auxiliary Classifier GAN

cd implementations/acgan/ & python acgan.py

DualGAN

http://efrosgans.eecs.berkeley.edu/pix2pix/datasets/facades.tar.gz

https://www.kaggle.com/datasets/vikramtiwari/pix2pix-dataset

などからダウンロード"D:\WinPython\content\PyTorch-GAN\data\facades"に配置します

cd implementations/dualgan/ &  python dualgan.py --dataset_name facades

Python

Posted by eightban