https://github.com/discus0434/aesthetic-predictor-v2-5
SigLIP-based Aesthetic Score Predictor
https://github.com/discus0434/aesthetic-predictor-v2-5
aesthetic-assessment image-quality-assessment
Last synced: 7 months ago
JSON representation
SigLIP-based Aesthetic Score Predictor
- Host: GitHub
- URL: https://github.com/discus0434/aesthetic-predictor-v2-5
- Owner: discus0434
- License: agpl-3.0
- Created: 2024-05-27T07:08:45.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-18T11:29:11.000Z (10 months ago)
- Last Synced: 2025-03-28T18:07:10.828Z (7 months ago)
- Topics: aesthetic-assessment, image-quality-assessment
- Language: Python
- Homepage:
- Size: 7.5 MB
- Stars: 208
- Watchers: 1
- Forks: 3
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Aesthetic Predictor V2.5
Aesthetic Predictor V2.5 is a SigLIP-based predictor that evaluates the aesthetics of an image on a scale from 1 to 10.
Compared to [Aesthetic Predictor V2](https://github.com/christophschuhmann/improved-aesthetic-predictor), it has been improved to evaluate a wider range of image domains such as illustrations.
![]()
Unlike V2, **_5.5+_** is considered to be a great aesthetic score.
**You can try Aesthetic Predictor V2.5 at Hugging Face Spaces!**
[](https://huggingface.co/spaces/discus0434/aesthetic-predictor-v2-5)
## Installation
```bash
pip install aesthetic-predictor-v2-5
```## Usage
This repository features an interface similar to Hugging Face Transformers, almost same as [Simple Aesthetics Predictor](https://pypi.org/project/simple-aesthetics-predictor/), making it easy to use.
```python
from pathlib import Pathimport torch
from aesthetic_predictor_v2_5 import convert_v2_5_from_siglip
from PIL import ImageSAMPLE_IMAGE_PATH = Path("path/to/image")
# load model and preprocessor
model, preprocessor = convert_v2_5_from_siglip(
low_cpu_mem_usage=True,
trust_remote_code=True,
)
model = model.to(torch.bfloat16).cuda()# load image to evaluate
image = Image.open(SAMPLE_IMAGE_PATH).convert("RGB")# preprocess image
pixel_values = (
preprocessor(images=image, return_tensors="pt")
.pixel_values.to(torch.bfloat16)
.cuda()
)# predict aesthetic score
with torch.inference_mode():
score = model(pixel_values).logits.squeeze().float().cpu().numpy()# print result
print(f"Aesthetics score: {score:.2f}")
```With ComfyUI, you can use [this custom node](https://github.com/discus0434/comfyui-aesthetic-predictor-v2-5).