Giter Club home page Giter Club logo

bicubic-plusplus's Introduction

Bicubic++: Slim, Slimmer, Slimmest - Designing an Industry-Grade Super-Resolution Network (🚀 Winner of NTIRE RTSR Challange Track 2 (x3 SR) @ CVPR 2023)

##note:This is an unofficial code repo,some code is inherited from bicubic-plusplus,this method adds ~1dB on Bicubic upscaling PSNR for all tested SR datasets and runs with ~0.5ms(2000FPS) per image on RTX4090,only inference time is included, not pre-processing and post-processing time.

Installation

git clone https://github.com/Ysnower/bicubic-plusplus.git

2.Install the dependencies. Python 3.7 PyTorch 1.13.1 opencv-python 4.5.1.48 onnxruntime 1.10.0 onnxruntime-gpu 1.10.0

my gpu is RTX4090 with CUDA 12.1

Data Preparation

only train on DIV2K dataset,you can use your own data, the number of hr images must be equal to lr images. Download DIV2K data password:xb5r and unzip the DIV2K.zip to the datasets. I used 860 images for training and 40 images for validation.

Train

1.Set validation & training dataset paths in configs/conf.yaml (data.val.lr_path, data.val.hr_path, data.train.lr_path, data.train.hr_path). Set loader.train.batch_size and loader.val.batch_size according to your dataset.

note: if use degradation(blur is True or img_noise is True), training will slow down,you can use degradation offline to generate lr data to the lr_path.

The scale/sr_rate must be divisible by patch_cropsize.

2.Run train code.

python3 train.py

pytorch inference

python3 inference.py

You can change the img_path in the inference.py file to your image location.

onnx inference

1.pytorch to onnx model

python3 torch2onnx.py

You can change the model_path to your pytorch model location and change the export_onnx_file to your onnx model name.

2.onnxruntime inference

python3 onnx_inference.py

reference

1.bicubic-plusplus

2.pytorch-static-quant

If this repository helps you,please star it. Thanks.

bicubic-plusplus's People

Contributors

ysnower avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.