Home

Awesome

PWC

A Simple Baseline for Video Restoration with Grouped Spatial-temporal Shift (CVPR 2023)

paper | supplementary | arxiv | project page

This repository is the official PyTorch implementation of "A Simple Baseline for Video Restoration with Spatial-temporal Shift"

Abstract: Video restoration, which aims to restore clear frames from degraded videos, has numerous important applications. The key to video restoration depends on utilizing inter-frame information. However, existing deep learning methods often rely on complicated network architectures, such as optical flow estimation, deformable convolution, and cross-frame self-attention layers, resulting in high computational costs. In this study, we propose a simple yet effective framework for video restoration. Our approach is based on grouped spatial-temporal shift, which is a lightweight and straightforward technique that can implicitly capture inter-frame correspondences for multi-frame aggregation. By introducing grouped spatial shift, we attain expansive effective receptive fields. Combined with basic 2D convolution, this simple framework can effectively aggregate inter-frame information. Extensive experiments demonstrate that our framework outperforms the previous state-of-the-art method, while using less than a quarter of its computational cost, on both video deblurring and video denoising tasks. These results indicate the potential for our approach to significantly reduce computational overhead while maintaining high-quality results.

<p align="center"><img src="figures/comparison0.png" width="40%"></p> <p align="center"><img src="figures/qualitative_result1.png" width="70%"></p>

Container

Container: NVIDIA PyTorch Container 21.02.

cuda 11.2.0
pytorch 1.8.0a0+52ea372
TensorRT 7.2.2.3+cuda11.1.0.024

Installation

pip install -r requirements.txt
python setup.py develop --no_cuda_ext

Data Preparation

1. GoPro & DVD: download the datasets following the instructions of CDVD-TSP

If you have downloaded the datasets,please put them to './dataset'. It should be like ./datasets/GoPro/train/blur and ./datasets/GoPro/train/gt

2. DAVIS: download DAIVS-train to ./datasets/DAVIS/JPEGImages/480p. Download DAVIS-test to ./datasets/DAVIS-test

3. Set8: download Set8 to ./datasets/Set8

Pre-trained Models

TaskDatasetModelLink
Video DeblurringGoProOurs+gdrive
Video DeblurringGoProOurs-sgdrive
Video DeblurringDVDOurs+gdrive
Video DeblurringDVDOurs-sgdrive
Video DenoisingDAVIS & Set8Ours+gdrive
Video DenoisingDAVIS & set8Ours-sgdrive

Inference:

Download the pre-trained models in ./pretrained_models/

Video Deblurring: you can adjust one_len in {8,12,16,24,32,48,96} according to GPU memory.

python3 inference/test_deblur_small.py --default_data GOPRO --one_len 96
python3 inference/test_deblur.py --default_data GOPRO --one_len 48
python3 inference/test_deblur.py --default_data DVD --one_len 48
python3 inference/test_deblur_small.py --default_data DVD --one_len 96

Video Denoising:

python3 inference/test_denoise_small.py --default_data DAVIS --sigma 10
python3 inference/test_denoise.py --default_data DAVIS --sigma 10
python3 inference/test_denoise_small.py --default_data Set8 --sigma 10
python3 inference/test_denoise.py --default_data Set8 --sigma 10

Visual Results

TaskDatasetModelLink
Video DeblurringGoProOurs+gdrive
Video DeblurringGoProOurs-sgdrive
Video DeblurringDVDOurs+gdrive
Video DeblurringDVDOurs-sgdrive
Video DenoisingDAVISOurs+gdrive
Video DenoisingDAVISOurs-sgdrive
Video DenoisingSet8Ours+gdrive
Video DenoisingSet8Ours-sgdrive

Training:

Video Deblurring:

Adjust n_sequence in yml according to GPU memory.

python -m torch.distributed.launch --nproc_per_node=8 basicsr/train1.py -opt options/gopro_deblur_small.yml --launcher pytorch
python -m torch.distributed.launch --nproc_per_node=8 basicsr/train1.py -opt options/gopro_deblur.yml --launcher pytorch
python -m torch.distributed.launch --nproc_per_node=8 basicsr/train1.py -opt options/gopro_dvd_small.yml --launcher pytorch
python -m torch.distributed.launch --nproc_per_node=8 basicsr/train1.py -opt options/gopro_dvd.yml --launcher pytorch

Video Denoising:

Adjust n_sequence in yml according to GPU memory.

python -m torch.distributed.launch --nproc_per_node=8 basicsr/train2.py -opt options/davis_denoise_small.yml --launcher pytorch
python -m torch.distributed.launch --nproc_per_node=8 basicsr/train2.py -opt options/davis_denoise.yml --launcher pytorch
davis_denoise.yml: adjust learning rate of Stage-2, see the difference of DAVIS performances betweeen on the CVPR camera ready and arXiv:

Citations

@InProceedings{Li_2023_CVPR,
    author    = {Li, Dasong and Shi, Xiaoyu and Zhang, Yi and Cheung, Ka Chun and See, Simon and Wang, Xiaogang and Qin, Hongwei and Li, Hongsheng},
    title     = {A Simple Baseline for Video Restoration With Grouped Spatial-Temporal Shift},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
    month     = {June},
    year      = {2023},
    pages     = {9822-9832}
}

Acknowledgement

In this project, we use parts of codes in: