Run in Colab
Step through this example interactively
detect() helper finds grounded objects in an image and returns normalized geometry. Use it to detect or count items in a scene, or to track objects across multiple frames.
Basic usage
| Parameter | Type | Default | Description |
|---|---|---|---|
media_obj | MediaNode | - | Wrap your image (path, URL, or bytes) with image(). |
classes | list[str] | [] | Labels to look for; use plural lists for multi-target jobs |
expects | str | "box" | Geometry type for grounded outputs ("box", "point", "polygon") |
format | str | "text" | CLI output schema; choose "text" for Rich summaries or "json" for machine-readable results |
The
format argument is only available through the CLI flag (--format text|json). The Python helper always returns a PerceiveResult.PerceiveResult object:
text(str): Model summary for the scene.boxes,points,polygons(list | None): Populated based onexpects. Each list has its own*_to_pixels(width, height)helper for normalized → pixel conversion.
Example: PPE compliance line
In this example, we download a photo of a factory worker, run detection for hard hats and safety vests, and overlay the returned bounding boxes to visualize the grounded output end to end.All spatial outputs use a 0-1000 normalized coordinate system. Convert via
result.points_to_pixels(width, height) before rendering overlays — see the coordinate system guide for more patterns.CLI usage
Run detections straight from the CLI by specifying your source image, target classes, and geometry/output preferences:Best practices
- Targeted prompts: Call out the exact categories you care about (“helmets, vests, goggles”) and set the
classeslist accordingly so Isaac 0.1 focuses on those objects. - Grounded exemplars: When objects are subtle, attach additional reference frames (multi-image inputs) or short textual descriptors so the model learns the trait you want detected — see the in-context-learning sections for more examples.
Run through the full Jupyter notebook here. Reach out to Perceptron support if you have questions.