Recent Posts
«   2025/05   »
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Today
Total
관리 메뉴

코드민수

[ISR] Image Super-Resolution 환경 설정 본문

[Python]/환경설정

[ISR] Image Super-Resolution 환경 설정

코드민수 2023. 4. 30. 17:39
BIG

https://github.com/idealo/image-super-resolution

 

GitHub - idealo/image-super-resolution: 🔎 Super-scale your images and run experiments with Residual Dense and Adversarial Net

🔎 Super-scale your images and run experiments with Residual Dense and Adversarial Networks. - GitHub - idealo/image-super-resolution: 🔎 Super-scale your images and run experiments with Residual Den...

github.com

이미지의 해상도를 높여주는(초해상화) 딥러닝 알고리즘을 쉽게 사용할 수 있는 레퍼지토리입니다.

 

RDN과 RRDN 모델을 제공하고 있고, x2와 x4 pre-trained 모델이 있습니다.

 

깃에 나와있는대로 설치하면 tensorflow==2.0, h5py==2.10.0이 설치되는데,

 

CUDA 11.2, cuDNN 8.2 기준으로 GPU 사용이 되지 않아서 방법을 찾아 공유합니다.

 

※ 가상환경을 만들어서 세팅하는 것을 권장합니다.

 


1. ISR 설치

git clone https://github.com/idealo/image-super-resolution
cd image-super-resolution
python setup.py install

지정한 경로에 clone 후 setup.py 실행

 

2. tensorflow, h5py 버전 변경

pip install tensorflow==2.6.2
pip install tensorflow-gpu==2.6.2
pip install h5py==3.1.0

23년 4월 30일 기준 pip 설치 default 버전

 

3. 실행

import numpy as np
from PIL import Image

img = Image.open('data/input/test_images/sample_image.jpg')
lr_img = np.array(img)
from ISR.models import RDN

rdn = RDN(weights='psnr-small')
sr_img = rdn.predict(lr_img)
Image.fromarray(sr_img)

자세한 알고리즘 및 Train & Prediction 방법은 다음 기회에..

LIST