Skip to content

Real-ESRGAN aims at developing Practical Algorithms for General Image/Video Restoration.

Notifications You must be signed in to change notification settings

RefikAnadolStudio/upscaling-pipeline

 
 

Repository files navigation

Upscaling Pipeline

Dependencies and Installation

Installation

  1. Clone repo

    git clone https://github.com/RefikAnadolStudio/upscaling-pipeline
    cd upscaling-pipeline
  2. Install dependent packages

    # Install basicsr - https://github.com/xinntao/BasicSR
    # We use BasicSR for both training and inference
    pip install basicsr
    # facexlib and gfpgan are for face enhancement
    pip install facexlib
    pip install gfpgan
    pip install -r requirements.txt
    python setup.py develop

Quick Inference

Inference general images

Download pre-trained models: RealESRGAN_x4plus.pth

wget https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth -P experiments/pretrained_models

Inference!

python inference_realesrgan.py -n RealESRGAN_x4plus -i inputs

Results are in the results folder

Usage of python script

  1. You can use X4 model for arbitrary output size with the argument outscale. The program will further perform cheap resize operation after the Real-ESRGAN output.
Usage: python inference_realesrgan.py -n RealESRGAN_x4plus -i infile -o outfile [options]...

A common command: python inference_realesrgan.py -n RealESRGAN_x4plus -i infile --outscale 3.5 --face_enhance

  -h                   show this help
  -i --input           Input image or folder. Default: inputs
  -o --output          Output folder. Default: results
  -g --gpu-id          GPU device to use (default=auto) can be 0,1,2
  -n --model_name      Model name. Default: RealESRGAN_x4plus
  -s, --outscale       The final upsampling scale of the image. Default: 4
  --suffix             Suffix of the restored image. Default: out
  -t, --tile           Tile size, 0 for no tile during testing. Default: 0
  --face_enhance       Whether to use GFPGAN to enhance face. Default: False
  --fp32               Use fp32 precision during inference. Default: fp16 (half precision).
  --ext                Image extension. Options: auto | jpg | png, auto means using the same extension as inputs. Default: auto

Model Zoo

Please see docs/model_zoo.md

About

Real-ESRGAN aims at developing Practical Algorithms for General Image/Video Restoration.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%