File size: 1,107 Bytes
bc4d46c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43

# 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("YOUR_USERNAME/aesthetic-scorer")
model = torch.load("YOUR_USERNAME/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}/10")
```