SwinIRは,超解像,ノイズ除去の一手法
【目次】
【文献】 Liang, Jingyun and Cao, Jiezhang and Sun, Guolei and Zhang, Kai and Van Gool, Luc and Timofte, Radu, SwinIR: Image Restoration Using Swin Transformer, arXiv preprint arXiv:2108.10257, 2021.
【関連する外部ページ】
GitHub のページ: https://github.com/JingyunLiang/SwinIR
Windows での Git のインストール: 別ページ »で説明
【関連する外部ページ】
Git の公式ページ: https://git-scm.com/
Windows での Python 3.10,関連パッケージ,Python 開発環境のインストール: 別ページ »で説明
【サイト内の関連ページ】
Python のまとめ: 別ページ »にまとめ
【関連する外部ページ】
Python の公式ページ: https://www.python.org/
Windows での Build Tools for Visual Studio 2022,NVIDIA ドライバ,NVIDIA CUDA ツールキット 11.8,NVIDIA cuDNN v8.6 のインストールと動作確認: 別ページ »で説明
【関連する外部ページ】
コマンドプロンプトを管理者として実行: 別ページ »で説明
PyTorch のページ: https://pytorch.org/index.html
次のコマンドは, PyTorch 2.0 (NVIDIA CUDA 11.8 用) をインストールする. 事前に NVIDIA CUDA のバージョンを確認しておくこと(ここでは,NVIDIA CUDA ツールキット 11.8 が前もってインストール済みであるとする).
python -m pip install -U pip python -m pip install -U torch torchvision torchaudio numpy numba --index-url https://download.pytorch.org/whl/cu118 python -c "import torch; print(torch.__version__, torch.cuda.is_available())"
コマンドプロンプトを管理者として実行: 別ページ »で説明
python -m pip install -U timm
コマンドプロンプトを管理者として実行: 別ページ »で説明
cd %HOMEPATH% rmdir /s /q SwinIR git clone --recursive https://github.com/JingyunLiang/SwinIR
https://github.com/JingyunLiang/SwinIR/releases
cd %HOMEPATH% cd swinir cd model_zoo mkdir swinir cd swinir curl -L -O https://github.com/JingyunLiang/SwinIR/releases/download/v0.0/003_realSR_BSRGAN_DFOWMFC_s64w8_SwinIR-L_x4_GAN.pth curl -L -O https://github.com/JingyunLiang/SwinIR/releases/download/v0.0/003_realSR_BSRGAN_DFOWMFC_s64w8_SwinIR-L_x4_PSNR.pth curl -L -O https://github.com/JingyunLiang/SwinIR/releases/download/v0.0/005_colorDN_DFWB_s128w8_SwinIR-M_noise15.pth curl -L -O https://github.com/JingyunLiang/SwinIR/releases/download/v0.0/005_colorDN_DFWB_s128w8_SwinIR-M_noise25.pth curl -L -O https://github.com/JingyunLiang/SwinIR/releases/download/v0.0/005_colorDN_DFWB_s128w8_SwinIR-M_noise50.pth
4倍に拡大.003_realSR_BSRGAN_DFOWMFC_s64w8_SwinIR-L_x4_GAN.pth, 003_realSR_BSRGAN_DFOWMFC_s64w8_SwinIR-L_x4_PSNR.pth を使用.
https://github.com/JingyunLiang/SwinIRに記載の手順で行っている.
testsets/RealSRSet+5imagesのディレクトリにある画像ファイルが処理される. 結果は results の下にできる
cd %HOMEPATH% cd swinir python main_test_swinir.py --task real_sr --scale 4 --large_model --model_path model_zoo/swinir/003_realSR_BSRGAN_DFOWMFC_s64w8_SwinIR-L_x4_GAN.pth --folder_lq testsets/RealSRSet+5images python main_test_swinir.py --task real_sr --scale 4 --large_model --model_path model_zoo/swinir/003_realSR_BSRGAN_DFOWMFC_s64w8_SwinIR-L_x4_PSNR.pth --folder_lq testsets/RealSRSet+5images
https://github.com/JingyunLiang/SwinIRに記載の手順で行っている.
「--noise 15」,「--noise 25」,「--noise 50」の 3通りで実行される.
testsets/McMaster のディレクトリにある画像ファイルが処理される. 結果は results の下にできる
python main_test_swinir.py --task color_dn --noise 15 --model_path model_zoo/swinir/a005_colorDN_DFWB_s128w8_SwinIR-M_noise15.pth --folder_gt testsets/McMaster python main_test_swinir.py --task color_dn --noise 25 --model_path model_zoo/swinir/005_colorDN_DFWB_s128w8_SwinIR-M_noise25.pth --folder_gt testsets/McMaster python main_test_swinir.py --task color_dn --noise 50 --model_path model_zoo/swinir/005_colorDN_DFWB_s128w8_SwinIR-M_noise50.pth --folder_gt testsets/McMaster