CV YOLO Detect Decode
Unwraps a YOLO-family detection head into bounding boxes, scores, class ids and labels - WITHOUT any mask handling, so detection-only models work too (chain 'CV YOLO Seg Masks' for instance segmentation). The 'layout' dropdown covers the common head formats: 'rows: xyxy + conf + class id' for NMS-free end-to-end heads (yolo26/yolov11, rows [x1, y1, x2, y2, conf, class_id, ...] in letterboxed pixels, any extra columns pass through to det_rows for the mask stage); 'rows/''columns: xywh center + class scores' for yolov5/v8 heads (per-class score columns, cxcywh boxes, NMS applied); 'separate boxes + confs' for yolov4-style ONNX exports (normalized xyxy boxes (1, N, 1, 4) in 'det' + per-class confidences (1, N, C) wired to 'confs', NMS applied). Boxes are un-letterboxed back to the original image. DATA only - draw with the core 'Draw BBoxes' node. Zero detections is a valid result (found=false, empty outputs). Processes a single image (the first frame of a batch).
- det
- image
- confs
- bboxes
- scores
- class_ids
- labels_out
- det_rows
- det_count
- found
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| det | NPARRAY | Detection head output. Shape depends on 'layout': (1, N, 6+C)/(N, 6+C) rows for the NMS-free layout, (N, 4+C) or (1, 4+C, N) for the class-scores layouts, (1, N, 1, 4) normalized xyxy for the separate-boxes layout. | |
| image | NPARRAY,IMAGE | The ORIGINAL image (before letterboxing) - its size is the bbox target size. An IMAGE batch uses its first frame. Accepts a ComfyUI IMAGE/MASK directly (frame 0 of a batch) or an NPARRAY. Arithmetic ops (add, multiply, etc.) process the full IMAGE batch when both inputs have the same batch size. | |
| ratio | FLOAT | 1.0000.000001–100 | Letterbox resize ratio from 'CV DNN Letterbox' (1.0 if the image was not letterboxed). |
| pad_left | INT | 00–4096 | Letterbox left padding from 'CV DNN Letterbox'. |
| pad_top | INT | 00–4096 | Letterbox top padding from 'CV DNN Letterbox'. |
| net_size | INT | 64032–4096 | Square letterboxed input size the model ran at. Only used by the 'separate boxes + confs' layout, whose boxes are normalized to [0, 1] of it. |
| conf_threshold | FLOAT | 0.500–1 | Minimum confidence to keep a detection. Lower detects more (and more false positives). |
| layout | COMBO | rows: xyxy + conf + class id (NMS-free) | The detection head's row/column format (see the node description). |
| confsopt | NPARRAY | Per-class confidence tensor (1, N, C) - REQUIRED for the 'separate boxes + confs' layout, ignored otherwise. | |
| nms_thresholdopt | FLOAT | 0.450–1 | Non-maximum suppression IoU, used by the NMS layouts: boxes overlapping by more than this are merged. |
| labelsopt | STRING | Class names, one per line (line N = class id N), e.g. from 'CV Load Labels'. Blank = detections are labelled by their numeric class id. |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| bboxes | BOUNDING_BOX | One {x, y, width, height, score, label} dict per detection in ORIGINAL-image pixels - feed the core 'Draw BBoxes' node. |
| scores | NPARRAY | (N,) float32 confidence per detection, same order as bboxes. |
| class_ids | NPARRAY | (N,) int32 class id per detection, same order as bboxes. |
| labels_out | NPARRAY | (N,) string array of the class label per detection (the name from 'labels', or the numeric id). Feed 'Preview as Text'. |
| det_rows | NPARRAY | (N, 6+K) float32 kept rows in LETTERBOXED pixels [x1, y1, x2, y2, conf, class_id, ...extra columns from the head - the NMS-free seg layout's mask coefficients ride along here]. Feed 'CV YOLO Seg Masks'. Empty (0, 6) when nothing is detected. |
| det_count | INT | Number of detections kept. |
| found | BOOLEAN | True when at least one detection passed the confidence threshold. Feed an 'if/else' node to skip downstream visualization when empty. |