添加方框标记
image_draw_boxDraw labeled bounding boxes on images to annotate detected objects or highlight specific regions. Accepts pixel or normalized coordinates and returns the annotated image as base64 PNG.
Instructions
在图片上绘制方框标记,可添加文字标签。
适用于标注检测结果、标记图片中的特定区域等。
参数:
image: 图片路径或URL
boxes: 方框列表,每个方框包含x/y/w/h(位置和尺寸)、color(颜色)、label(标签)、line_width(线宽)
normalized: 坐标是否为0-1归一化值(默认false,像素坐标)
output_path: 可选,保存到文件路径
返回:标注后的图片(base64 PNG)和元信息
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| boxes | Yes | 方框列表 | |
| image | Yes | 图片路径或URL(http/https开头为URL,否则为本地路径) | |
| normalized | No | 坐标是否为0-1归一化值。false表示像素坐标,true表示归一化坐标。 | |
| output_path | No | 可选:输出图片保存的文件路径。无论是否设置,图片都会以base64返回。 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| width | Yes | ||
| format | Yes | ||
| height | Yes | ||
| size_bytes | Yes |