yolov5-detect-results
All format examples · Machine-readable schema · Convert outputs to COCO
One-image batch inside Python Detections. Outer lists index images, inner lists index detections. These properties describe the same box in different conventions, not additional detections. Real names mappings can use integer keys.
Example
Illustrative values, not predictions from a model. Unless stated otherwise, the image is 200 pixels wide and 100 pixels high.
Readable projection: arrays and objects below illustrate the contents. The author returns Python objects/tensors or files, rather than this JSON document.
{
"files": ["frame.jpg"],
"names": {
"0": "insect"
},
"pred": [
[
[10, 20, 50, 60, 0.8, 0]
]
],
"xywh": [
[
[30, 40, 40, 40, 0.8, 0]
]
],
"xywhn": [
[
[0.15, 0.4, 0.2, 0.4, 0.8, 0]
]
],
"xyxy": [
[
[10, 20, 50, 60, 0.8, 0]
]
],
"xyxyn": [
[
[0.05, 0.2, 0.25, 0.6, 0.8, 0]
]
]
}Convert to a standard format
This format is documented, but a conversion adapter is not yet registered.
General conversion example and required context
How to interpret it
Scope: Relevant fields of Detections; one tensor per image, not a JSON object. This is the AutoShape wrapper output, not the raw network forward output.
Columns: All rows end in confidence, class. pred and xyxy begin x1,y1,x2,y2 in original pixels. xywh begins center_x,center_y,width,height in pixels. The n-suffixed views divide x/width by image width and y/height by image height.
Empty: An image without detections has a zero-row tensor, not a missing batch entry.
Representation: Nested arrays describe the batch list and per-image tensor rows. They do not indicate JSON serialization. names is a class-index dictionary or an index-ordered list of class names, depending on the loaded model.