BasicAVSR: Arbitrary-Scale Video Super-Resolution via Image Priors and Enhanced Motion Compensation (Under Review)
[arXiv]
This repository is the official PyTorch implementation of BasicAVSR: Arbitrary-Scale Video Super-Resolution via Image Priors and Enhanced Motion Compensation.
Our method can achieve video SR with an arbitrary scale. If global SR is required, simply input the size of the target, which corresponds to hr_coord in the code. And the SR scale is related to cell in the code. If local super-resolution is required, hr_coord needs to be cropped.
- Python >= 3.8, PyTorch == 1.13.0 (Perhaps >=1.8.0 is also OK), CUDA 11.7
- Requirements: opencv-python, numpy, matplotlib, imageio, scikit-image, thop, tqdm, cupy(cupy-cuda117), mmcv-full=1.6.2
Please download the RS-GOPRO datasets from REDS (Type: Sharp) and Vid4.
|--REDS
|--train
|--train_sharp
|--video 1
|--frame 1
|--frame 2
:
|--video 2
:
|--video n
|--val
|--val_sharp
|--video 1
|--frame 1
|--frame 2
:
|--video 2
:
|--video n
|--Vid4
|--video 1
|--frame 1
|--frame 2
:
|--video 2
:
|--video n
Please download the pre-trained model from GoogleDrive. Please put the models to ./.
- Processing the entire video frames:
bash test_sequence.sh
Please change --data_path, --model_path and --result_path according to yours.
- Training BasicAVSR (bidirectional RNN) from scratch.
We use an NVIDIA RTX A6000 (48GB) for training. Please adjust the dataloader_batch_size and test{'n_seq'} in options based on your GPU memory.
python -m torch.distributed.launch --nproc_per_node=1 --master_port=1234 train.py --opt options/train_basicvsr_pp_hf_iart.json --dist True
- Training BasicAVSR (unidirectional RNN) from scratch.
python -m torch.distributed.launch --nproc_per_node=1 --master_port=1234 train.py --opt options/train_forwardrnn_hf_iart_plus.json --dist True
- Training BasicAVSR (unidirectional RNN with lookahead) from scratch.
python -m torch.distributed.launch --nproc_per_node=1 --master_port=1234 train.py --opt options/train_refsrrnn_cuf_siren_hf_iart_only_future_plus_t3.json --dist True
Please change gpu_ids, path{'root', 'images'}, and data_root in options according to yours.
Note: If ‘out of memory’ occurs during the validation, please adjust the appropriate sequence length test{'n_seq'}. The code of validation is implemented by processing the entire video sequence.
If you use any part of our code, or BasicAVSR is useful for your research, please consider citing:
@article{shang2025basicavsr,
title={BasicAVSR: Arbitrary-Scale Video Super-Resolution via Image Priors and Enhanced Motion Compensation},
author={Shang, Wei and Zhang, Wanying and Gu, Shuhang and Zhu, Pengfei and Hu, Qinghua and Ren, Dongwei},
journal={arXiv preprint arXiv:2510.26149},
year={2025}
}
If you have any questions, please contact csweishang@gmail.com.
