Skip to content
/ DiQP Public

[WACV 2025] "Reversing the Damage: A QP-Aware Transformer-Diffusion Approach for 8K Video Restoration under Codec Compression"

License

Notifications You must be signed in to change notification settings

alimd94/DiQP

Repository files navigation

PWC PWC arXiv License: Modified AGPL v3 Python Sponser: Userful

Reversing the Damage: A QP-Aware Transformer-Diffusion Approach for 8K Video Restoration under Codec Compression (DiQP, Oral WACV 2025)

Official Pytorch repository for "Reversing the Damage: A QP-Aware Transformer-Diffusion Approach for 8K Video Restoration under Codec Compression"

Updates:

  • March 17, 2025: We publicly released the trained weights Check Here.

This repository provides the codebase, pretrained models, and experimental results for our novel approach to restoring ultra-resolution (8K) videos degraded by codec compression.

Model Architecture

Figure 1: As the QP increases, the overall quality decreases, leading to more noticeable artifacts. Pixels are affected differently relative to each other. We calculated the Mean Absolute Difference and PSNR for these four quality levels and also present a heatmap of the affected areas.

Table of Contents

Key Contributions

  • A novel Transformer-Diffusion model for 8K video restoration.

  • First model to address codec artifacts (AV1, HEVC) using Denoising Diffusion without additional noise.

  • Incorporates "Look Ahead" and "Look Around" modules for improved detail reconstruction and visual quality.

  • Demonstrated superior performance over state-of-the-art methods on 4K and 8K videos.

  • Comprehensive evaluation on SEPE8K and UVG datasets.

Model Architecture

Model Architecture

Figure 2: The overall architecture of DiQP.

Installation and Setup

Prerequisites

  • Python 3.10+
  • Conda
  • CUDA-enabled GPU
  • ffmpeg (for Encoding and Decoding videos)
  1. Environment:

    • Create a conda environment using the provided environment.yml file:
      conda env create -f environment.yml
      conda activate diqp 
    • ffmpeg with CUDA-enabled especially for AV1 since not all GPUs support it. For more details please check this website.
  2. Dataset:

    • Download the SEPE-8K dataset from here.
    • Ensure your data follows the specified directory structure (see below).
    • Use encode.py and decode.py in videoRelated directory to create and process frames.

Usage

Training

  • Run the train.py script to train the model.
  • Required parameters already set into the code

Testing

  • Run the test.py script to evaluate the model on test data.

Pretrained Weights

  • For access to the pretrained weights for HVEC and AV1 models , please contact us.

Dataset Directory Structure

Your dataset should be organized as follows:

Raw:
├── 01
│   ├── 000_8K.png
│   ├── 001_8K.png
│   ├── 002_8K.png
│   └── ...
├── 02
│   ├── 000_8K.png
│   ├── 001_8K.png
│   ├── 002_8K.png
│   └── ...
└── ...
Encoded:
├── 01
│   ├── QP-X
│   │   ├── 000_8K.png
│   │   ├── 001_8K.png
│   │   ├── 002_8K.png
│   │   └── ...
│   ├── QP-X+n
│   │   ├── 000_8K.png
│   │   ├── 001_8K.png
│   │   ├── 002_8K.png
│   │   └── ...
├── 02
│   ├── QP-X
│   │   ├── 000_8K.png
│   │   ├── 001_8K.png
│   │   ├── 002_8K.png
│   │   └── ...
│   ├── QP-X+n
│   │   ├── 000_8K.png
│   │   ├── 001_8K.png
│   │   ├── 002_8K.png
│   │   └── ...
└── ...

Replace QP-X and QP-X+n with the actual quantization parameter values.

Experiments

The videoRelated directory contains code and data for experiments on:

  • Optimizing the 'Look Ahead' model's T parameter.
  • Encoding and Decoding RAW frames to required QP values.

Results

results

Figure 3: Quantitative results compared to other models.

other qp results

Figure 3: Performance of DiQP on other QP values.

seq 5 res

Figure 4: Comparison of visual quality produced by different methods on sequence 5 of the SEPE8K dataset.

seq race res

Figure 5: Comparison of visual quality produced by different methods on the Race Night sequence of the UVG dataset.

Model Architecture

Figure 6: Comparison of visual quality produced by different methods on sequence 26 of the SEPE8K dataset.

Citation

If you find this work helpful, please consider citing it and giving the repository a star! ⭐

@InProceedings{Dehaghi_2025_WACV,
    author    = {Dehaghi, Ali Mollaahmadi and Razavi, Reza and Moshirpour, Mohammad},
    title     = {Reversing the Damage: A QP-Aware Transformer-Diffusion Approach for 8K Video Restoration under Codec Compression},
    booktitle = {Proceedings of the Winter Conference on Applications of Computer Vision (WACV)},
    month     = {February},
    year      = {2025},
    pages     = {1258-1267}
}

Contact us

For any inquiries please reach out to us at ali.mollaahmadidehag@ucalgary.ca

About

[WACV 2025] "Reversing the Damage: A QP-Aware Transformer-Diffusion Approach for 8K Video Restoration under Codec Compression"

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published