CoolFace
Apppublic

TanishqBhardwaj/aesthetic-scorer-api

sourceHugging Facemitupdated 1y agoView on Hugging Face
1likes
App README

title: Aesthetic Scorer API emoji: ๐ŸŽจ colorFrom: purple colorTo: pink sdk: gradio sdkversion: "5.47.2" appfile: app.py pinned: false license: mit language:

  • โ€”en base_model:
  • โ€”openai/clip-vit-base-patch32 pipeline_tag: image-classification tags:
  • โ€”aesthetics
  • โ€”creativity ---

Aesthetic Scorer

This model predicts 7 different aesthetic metrics for images:

  • โ€”Overall aesthetic score
  • โ€”Technical quality score
  • โ€”Composition score
  • โ€”Lighting score
  • โ€”Color harmony score
  • โ€”Depth of field score
  • โ€”Content score

Model Details

  • โ€”Based on CLIP ViT-B/32 visual encoder
  • โ€”Fine-tuned on the PARA dataset
  • โ€”Returns scores between 0-5 for each aesthetic dimension

Usage

python
from transformers import CLIPProcessor
from aesthetic_scorer import AestheticScorer
import torch
from PIL import Image

# Load the model
processor = CLIPProcessor.from_pretrained("rsinema/aesthetic-scorer")
model = torch.load("rsinema/aesthetic-scorer/model.pt")

# Process an image
image = Image.open("your_image.jpg")
inputs = processor(images=image, return_tensors="pt")["pixel_values"]

# Get scores
with torch.no_grad():
    scores = model(inputs)

# Print results
aesthetic_categories = ["Overall", "Quality", "Composition", "Lighting", "Color", "Depth of Field", "Content"]
for category, score in zip(aesthetic_categories, scores):
    print(f"{category}: {score.item():.2f}/5")