Skip to content

[AAAI'26] PyTorch code for our paper "QuantVSR: Low-Bit Post-Training Quantization for Real-World Video Super-Resolution"

Notifications You must be signed in to change notification settings

bowenchai/QuantVSR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

πŸš€ QuantVSR: Low-Bit Post-Training Quantization for Real-World Video Super-Resolution

Bowen Chai, Zheng Chen, Libo Zhu, Wenbo Li, Yong Guo, and Yulun Zhang

"QuantVSR: Low-Bit Post-Training Quantization for Real-World Video Super-Resolution", AAAI 2026

page arXiv supp releases visitors GitHub Stars


πŸ“š Table of Contents


πŸ”₯ News

  • πŸŽ‰ [2025-11-15] All code and pretrained weights are released.
  • πŸ† [2025-11-08] QuantVSR is accepted by AAAI 2026.
  • 🚩 [2025-08-06] This repo is released.

πŸ“˜ Abstract

Diffusion models have shown superior performance in real-world video super-resolution (VSR). However, the slow processing speeds and heavy resource consumption of diffusion models hinder their practical application and deployment. Quantization offers a potential solution for compressing the VSR model. Nevertheless, quantizing VSR models is challenging due to their temporal characteristics and high fidelity requirements. To address these issues, we propose QuantVSR, an effective low-bit quantization model for real-world VSR. We propose a spatio-temporal complexity aware (STCA) mechanism, where we first utilize the calibration dataset to measure both spatial and temporal complexities for each layer. Based on these statistics, we allocate layer-specific ranks to the low-rank full-precision (FP) auxiliary branch. Subsequently, we jointly refine the FP and low-bit branches to achieve simultaneous optimization. In addition, we propose a learnable bias alignment (LBA) module to reduce the biased quantization errors. Extensive experiments on synthetic and real-world datasets demonstrate that our method obtains comparable performance with the FP model and significantly outperforms recent leading low-bit quantization methods.

πŸ“ Structure Overview

βš™οΈ Installation

We recommend using Pixi as the virtual environment manager and task runner, which has advantages in speed, simplicity, and reproducibility.

git clone https://github.com/bowenchai/QuantVSR.git
cd QuantVSR
pixi install -a
eval "$(pixi shell-hook)"

You can also manually install the dependencies based on the pyproject.toml file.

πŸ“ Datasets

All datasets follow a consistent directory structure:

data/
  β”œβ”€β”€ [DatasetName]/
  β”‚   β”œβ”€β”€ GT/         # Ground Truth: folder of high-quality frames.
  β”‚   └── LQ/         # Low-quality Input: folder of degraded frames.
  └── [DatasetName]/
      └── ...

❗ Notice: Please make sure the dataset is placed in the ./data/, otherwise you will need to modify some paths in the code manually.

πŸ—³οΈ Calibration Datasets

Dataset Type # Num Download
REDS30 Synthetic 30 OneDrive

πŸ—³οΈ Test Datasets

Dataset Type # Num Download
REDS4 Synthetic 4 OneDrive
UDM10 Synthetic 10 OneDrive
SPMCS Synthetic 30 OneDrive
MVSR4x Real-world 15 OneDrive

πŸ“₯ Download Pretrained Models

Model Information Link
MGLD-VSR Model weights of MGLD-VSR OneDrive
QuantVSR The calibrated model weights OneDrive

You need to store the weights in the following structure:

weights/
  β”œβ”€β”€ mgldvsr/
  β”‚   β”œβ”€β”€ mgldvsr_unet.ckpt
  β”‚   β”œβ”€β”€ open_clip_pytorch_model.bin
  β”‚   β”œβ”€β”€ raft-things.pth
  β”‚   β”œβ”€β”€ spynet_sintel_final-3d2a1287.pth
  β”‚   β”œβ”€β”€ v2-1_512-ema-pruned.ckpt
  β”‚   └── video_vae_cfw.ckpt
  └── qparams/
      β”œβ”€β”€ w4a4.pth
      └── ...

πŸ“ˆ Calibration

πŸ’‘ Tips: Pixi is for simplicity. All corresponding Python commands can be found in the tasks section of the pyproject.toml file.

# {bits} is an integer
# for example: `pixi run calibration 4` represents the calibration of 4-bit quantization.
pixi run calibration {bits}

πŸ§ͺ Inference

If you want to obtain the results for the test dataset:

# {datasets} represents the datasets to test.
# {upscale} is the upscaling factor.
# for example: `pixi run inference SPMCS 4 4` represents performing 4x upscaling on the SPMCS dataset with 4-bit quantization."
pixi run inference {datasets} {upscale} {bits}

If you want to test custom data:

python scripts/inference.py \
  --input_dir  {directory_of_input_videos}
  --output_dir {directory_to_save_outputs}
  --upscale    {upscaling_factor}
  --bits       {quantization_bits}

πŸ“¦ Measure

❗ Notice: The computing environments of Dover and $E^*_{warp}$ are different from the default environment, but Pixi can automatically switch between environments. For more details, please refer to the official documentation.

# {pred_dir} is a directory containing the videos to be measured.
# {gt_dir} is the corresponding directory containing the ground-truth videos.
# {metrics} represents the metrics to be measured, separated by commas, like `psnr,ssim,lpips,dists,clipiqa,musiqa,niqe,maniqa`.
# for example: `pixi run eval_metrics ./experiments/w4a4/SPMCS ./data/SPMCS/GT psnr,ssim`
pixi run eval_metrics {pred_dir} {get_dir} {metrics}
pixi run eval_dover {pred_dir}
pixi run eval_ewarp {pred_dir}

πŸ”Ž Results

QuantVSR significantly outperforms previous methods at the setting of W6A6 and W4A4.

Evaluation on synthetic and real-world datasets

Quantitative Results (click to expand)
  • Results in Tab. 3 of the main paper

Qualitative Results (click to expand)
  • Results in Fig. 4 of the main paper

πŸ“Œ Citation 

If you find the code helpful in your research or work, please cite the following paper(s).

@article{chai2025quantvsr,
  title={QuantVSR: Low-Bit Post-Training Quantization for Real-World Video Super-Resolution},
  author={Bowen Chai, Zheng Chen, Libo Zhu, Wenbo Li, Yong Guo, and Yulun Zhang},
  journal={arXiv preprint arXiv:2508.04485},
  year={2025}
}

πŸ“ Acknowledgements

We thank the developers of MGLD-VSR, whose method provides a strong baseline for QuantVSR.

We also thank the open-source contributors of PassionSR and ViDiT-Q; their excellent code has greatly facilitated the research and development of QuantVSR.

About

[AAAI'26] PyTorch code for our paper "QuantVSR: Low-Bit Post-Training Quantization for Real-World Video Super-Resolution"

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •