detect_objects
Locate a named object in an image, returning bounding boxes, center points, and labels. Use precise object names to get reliable regions; optionally receive an annotated image.
Instructions
Locate a named object in an image, as bounding boxes and center points.
Returns bboxes ([x1, y1, x2, y2] each), points (the center of each box)
and labels, all index-aligned -- so use this whether you want regions or
coordinates; the centers come free with the boxes.
If return_annotated is true, the return value becomes a dictionary containing
the regular results plus an annotated_image_path key.
The count of results is NOT a reliable count of objects on an ambiguous
class name: Florence-2 can return several overlapping results for one
physical object (a whole-animal box plus sub-part boxes all labelled
'wing'), or a single result spanning two touching instances (two fused
blades labelled once as 'sword blade'). Prefer a more specific
object_name, and treat results as candidates to inspect, not a tally.
Use count_objects when you actually need "how many" -- it runs a
detection head that emits one region per instance, which this head does
not. Neither can separate heavily overlapping instances, so a count of 1
from either means "could not separate", not "there is one".
Boxes cannot answer whether two objects actually touch or whether one is
inside another -- they overlap the moment one object is merely in front
of another. Use spatial_relations for that.
A maximally vague object_name ("object", "thing", "item", ...) on a
scene with nothing distinctive to point to gets a near-full-frame box
filtered out rather than returned as a match -- Florence-2's grounding
head has no explicit "nothing here" output for that case and falls back
to the whole image otherwise. This only applies to the exact generic
vocabulary itself: a specific noun that genuinely fills the frame (a
close-up of wood, asked for "wood") is returned unfiltered.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| src | Yes | Local file path or http(s) URL of the image to process. PDFs are also accepted and are rendered one image per page, so tools that return a list return one entry per page. | |
| object_name | Yes | Name of the object to locate, e.g. 'person', 'car', 'face'. A short noun phrase works too ('the red mug'). More specific names ground more reliably than broad ones. | |
| return_annotated | No | If true, returns a local temp file path to an annotated image with drawn bounding boxes. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |