Downloads · 30 days
0
yzc002/FGAesQ
FGAesQ is a machine learning model from yzc002. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
<div align="center" <a href="https://arxiv.org/abs/2603.03907"<img src="https://img.shields.io/badge/Arxiv-preprint-red"</a <a href="https://yzc-ippl.github.io/FG-IAA/"<img src="https://img.shields.io/badge/Homepage-g…
Downloads · 30 days
0
Access
Public
Updated Apr 10, 2026
Repo size
601 MB
Likes
2
Public
Click a slice to open those files.
.pt599 MB · 100%
From the Hugging Face model README
This guide will help you get started with FGAesQ inference in minutes.
Clone the repository and install the required dependencies:
git clone https://github.com/yzc-ippl/FG-IAA.git
cd FG-IAA
pip install -r requirements.txt
Note: The CLIP dependency is installed directly from the official OpenAI repository and will be fetched automatically via
pip install -r requirements.txt.
Download the pre-trained model weights from: (Hugging Face) | (Baidu Netdisk)
Place the downloaded weight file at a path of your choice and set MODEL_PATH accordingly in the inference scripts.
The expected project structure is as follows:
FG-IAA/
FGAesQ_Inference/
├──utils/
├── FGAesQ.py # Model definition
├── DiffToken.py # Differential token preprocessing
├── data_utils.py
└── clip_vit_base_16_224.pt
├── inference_series.py # Series-mode inference
├── inference_single.py # Single-image inference
├── requirements.txt
README.md
FGAesQ supports two inference modes: Series Mode for photo series ranking, and Single Mode for individual image scoring.
Use inference_single.py to score a single image or all images within a folder.
Configuration (edit the main() function in inference_single.py):
MODEL_PATH = "path/to/your/model.pt" # Path to the pre-trained weights
INPUT_PATH = "path/to/image_or_folder" # Single image file or folder of images
OUTPUT_TXT = "path/to/output.txt" # Output txt path (folder mode only; set None to auto-generate)
DEVICE = "cuda"
BATCH_SIZE = 128
Run:
python inference_single.py
Output format (single_result.txt):
Total: 3
============================================================
1. photo_A.jpg 0.872314
2. photo_B.jpg 0.751203
3. photo_C.jpg 0.634891
OUTPUT_TXT.Use inference_series.py to rank images within multiple photo series simultaneously.
The input folder should contain one sub-folder per series, with image files named in the format {series_id}-{index}.jpg (e.g., 000009-01.jpg, 000009-02.jpg).
input_folder/
000009/
├── 000009-01.jpg
├── 000009-02.jpg
└── 000009-03.jpg
000010/
├── 000010-01.jpg
└── 000010-02.jpg
...
Configuration (edit the main() function in inference_series.py):
MODEL_PATH = "path/to/your/model.pt" # Path to the pre-trained weights
INPUT_FOLDER = "path/to/series_folder" # Root folder containing all series sub-folders
OUTPUT_FOLDER = "path/to/series_result" # Output directory for per-series result txt files
DEVICE = "cuda:0"
BATCH_SIZE = 64
MAX_SIZE = 2048 # Max image resolution (long edge). Use None for no limit.
# Recommended: 2048 if many images exceed this resolution.
Run:
python inference_series.py
Output format (one {series_id}_result.txt per series in OUTPUT_FOLDER):
Series: 9
Count: 3
============================================================
Ranking: 000009-02.jpg 000009-01.jpg 000009-03.jpg
Scores: 0.8812 0.7654 0.6231
Order: 000009-02.jpg > 000009-01.jpg > 000009-03.jpg
Each output file contains the predicted ranking and aesthetic scores for all images in that series, sorted from best to worst.
If you find this work useful, please cite our paper!
@article{yang2026fine,
title={Fine-grained Image Aesthetic Assessment: Learning Discriminative Scores from Relative Ranks},
author={Yang, Zhichao and Wang, Jianjie and Zhang, Zhixianhe and Xie, Pangu and Sheng, Xiangfei and Chen, Pengfei and Li, Leida},
journal={arXiv preprint arXiv:2603.03907},
year={2026}
}