Skip to content

Sg4Dylan/ESRGAN-ONNX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ESRGAN-ONNX

Implement of ESRGAN with ONNX, just only for inference.
You can easily try your images without installing complex machine learning enviroment.

Installation

  1. Install dependence

pip install numpy pillow onnxruntime

for NVIDIA GPU

pip install onnxruntime-gpu

for AMD/Intel GPU

pip install onnxruntime-directml

  1. Download models.7z on release page
  2. Unzip models.7z in code directory

Testing

  1. Modify source code
# change model
using_model_path = 'models/JPEG_Denoise/1x_JPEG_60-80-opti.onnx'  
# change execution provider
self.exec_provider = ['CUDAExecutionProvider'] # GPU via CUDA
self.exec_provider = ['DmlExecutionProvider']  # GPU via DirectML
self.exec_provider = ['CPUExecutionProvider']  # CPU Only
self.exec_provider = ['DmlExecutionProvider', 'CPUExecutionProvider']  # DirectML + CPU (default)
# set tile size
# For `4x_IllustrationJaNai_V1_DAT2_190k`, tile_size=224, scale=4
model = ESRGAN(using_model_path, tile_size=1024, scale=1)
  1. Run to go

python main.py input.jpg

Export others pretrain model

See this gist

Reference

  1. ESRGAN
  2. Model Database

About

Implement of ESRGAN with ONNX

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages