Giter Site home page Giter Site logo

clayicarus / realbasicvsr_x2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ckkelvinchan/realbasicvsr

0.0 0.0 0.0 25.98 MB

A model for x2 real-world video super-resolution based on ckkelvinchan/RealBasicVSR.

License: Apache License 2.0

Python 100.00%

realbasicvsr_x2's Introduction

RealBasicVSR_x2

A model for x2 real-world video super-resolution based on RealBasicVSR.

Installation

  1. Install PyTorch and torchvision following the official instructions, e.g.,
conda install pytorch==1.7.1 torchvision==0.8.2 torchaudio==0.7.2 cudatoolkit=10.1 -c pytorch
  1. Install mim and mmcv-full
pip install openmim
mim install mmcv-full
  1. Install mmedit
pip install mmedit

Inference

  1. Download the pre-trained weights to checkpoints/. (Dropbox / Google Drive / OneDrive)

  2. Run the following command:

python inference_realbasicvsr.py ${CONFIG_FILE} ${CHECKPOINT_FILE} ${INPUT_DIR} ${OUTPUT_DIR} --max-seq-len=${MAX_SEQ_LEN} --is_save_as_png=${IS_SAVE_AS_PNG}  --fps=${FPS}

This script supports both images and videos as inputs and outputs. You can simply change ${INPUT_DIR} and ${OUTPUT_DIR} to the paths corresponding to the video files, if you want to use videos as inputs and outputs. But note that saving to videos may induce additional compression, which reduces output quality.

For example:

  1. Images as inputs and outputs
python inference_realbasicvsr.py configs/inference_vsr_x2.py checkpoints/RealBasicVSR_x2.pth data/demo_000 results/demo_000
  1. Video as input and output
python inference_realbasicvsr.py configs/inference_vsr_x2.py checkpoints/RealBasicVSR_x2.pth data/demo_001.mp4 results/demo_001.mp4 --fps=12.5

Training

We only train the second stage from pre-trained weights on REDS dataset. (Dropbox / Google Drive / OneDrive)

We crop the REDS dataset into sub-images for faster I/O. Please follow the instructions below:

  1. Put the original REDS dataset in ./data
  2. Resize the original REDS dataset:
python generate_rescale.py
  1. Run the following command:
python crop_sub_images.py --data-root ./data/REDS  --scales 2

Then we just train the second stage from pre-trained weights.

mim train mmedit configs/vsr_train_st2_128x128.py --gpus 8

Note: We use UDM10 with bicubic downsampling for validation and use VideoLQ for test. You can also download it from here and download the VideoLQ dataset using Dropbox / Google Drive / OneDrive.

Acknowledgement

RealBasicVSR

realbasicvsr_x2's People

Contributors

ckkelvinchan avatar clayicarus avatar ha0tang avatar ak391 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.