decodeAndSplitOutputs function

List<Map<String, dynamic>> decodeAndSplitOutputs(
  1. List outputs
)

Decodes raw detection model outputs and splits each row into xywh, rest, and C.

Returns a list of maps with keys:

  • xywh: first 4 values (bounding box center-xy + width/height)
  • rest: remaining values (objectness + class logits)
  • C: total number of channels in the row

Implementation

List<Map<String, dynamic>> decodeAndSplitOutputs(List<dynamic> outputs) {
  final List<List<double>> out = decodeDetectionOutputs(outputs);
  final int channels = out[0].length;
  return out
      .map(
        (row) => {
          'xywh': row.sublist(0, 4),
          'rest': row.sublist(4),
          'C': channels,
        },
      )
      .toList();
}