项目
在 GitHub 查看
discus0434/aesthetic-predictor-v2-5
关于
基于 SigLIP 的美学评分预测器
其他项目实测星标增长
- 24小时
- +1
- 7天
- +1
- 15天
- +2
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文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, 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!
Installation
pip install aesthetic-predictor-v2-5
Usage
This repository features an interface similar to Hugging Face Transformers, almost same as Simple Aesthetics Predictor, making it easy to use.
from pathlib import Path
import torch
from aesthetic_predictor_v2_5 import convert_v2_5_from_siglip
from PIL import Image
SAMPLE_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.
探索相关项目
加载中…