For the complete documentation index, see llms.txt. This page is also available as Markdown.

YOLO-World

Use YOLO-World open-vocabulary object detection through our Serverless Cloud API

YOLO-World is an open-vocabulary object detection model that detects objects from arbitrary text class names without training. We support YOLO-World inferencing via our Serverless Cloud API.

For more details on running YOLO-World, see the Inference docs.

Code sample

Run YOLO-World through the HTTP endpoint directly with curl, or with the inference-sdk wrapper.

1

Get your API Key

Create a Roboflow account, find your key on the Roboflow API settings page and make it available to your shell:

export ROBOFLOW_API_KEY="your-key-here"
2

Run the model

Call the /yolo_world/infer endpoint with curl:

curl --location 'https://serverless.roboflow.com/yolo_world/infer' \
  --header 'Content-Type: application/json' \
  --data '{
    "api_key": "'"$ROBOFLOW_API_KEY"'",
    "image": {"type": "url", "value": "https://media.roboflow.com/quickstart/traffic.jpg"},
    "text": ["car", "truck"],
    "yolo_world_version_id": "v2-s",
    "confidence": 0.05
  }'
1

Get your API Key

Create a Roboflow account, find your key on the Roboflow API settings page and make it available to your shell:

export ROBOFLOW_API_KEY="your-key-here"
2

Install the dependencies

Install the SDK and supervision:

pip install -U inference-sdk supervision
3

Run the model

Run YOLO-World with custom class names, then decode and visualize the predictions with supervision.

import os
import cv2
import supervision as sv
from inference_sdk import InferenceHTTPClient

image = sv.load_image_from_url("https://media.roboflow.com/quickstart/traffic.jpg")

client = InferenceHTTPClient(
    api_url="https://serverless.roboflow.com",
    api_key=os.environ["ROBOFLOW_API_KEY"],
)

results = client.infer_from_yolo_world(
    inference_input=image,
    class_names=["car", "truck"],
    model_version="v2-s",
    confidence=0.05,
)

detections = sv.Detections.from_inference(results[0])

labels = [
    f"{name} {conf:.2f}"
    for name, conf in zip(detections.data["class_name"], detections.confidence)
]
annotated = sv.BoxAnnotator().annotate(image.copy(), detections)
annotated = sv.LabelAnnotator().annotate(annotated, detections, labels=labels)
cv2.imwrite("annotated.png", annotated)

The class_names argument accepts any list of class names. Available model_version values: v2-s, v2-m, v2-l, v2-x, s, m, l, x.

Inference speed

Latency measured with Roboflow Inference on 1x NVIDIA L4, batch size 1, mean after warmup.

Model
Latency (ms)

yolo-world

12.4

Measured on the v2-s variant with two classes. Setting the class list runs a text encoder once, and is excluded from this figure since it is not repeated per frame.

Set api_url to match your deployment target:

  • https://serverless.roboflow.com for the Serverless Cloud API.

  • http://localhost:9001 for a local Inference server.

  • Your Dedicated Deployment URL for a private endpoint.

Use with Inference (self-hosted)

YOLO-World also runs on your own hardware, either loaded in-process with the inference package or served by a local Inference server. On capable hardware (for example a V100 GPU) it runs in real time, which makes it a practical choice for video.

Add the YOLO-World block to a Workflow and set the classes you want to detect. Then stream a webcam, camera feed, or video file through that Workflow with the Inference SDK WebRTC client.

In the native package, YOLO-World checkpoints are identified as yolo_world/<version>, where <version> is one of s, m, l, x, v2-s, v2-m, v2-l, v2-x. The v2- checkpoints are newer and score better on evaluation metrics.

Like most zero-shot detectors, YOLO-World is strongest on common objects (cars, people, dogs) and weaker on narrow, fine-grained categories. Experiment with prompt wording to find what works for your scene.

Last updated

Was this helpful?