Giter Site home page Giter Site logo

wangjiongw / femasr Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chaofengc/femasr

0.0 0.0 0.0 171.05 MB

PyTorch codes for "Real-World Blind Super-Resolution via Feature Matching with Implicit High-Resolution Priors", ACM MM2022

License: Other

Python 98.60% MATLAB 1.40%

femasr's Introduction

FeMaSR

This is the official PyTorch codes for the paper
Real-World Blind Super-Resolution via Feature Matching with Implicit High-Resolution Priors
Chaofeng Chen*, Xinyu Shi*, Yipeng Qin, Xiaoming Li, Xiaoguang Han, Tao Yang, Shihui Guo
(* indicates equal contribution)

framework_img

Update

  • 2022.07.02
    - Update codes of the new version FeMaSR
    - Please find the old QuanTexSR in the quantexsr branch

Here are some example results on test images from BSRGAN and RealESRGAN.


Left: real images | Right: super-resolved images with scale factor 4

Dependencies and Installation

  • Ubuntu >= 18.04
  • CUDA >= 11.0
  • Other required packages in requirements.txt
# git clone this repository
git clone https://github.com/chaofengc/FeMaSR.git
cd FeMaSR 

# create new anaconda env
conda create -n femasr python=3.8
source activate femasr 

# install python dependencies
pip3 install -r requirements.txt
python setup.py develop

Quick Inference

python inference_femasr.py -s 4 -i ./testset -o results_x4/
python inference_femasr.py -s 2 -i ./testset -o results_x2/

Train the model

Preparation

Dataset

Please prepare the training and testing data follow descriptions in the main paper and supplementary material. In brief, you need to crop 512 x 512 high resolution patches, and generate the low resolution patches with degradation_bsrgan function provided by BSRGAN. While the synthetic testing LR images are generated by the degradation_bsrgan_plus function for fair comparison.

Model preparation

Before training, you need to

  • Download the pretrained HRP model: generator, discriminator
  • Put the pretrained models in experiments/pretrained_models
  • Specify their path in the corresponding option file.

Train SR model

python basicsr/train.py -opt options/train_FeMaSR_LQ_stage.yml

Model pretrain

In case you want to pretrain your own HRP model, we also provide the training option file:

python basicsr/train.py -opt options/train_FeMaSR_HQ_pretrain_stage.yml

Citation

@inproceedings{chen2022femasr,
      author={Chaofeng Chen and Xinyu Shi and Yipeng Qin and Xiaoming Li and Xiaoguang Han and Tao Yang and Shihui Guo},
      title={Real-World Blind Super-Resolution via Feature Matching with Implicit High-Resolution Priors}, 
      year={2022},
      Journal = {ACM International Conference on Multimedia},
}

License

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Acknowledgement

This project is based on BasicSR.

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.