컴퓨터

image-super-resolution

돌하니 2020. 4. 10. 09:37

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)
sr = Image.fromarray(sr_img)
sr.save('test.jpg', 'JPEG')


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

 

idealo/image-super-resolution

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

github.com

 

pip install ISR
https://idealo.github.io/image-super-resolution/tutorials/docker/

tensorflow==2.0.0


https://git-lfs.github.com

Using ISR with Docker

yum install git-lfs

 

 

https://idealo.github.io/image-super-resolution/#installation


FROM tensorflow/tensorflow:1.13.1-gpu-py3

# Install system packages
RUN apt-get update && apt-get install -y --no-install-recommends \
      bzip2 \
      g++ \
      git \
      graphviz \
      libgl1-mesa-glx \
      libhdf5-dev \
      openmpi-bin \
      screen \
      wget && \
    rm -rf /var/lib/apt/lists/* \
    apt-get upgrade

ENV TENSOR_HOME /home/isr
WORKDIR $TENSOR_HOME

COPY ISR ./ISR
COPY scripts ./scripts
COPY weights ./weights
COPY config.yml ./
COPY setup.py ./

RUN pip install --upgrade pip
RUN pip install -e ".[gpu]" --ignore-installed

ENV PYTHONPATH ./ISR/:$PYTHONPATH
ENTRYPOINT ["sh", "./scripts/entrypoint.sh"]



sed -i 's/archive.ubuntu.com/ftp.daumkakao.com/g' /etc/apt/sources.list

apt-get install -y vim

pip install -U pip



tensorflow==1.13.1

tensorflow-gpu==1.13.1



tensorflow==2.0.0



pip install keras

https://files.pythonhosted.org/packages/dc/29/162476fd44203116e7980cfbd9352eef9db37c49445d1fec35509022f6aa/scipy-1.4.1-cp36-cp36m-manylinux1_x86_64.whl






/root/.cache/pip/wheels/a7/c1/ea/cf5bd31012e735dc1dfea3131a2d5eae7978b251083d6247bd


https://s3.amazonaws.com/img-datasets/mnist.npz


root/.keras/datasets/mnist.npz


https://files.pythonhosted.org/packages/4c/2b/9dd19644f871b10f7e32eb2dbd6b45149c350b4d5f2893e091b882e03ab7/imageio-2.8.0-py3-none-any.whl


https://files.pythonhosted.org/packages/46/0f/7bd55361168bb32796b360ad15a25de6966c9c1beb58a8e30c01c8279862/tensorflow-2.0.0-cp36-cp36m-manylinux2010_x86_64.whl


CPU 기반으로 설치 됨
소스 설치를 해야 함


nvidia docker
https://hub.docker.com/r/tensorflow/tensorflow/tags?page=2
https://www.tensorflow.org/install/docker


pip install ISR --no-deps
pip check