Nodes/comfyui_cv/CV BBoxes To Array
ComfyUI Node

CV BBoxes To Array

Reads a BOUNDING_BOX value as plain arrays - the numeric bridge OUT of the detection world. Every detector emits dicts, so their coordinates and their score/label keys cannot be sorted, thresholded, measured or plotted; this node exposes them as NPARRAY, which the whole of points.py, contours.py, the charts and the raw cv2 wrappers accept. Works on any emitter: this pack's own nodes, core 'RT-DETR' / SAM3 / MediaPipe / 'Bounding Box', hand-authored boxes. 'CV Array To BBoxes' is the return leg. Empty input yields empty arrays and never raises.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV BBoxes To Array
  • bboxes
  • boxes
  • scores
  • label_ids
  • labels
  • group_index
  • count
layoutx, y, width, height
Categoryimage/CV

Inputs (2)

NameTypeDefaultDescription
bboxesBOUNDING_BOX[object Object]Core BOUNDING_BOX data: per-frame lists of {x, y, width, height} dicts - compatible with Draw BBoxes, Crop By Bounding Boxes, Image Crop, etc. A single dict, a flat list or per-frame nested lists are all accepted; the frame each box came from is reported in 'group_index'.
layoutoptCOMBOx, y, width, heightColumn layout of the array. 'x, y, width, height' is OpenCV's own convention (and BOUNDING_BOX's); 'x1, y1, x2, y2' is the corner form most DNN heads and torchvision use; 'center x, center y, width, height' is the YOLO form. Only the ARRAY side changes - BOUNDING_BOX is always {x, y, width, height}.

Outputs (6)

NameTypeDescription
boxesNPARRAY(N,4) float32, one row per box in the chosen layout, in the order the boxes appear (frame by frame). Cast it with 'CV Cast Array' if a consumer wants int32.
scoresNPARRAY(N,) float32 confidence, from each box's 'score' key. Boxes with no score read as 1.0, so a threshold never silently drops un-scored boxes. float32 like every other score in this pack, so a round trip through 'CV Array To BBoxes' keeps ~7 digits, not all 17.
label_idsNPARRAY(N,) int32 index into 'labels'. Boxes with no label all share index 0. Feed it to 'CV NMS Boxes' for per-class suppression.
labelsSTRINGThe distinct label names, one per line, indexed by 'label_ids' - the same shape 'Load Labels' produces.
group_indexNPARRAY(N,) int32: which per-frame GROUP each row came from. Pass it back to 'CV Array To BBoxes' to restore the original nesting.
countINTTotal number of boxes (rows).