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.

YOLO-World API

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
  }'

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.

YOLO-World inference speed

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

ModelLatency (ms)
yolo-world12.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.

Run YOLO-World with self-hosted Inference

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.

pip install "inference[yolo-world]" supervision
import cv2
import supervision as sv

from inference.models.yolo_world.yolo_world import YOLOWorld

image = cv2.imread("image.jpeg")

model = YOLOWorld(model_id="yolo_world/l")
classes = ["person", "backpack", "dog"]
results = model.infer("image.jpeg", text=classes, confidence=0.03)[0]

detections = sv.Detections.from_inference(results)
labels = [classes[class_id] for class_id in detections.class_id]

annotated = sv.BoxAnnotator().annotate(scene=image, detections=detections)
annotated = sv.LabelAnnotator().annotate(
    scene=annotated, detections=detections, labels=labels
)
sv.plot_image(annotated)

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.