edsr base
eugenesiowIntroduction
The Enhanced Deep Residual Networks for Single Image Super-Resolution (EDSR) is a model designed to upscale images by factors of 2x, 3x, and 4x. EDSR improves image resolution by restoring high-resolution images from low-resolution inputs. The model was introduced in the paper by Lim et al. (2017).
Architecture
EDSR employs a deeper and wider architecture with 32 ResBlocks and 256 channels, but the base model includes 16 ResBlocks and 64 channels. It features global and local skip connections and performs up-scaling at the network's end. Unlike other models, EDSR does not use batch normalization, opting for constant scaling layers to maintain stable training. An L1 loss function is utilized for better performance and reduced computation.
Training
The EDSR models were pre-trained on the DIV2K dataset, consisting of 800 high-quality images, augmented to 4000 images, with 100 validation images. Pre-training involved creating low-resolution images via bicubic interpolation and applying data augmentation by cropping five patches from each image. The training was performed on a GPU using the super_image library in combination with the Hugging Face datasets library.
Guide: Running Locally
-
Install Requirements:
- Ensure Python is installed.
- Install the necessary libraries using pip:
pip install super-image pip install datasets
-
Load and Upscale an Image:
from super_image import EdsrModel, ImageLoader from PIL import Image import requests url = 'https://example.com/low_res_image.jpg' image = Image.open(requests.get(url, stream=True).raw) model = EdsrModel.from_pretrained('eugenesiow/edsr-base', scale=2) inputs = ImageLoader.load_image(image) preds = model(inputs) ImageLoader.save_image(preds, './scaled_2x.png') ImageLoader.save_compare(inputs, preds, './scaled_2x_compare.png')
-
Suggested Cloud GPUs:
- Consider using cloud services with GPU support, such as Google Colab, AWS EC2, or Azure, for efficient processing of large datasets and models.
License
The EDSR model is licensed under the Apache License 2.0.