Object Detection API Without Training Using Ultralytics VLM
Send an image and a list of class names to the Ultralytics Platform API and get bounding boxes and labels back, with no custom model to train first.
Glenn Jocher7 min readListen to this article

Use Ultralytics VLM through Ultralytics Platform’s POST /v1/predict endpoint to get bounding boxes and labels from an image and a list of class names. You need a Platform API key and one image per request. You can make your first request without a project, dataset, deployment or custom training.
Use vlm-2b for the faster variant or vlm-4b for the higher-accuracy variant. On the December 2, 2026 Ultralytics VLM Leaderboard, the two scored 0.435 and 0.460 mAP50, with median per-image requests of 0.31 s and 0.39 s. Test both if your classes are hard to distinguish. Both run on Ultralytics Platform without a third-party provider key.
For a browser-based example, start with the VLM1 2B model page. The Ultralytics VLM launch announcement shows how the same detections can become labels for Ultralytics YOLO training.
How class-prompted detection works#
A class-prompted model detects the classes you name in text at request time, instead of a fixed list learned during training. This is zero-shot, open-vocabulary detection: write "forklift" or "person in a high-vis vest" and the model looks for each one. The VLM Leaderboard compares their accuracy and speed on UL37, using real-world detection datasets.
Before you start#
- An API key. In Platform, go to Settings > API Keys, click Add Key, keep Ultralytics as the provider and create the key. Store it in an environment variable, never in code.
- An image. Keep the complete multipart request under 4.5 MB, including the image and form fields.
- A model ID. Use
vlm-2borvlm-4b. The examples below usevlm-4b. Create your key in Platform API Keys.
The examples read your key from ULTRALYTICS_API_KEY.
Send an image and class names#
The endpoint is POST https://api.ultralytics.com/v1/predict. It takes a multipart form with four fields:
| Field | Type | Description |
|---|---|---|
model | string | Model ID, such as vlm-4b |
file | file | Image to run the model on, one per request |
classes | string | Repeat this field for each of 1–200 class names |
normalize | boolean | Return box coordinates from 0 to 1 instead of pixels |
model, file and classes are required. Other fields, including conf, iou and imgsz, are rejected with 400.
With curl:
curl -X POST \
-H "Authorization: Bearer $ULTRALYTICS_API_KEY" \
-F "model=vlm-4b" \
-F "file=@image.jpg" \
-F "classes=forklift" \
-F "classes=person" \
https://api.ultralytics.com/v1/predictWith Python and requests:
import os
import requests
url = "https://api.ultralytics.com/v1/predict"
headers = {"Authorization": f"Bearer {os.environ['ULTRALYTICS_API_KEY']}"}
data = {"model": "vlm-4b", "classes": ["forklift", "person"]}
with open("image.jpg", "rb") as f:
response = requests.post(url, headers=headers, data=data, files={"file": f}, timeout=130)
response.raise_for_status()
for result in response.json()["images"][0]["results"]:
print(result["name"], result["box"])The Ultralytics Platform Python SDK wraps the same call as client.inference.predict(model=..., file=..., classes=[...]) from ultralytics-platform>=0.1.125.
Read the response#
The response has the same shape as standard model inference on Platform. Each entry in images carries shape (the original [height, width]), speed (timings in milliseconds) and results. Each result has:
name: the class name you sentclass: its index in yourclasseslistbox:x1,y1,x2,y2, the top-left and bottom-right corners
{
"images": [
{
"shape": [1080, 1920],
"results": [
{ "class": 0, "name": "forklift", "box": { "x1": 412, "y1": 230, "x2": 905, "y2": 760 } }
]
}
]
}Illustrative values; speed and metadata omitted.
Results have no confidence score, so you cannot filter or rank boxes by score. An empty results list is a valid response, but it does not prove that none of the requested objects is present. Review predictions for missed objects and false positives.
Coordinate formats#
By default, boxes are in the pixels of the image you uploaded, as corner coordinates. Send normalize=true to get the same corners scaled from 0 to 1.
The conversion below assumes the default pixel response, with normalize omitted or false. Platform datasets store boxes as normalized [x_center, y_center, width, height]. If you requested normalized corners, calculate centers and dimensions directly without dividing by the image width or height again.
prediction = response.json()["images"][0]
height, width = prediction["shape"]
for result in prediction["results"]:
box = result["box"]
x1, y1, x2, y2 = (box[key] for key in ("x1", "y1", "x2", "y2"))
yolo_box = [
(x1 + x2) / (2 * width),
(y1 + y2) / (2 * height),
(x2 - x1) / width,
(y2 - y1) / height,
]
print(result["class"], *yolo_box)Errors and limits#
Common responses when calling /v1/predict with vlm-2b or vlm-4b include the following.
| Status | Meaning on /v1/predict |
|---|---|
400 | Missing or invalid form fields, an unsupported model ID, or an unsupported field such as conf |
401 | Missing, malformed or revoked API key |
413 | Multipart request exceeds 4.5 MB |
422 | Image could not be read |
429 | Rate limit exceeded |
503 | Prediction service unavailable or inference timed out |
A 429 response includes a Retry-After header; wait that many seconds before retrying. The API docs include a backoff example.
Send 1–200 class names per request. See the Inference API reference for the multipart schema and current limits.
Single-image inference vs batch annotation#
/v1/predict is for one image you hold locally. It returns boxes to your code without requiring a Platform dataset. When you want labels for a whole dataset, use batch annotation instead:
POST /v1/datasets/{owner}/{dataset}/predict/batchPOST /v1/predict | POST /v1/datasets/{owner}/{dataset}/predict/batch | |
|---|---|---|
| Input | One uploaded image | Eligible unlabeled images in a Platform dataset by default |
| Classes | Sent in the request | The dataset's own classes, subject to the selected batch model's limits |
| Output | JSON returned to you | Labels saved to the dataset |
| Model field | model | modelId |
| Response | 200 with results | 202; the run continues asynchronously |
For a detection dataset with 1–200 classes, send {"modelId": "vlm-2b"} or use vlm-4b in the batch request body. Set maxImages to limit a first run to the oldest eligible images. Set includeAnnotated to true to also process images that already have labels. Batch Annotation preserves existing labels and saves a version when the dataset supports versioning. Use GET on the same path to check progress or DELETE to cancel an in-flight job.
Use Batch Annotation in Platform to preview sample predictions and review the saved boxes before training.
When to move to a trained Ultralytics YOLO model#
A trained detector is usually the better fit when you need:
- Speed and throughput for video, many cameras or high request volumes
- Confidence scores and thresholds, which trained YOLO models return and accept as
confandiou - Edge or offline inference on your own hardware
Use Batch Annotation to label a dataset, review and correct the boxes, then train Ultralytics YOLO26. For hosted inference, deploy the trained model to a dedicated endpoint. For deployment on your own hardware, export in a format your target supports.
Frequently asked questions
Yes. Ultralytics Platform's
POST /v1/predicttakes an image and class names, runs a supported class-prompted model, and returns detected boxes and labels. No project, dataset or deployment is needed. Start with Ultralytics VLM and check its current request limits.Ultralytics VLM is built for this: you name the classes and it returns boxes and labels. Compare hosted models on the VLM Leaderboard and test on your own images.
Yes. The batch endpoint accepts
vlm-2borvlm-4bas themodelIdand saves detections in a Platform dataset. Use Inference API reference when you want boxes and labels returned directly to your code for a single image.No. Class-prompted models use model-specific thresholds and return no
confidencefield, andconforioufields are rejected. If you need scores and thresholds, train an Ultralytics YOLO model on reviewed labels.For production traffic with fixed classes, evaluate a trained Ultralytics YOLO model on a dedicated endpoint. It supports confidence scores, and direct calls bypass the Platform API rate limiter while remaining subject to endpoint capacity. Measure accuracy and throughput for your workload.
Written by
Comments
Ask a question, share your results, or help someone else.





























