CLIP Score
Measures how well images match their text descriptions, where higher scores indicate better image-text alignment (range: 0-100).
CLIP Score measures how well a generated image aligns with the text description it was supposed to depict. Run it to score image-text alignment for individual generations.
What it does
CLIP Score is a statistical metric. It compares an image against a text description and scores how well the two align, using CLIP embeddings.
Input
| Required Input | Type | Description |
|---|---|---|
images | string or list[string] | Single image or list of images (URL or file path) to evaluate |
text | string or list[string] | Text description or list of descriptions to compare against the images |
Output
| Field | Type | Description |
|---|---|---|
| Result | score | Score from 0 to 100, where higher values indicate better alignment between the image and text description |
| Reason | string | A plain-language explanation of the image-text alignment assessment |
Run it from code
Call evaluate() with the template name and the eval’s required inputs. It returns the score and the reason.
Note
Before running: install the SDK and set FI_API_KEY / FI_SECRET_KEY. The model argument in the snippets is the evaluator model Future AGI uses to run the eval; turing_flash is a fast default.
from fi.evals import evaluate
result = evaluate(
"clip_score",
images=["https://example.com/generated-image.jpg"],
text=["a golden retriever playing in a park"],
model="turing_flash",
)
print(result.score)
print(result.reason)import { evaluate } from "@future-agi/ai-evaluation";
const result = await evaluate(
"clip_score",
{
images: ["https://example.com/generated-image.jpg"],
text: ["a golden retriever playing in a park"]
},
{ modelName: "turing_flash" }
);
console.log(result); When to use
Run CLIP Score wherever a generated image is meant to depict a specific text prompt and you need a fast alignment check.
- Text-to-image generation pipelines, to score how well output matches the prompt
- Comparing generation models or prompt variants on the same text description
- Filtering or ranking generated images by alignment before human review
What to do when CLIP Score is low
Make the text description more specific and aligned with the visual content, and check that the image actually depicts what the prompt requested. Avoid overly abstract or ambiguous descriptions.
Ensure the image generation prompt used matches the evaluation text, and consider refining the generation model or prompt engineering.
Questions & Discussion