Skip to main content
Detect objects in image using text prompt.

Parameters

ImageInput
required
RGB image as file path, URL, PIL Image, or numpy array.
str
required
Text description of objects to detect.
float | None
Optional confidence threshold (0.0-1.0) for filtering detections.
float | None
Optional timeout in seconds for the HTTP request.

Returns

Dictionary with keys:
  • “boxes”: List of bounding boxes as [x1, y1, x2, y2] coordinates
  • “scores”: List of confidence scores (0.0-1.0)
  • “labels”: List of label indices

Example

Uses Google’s OWL-ViT v2.

Tips

  • Prompt with period-separated object phrases, e.g. "car. person. traffic light".
  • box_threshold defaults to 0.2.

Example Output

OWLv2 object detection output with bounding boxes