> ## Documentation Index
> Fetch the complete documentation index at: https://docs.generalrobotics.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# OWLv2

> Text-prompted zero-shot object detection

Detect objects in an image using a text prompt with Google's OWL-ViT v2.

## Parameters

<ParamField body="image_input" type="str | PIL.Image | np.ndarray" required>
  RGB image as file path, URL, PIL Image, or numpy array.
</ParamField>

<ParamField body="prompt" type="str" required>
  Period-separated text description of objects to detect (e.g. `"car. person. traffic light"`).
</ParamField>

<ParamField body="box_threshold" type="float">
  Confidence threshold (0.0–1.0) for filtering detections (default: `0.2`).
</ParamField>

<ParamField body="timeout" type="float | None">
  Optional HTTP timeout.
</ParamField>

## Returns

`dict` with keys:

* `boxes` — List of bounding boxes as `[x1, y1, x2, y2]`
* `scores` — List of confidence scores (0.0–1.0)
* `labels` — List of detected label strings

## Example Output

<img src="https://mintcdn.com/scaledfoundations/lgZgGQWKvUIw0C7n/assets/images/cortex/owlv2-output.jpg?fit=max&auto=format&n=lgZgGQWKvUIw0C7n&q=85&s=dd4a06e4f28a481ae8bf5160864ab269" alt="OWLv2 object detection output with bounding boxes" width="544" height="552" data-path="assets/images/cortex/owlv2-output.jpg" />

## Example

```python theme={null}
from grid_cortex_client import CortexClient
from PIL import Image

client = CortexClient()
image = Image.open("scene.jpg")  # 640x480 RGB
dets = client.run(
    model_id="owlv2",
    image_input=image,
    prompt="building.",
    box_threshold=0.1,
)

print(len(dets["boxes"]))
# 10

# Top detections:
print(dets["scores"][0], dets["boxes"][0])
# 0.152  [122.0, 5.7, 187.9, 227.1]

print(dets["scores"][1], dets["boxes"][1])
# 0.271  [167.7, 26.6, 334.8, 242.4]

print(dets["scores"][2], dets["boxes"][2])
# 0.165  [-0.5, -0.9, 179.5, 242.3]
```
