空飛ぶ気まぐれ雑記帳

主に趣味とかプログラミングについて扱います。

aesthetic-predictorをパッケージにした

LAION-AIが開発したモデルの一つであるaesthetic-predictorというものがある。
github.com

画像の美しさを評価するモデルで、以下のような結果が得られるらしい。


データセット作りに便利そうなので今回パッケージにした。
CLIPとaestheticを推論するモデルを自動でダウンロードするようになっている。
github.com

導入はコマンド1つ。

pip install aesthetic_predictor

使い方は以下の通り。簡単だね。

from aesthetic_predictor import predict_aesthetic
from PIL import Image
print(predict_aesthetic(Image.open("path/to/image")))