README.md
June 3, 2026 · View on GitHub
Fine-grained Image Quality Assessment for Perceptual Image Restoration
📰 News
-
[🔴2026-06-03] We retrained FGResQ using FGRestore-100k, and the weights
FGResQ_v2.pthhave been updated in Download Weights (Google Drive / Baidu Netdisk). [PyIQA] has also been updated accordingly. We recommend using the latest weights. 【🔥🔥🔥强烈推荐使用v2版本权重】 - [2026-05-19] 🎉🎉🎉 FGResQ's inference implementation is now officially supported within the outstanding [PyIQA] framework. You can check out the detailed usage guide [here].
- [2026-05-14] 🔥🔥🔥Our method acts as the key perceptual model to balance fidelity and perception, and is used for evaluating perceptual quality in Post-Processing Ensemble Framework for Balancing Fidelity and Perception in Super-Resolution, Kim et al. Pattern Recognition Letters, 2026.[code].
- [2026-03-31] 🎉🎉🎉 The FGRestore dataset is now publicly available on HuggingFace, Google Drive, and Baidu Netdisk.
- [2025-11-19] The model is now available on the HuggingFace Hub. A live demo is also available on HuggingFace Spaces.
- [2025-11-08] 🎉🎉🎉Our paper, "Fine-grained Image Quality Assessment for Perceptual Image Restoration", has been accepted to appear at AAAI 2026!
- [2025-08-20] Code and pre-trained models for FGResQ released.
Quick Start
This guide will help you get started with the FGResQ inference code.
1. Installation
First, clone the repository and install the required dependencies.
git clone https://github.com/sxfly99/FGResQ.git
cd FGResQ
pip install -r requirements.txt
2. Download Pre-trained Weights
You can download the pre-trained model weights from the following link: Download Weights (Google Drive), (Baidu Netdisk) (提取码: 32nq)
Place the downloaded files in the weights directory.
FGResQ.pth: The main model for quality scoring and ranking.FGResQ_v2.pth: The recommended updated version of FGResQ, retrained on FGRestore-100k for quality scoring and ranking.Degradation.pth: The weights for the degradation-aware task branch.
Create the weights directory if it doesn't exist and place the files inside.
FGRestore/
|-- weights/
| |-- FGResQ.pth
| |-- FGResQ_v2.pth
| |-- Degradation.pth
|-- model/
| |-- FGResQ.py
|-- requirements.txt
|-- README.md
Usage
The FGResQ provides two main functionalities: scoring a single image and comparing a pair of images.
Initialize the Scorer
First, import and initialize the FGResQ.
from model.FGResQ import FGResQ
# Path to the main model weights
model_path = "weights/FGResQ_v2.pth"
# or use HuggingFace Model
# from huggingface_hub import hf_hub_download
# model_path = hf_hub_download(
# repo_id="orpheus0429/FGResQ",
# filename="weights/FGResQ_v2.pth"
# )
# Initialize the inference engine
model = FGResQ(model_path=model_path)
1. Single Image Input Mode: Quality Scoring
You can get a quality score for a single image. The score typically ranges from 0 to 1, where a higher score indicates better quality.
image_path = "path/to/your/image.jpg"
quality_score = model.predict_single(image_path)
print(f"The quality score for the image is: {quality_score:.4f}")
2. Pairwise Image Input Mode: Quality Ranking
You can also compare two images to determine which one has better quality.
image_path1 = "path/to/image1.jpg"
image_path2 = "path/to/image2.jpg"
comparison_result = model.predict_pair(image_path1, image_path2)
# The result includes a human-readable comparison and raw probabilities
print(f"Comparison: {comparison_result['comparison']}")
# Example output: "Comparison: Image 1 is better"
print(f"Raw output probabilities: {comparison_result['comparison_raw']}")
# Example output: "[0.8, 0.1, 0.1]" (Probabilities for Image1 > Image2, Image2 > Image1, Image1 ≈ Image2)
Dataset
The FGRestore dataset is now publicly available for research purposes. You can download it from the following sources:
- HuggingFace
- Google Drive
- Baidu Netdisk (提取码: vey5)
If you use the FGRestore dataset in your research, please cite our paper.
Citation
If you find this work is useful, pleaes cite our paper!
@inproceedings{sheng2026fgresq,
title={Fine-grained image quality assessment for perceptual image restoration},
author={Sheng, Xiangfei and Pan, Xiaofeng and Yang, Zhichao and Chen, Pengfei and Li, Leida},
booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
volume={40},
number={11},
pages={8914--8922},
year={2026}
}