File tree Expand file tree Collapse file tree 7 files changed +573
-511
lines changed
src/components/OrganizePreviews Expand file tree Collapse file tree 7 files changed +573
-511
lines changed Original file line number Diff line number Diff line change @@ -31,9 +31,9 @@ build-ai-api:
3131 docker build -f apps/api/Dockerfile -t ai-api .
3232
3333ai-api :
34- docker run --name ai-api-run -p 8080:8080 ai-api > api.log 2>&1 || true
35- cat api.log
36- docker rm ai-api-run || true
34+ # OpenAI model stores in ~/.cache/clip
35+ docker run --rm --name ai- api -p 8080:8080 \
36+ -v $( HOME ) /.cache/clip:/root/.cache/clip
3737
3838build-test :
3939 docker build -f apps/api/Dockerfile --build-arg INSTALL_TEST=true -t ai-api-test .
Original file line number Diff line number Diff line change @@ -29,13 +29,21 @@ This project serves a high-accuracy image classification API using a **Vision Tr
2929
3030# Aesthetic Scoring
3131
32- ## Model details
33-
34- - ** [ OpenCLIP] ( https://github.com/mlfoundations/open_clip ) ViT-L/14** model (CLIP architecture)
35- - ** Checkpoint** laion2B-s32B-b82K
36- - ** Aesthetic scoring** using a trained multilayer perceptron (MLP)
37- - Deterministic evaluation
38- - A custom regression MLP head trained on:
39- - [ AVA dataset (aesthetics annotated)] ( https://github.com/microsoft/LMOps/blob/main/promptist/aesthetic/ava%2Blogos-l14-linearMSE.pth )
40- - Logos subset (for composition)
41- - [ Code sample] ( https://github.com/christophschuhmann/improved-aesthetic-predictor/tree/main )
32+ This project provides an API for ** aesthetic scoring** of images using a regression head trained on top of OpenAI's CLIP ViT-B/16 backbone.
33+
34+ ---
35+
36+ ## 🧠 Model Details
37+
38+ - ** Backbone:** OpenAI CLIP ViT-B/16
39+ - ** Regression Head:** Multilayer Perceptron (MLP) trained for aesthetic prediction
40+ - ** Head Weights:** ` models/aesthetic/sa_0_4_vit_b_16_linear.pth `
41+ - ** Feature Dimension:** 512
42+
43+
44+ ## Local setup
45+
46+ 1 . Download the regression head:
47+ [ sa_0_4_vit_b_16_linear.pth] ( https://github.com/LAION-AI/aesthetic-predictor/blob/main/sa_0_4_vit_b_16_linear.pth )
48+ 1 . Place it in ` models/aesthetic/sa_0_4_vit_b_16_linear.pth `
49+ 1 . The OpenAI CLIP backbone weights for ViT-B/16 will be downloaded automatically on first run ` make ai-api `
Original file line number Diff line number Diff line change 99# Setup logging once
1010logging .basicConfig (stream = sys .stdout , level = logging .DEBUG )
1111logger = logging .getLogger ("uvicorn" )
12- logger .setLevel (logging .ERROR )
12+ logger .setLevel (logging .DEBUG )
1313
1414logger .debug ("FastAPI is initializing..." )
1515
Original file line number Diff line number Diff line change @@ -10,6 +10,4 @@ Hugging Face timm https://huggingface.co/timm/convnext_large_mlp.laion2b_ft_augr
1010
1111## Aesthetic Scorer
1212
13- ` make load-weights MODEL_REPO=LAION/CLIP-based-Aesthetic-Predictor FILENAMES="ava+logos-l14-linearMSE.pth" `
14-
15- https://github.com/LAION-AI/aesthetic-predictor/blob/main/sa_0_4_vit_b_16_linear.pth
13+ No longer uses weights loader
You can’t perform that action at this time.
0 commit comments