CLIP ViT-B/32 Zero-Shot

CLIP_VIT_B_32_ZERO_SHOT

Scores a photo against labels you supply at request time: zero-shot image classification with CLIP ViT-B/32.

Vision & Analysis

About CLIP ViT-B/32 Zero-Shot

Scores one photo against class labels you send with the request. The labels are not fixed in advance: each label is turned into a short caption, and the model reports how well the photo matches each caption.

The weights are laion/CLIP-ViT-B-32-laion2B-s34B-b79K at revision 1a25a446712ba5ee05982a381eed697ef9b435cf. LAION trained this ViT-B/32 CLIP with OpenCLIP on the English subset of LAION-2B. Training was run by Romain Beaumont. The architecture follows the original OpenAI CLIP model. The model card states the licence as MIT. The weights file model.safetensors is 605,157,884 bytes (577 MB) and is public.

Limits

English captions. One image per request. Files over 20 MB, or wider or taller than 4096 pixels, are refused before they are decoded. At most 50 labels. The score is a match between the photo and the caption, not a measure of truth, identity, or safety. The model runs on CPU. The model card asks for task-specific testing before a fixed label set is used in production, and it marks surveillance and facial recognition as out of scope.

CLIP ViT-B/32 Zero-Shot inputs and output

NameTypeRequiredDefaultDetails
imagefileYes—Photo to score. At most 20 MB, and at most 4096 pixels on a side.
image/jpeg, png, webp
labelstextYes—Comma-separated class names, from 2 to 50 labels, each at most 60 characters.
3–3049 characters
templatetextNoa photo of a {}Prompt template. Must contain {} exactly once.
Max 100 characters

Output. Returns plain text.

Run CLIP ViT-B/32 Zero-Shot with the API

Send your API key in the X-API-Key header. The run is asynchronous: submit it, then poll it until it finishes. Create an API key.

cURL
curl -X POST "https://api.kainguru.com/api/v1/executions?mlFlowId=CLIP_VIT_B_32_ZERO_SHOT" \
  -H "X-API-Key: kg_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "input": {
    "image": "https://example.com/input.png",
    "labels": "example",
    "template": "a photo of a {}"
  },
  "outputFormat": "json"
}'

# Poll until the execution reaches a terminal state
curl "https://api.kainguru.com/api/v1/executions/{executionId}" \
  -H "X-API-Key: kg_your_api_key"
Python
from kainguru import KainguruClient

with KainguruClient(api_key="kg_your_api_key", base_url="https://api.kainguru.com/api") as client:
    submitted = client.executions.execute(
        "CLIP_VIT_B_32_ZERO_SHOT",
        {
          "image": "https://example.com/input.png",
          "labels": "example",
          "template": "a photo of a {}"
        },
        output_format="json",
    )
    result = client.executions.await_completion(submitted.id)
    print(result.execution.output)

CLIP ViT-B/32 Zero-Shot pricing

Price per request: 0.008 credits ($0.00008). The price is shown again before every run; all prices are on the pricing page.

Florence-2 Large: Vision & Analysis model on Kainguru
Vision & Analysis

Florence-2 Large

One small vision model that captions images, reads text, boxes objects and finds things named by a phrase.

Fine-tunable
BLIP2 Flan T5 XL: Vision & Analysis model on Kainguru
Vision & Analysis

BLIP2 Flan T5 XL

Describes a photo in a sentence or answers a question about it in plain English.

Fine-tunable
BLIP Image Captioning Large: Vision & Analysis model on Kainguru
Vision & Analysis

BLIP Image Captioning Large

Writes a short English caption for a photo, and can finish a caption you start.

Fine-tunable
BLIP VQA Base: Vision & Analysis model on Kainguru
Vision & Analysis

BLIP VQA Base

Answers short questions about a photo, such as what colour the car is or how many people are in it.

Fine-tunable
Deplot: Vision & Analysis model on Kainguru
Vision & Analysis

Deplot

DePlot from Google reads a chart or plot image and returns the data table drawn in it.

Docling Layout Heron: Vision & Analysis model on Kainguru
Vision & Analysis

Docling Layout Heron

Finds the layout of a document page, such as text blocks, titles, section headers, tables, pictures, captions…

Fine-tunable