次で配布されているソフトウエアを使ってみる手順を示す.
URL: https://github.com/yu4u/noise2noise
目次
利用条件等は,利用者で確認すること.
謝辞:このページで紹介するソフトウエアの作者に感謝します.
TensorFlow 1.15 を使う.
「Visual Studio Community 2019 vesion 16.2, マイクロソフト C++ ビルドツールのインストール(Windows 上)」で説明している.
すでに TensorFlow 2 を使っている,あるいは使う予定ということがありえる. 単純には,TensorFlow 2 と TensorFlow 1.15 を共存させて Python で使うということはできないが, 少しの手間で,共存できるようになる. そこで,TensorFlow 2 とTensorFlow 1.15 の共存を前提として, TensorFlow 1.15 のインストールを行う.
【Python 開発環境のインストール】
Python を使うときは,Python開発環境や Python コンソール(Jupyter Qt Console,Spyder,PyCharm,PyScripter など)の利用も便利である
Windows, Ubuntu での Python 開発環境,Python コンソール(Jupyter Qt Console, Jupyter ノートブック (Jupyter Notebook), Jupyter Lab, Nteract, spyder)のインストール: 別ページで,インストール手順を説明している.
Windows でのPython3.6,TensorFlow 1.15 のインストール:別ページで説明している.
すでにPython 3.9 あるいは Python 3.8 をインストールしている,あるいは,インストール予定という場合を想定し, あとのトラブルが起きにくい,そして,簡単に運用できるように 「Python 3.6 をインストールし,その上に,TensorFlow 1.15.5 をインストールする」という手順を案内している.
Ubuntu でのPython,TensorFlow 1.15 のインストール:別ページで案内している.
Ubuntu のシステム Python に影響を与えないように,隔離された Python 3.6 仮想環境の新規作成し,その上にTensorFlow 1.15.5 をインストールするという手順(venv を使用)(Ubuntu 上)を案内している.
Git の URL: https://git-scm.com/
sudo apt -y update sudo apt -y install git
Windows での手順を下に示す.Ubuntu でも同様の手順になる.
cd c:\pytools rmdir /s /q noise2noise
git clone https://github.com/yu4u/noise2noise cd noise2noise
python -m pip install -r requirements.txt
https://github.com/yu4u/noise2noise の記載による
mkdir dataset cd dataset wget --no-check-certificate https://cv.snu.ac.kr/research/VDSR/train_data.zip wget --no-check-certificate https://cv.snu.ac.kr/research/VDSR/test_data.zip x train_data.zip x test_data.zip cd ..
# train model using (noise, noise) pairs (noise2noise) python train.py --image_dir dataset/291 --test_dir dataset/Set14 --image_size 128 --batch_size 8 --lr 0.001 --output_path gaussian python test_model.py --weight_file gaussian` --image_dir dataset/Set14