convertToDetections function

List<Detection> convertToDetections(
  1. List<double> rawBoxes,
  2. List<Anchor> anchors,
  3. List<double> detectionScores,
  4. List<int> detectionClasses,
  5. OptionsFace options,
)

Implementation

List<Detection> convertToDetections(
    List<double> rawBoxes,
    List<Anchor> anchors,
    List<double> detectionScores,
    List<int> detectionClasses,
    OptionsFace options) {
  var _outputDetections = <Detection>[];
  for (var i = 0; i < options.numBoxes; i++) {
    if (detectionScores[i] < options.minScoreThresh) continue;
    var boxOffset = 0;
    var boxData = decodeBox(rawBoxes, i, anchors, options);

    var detection = convertToDetection(
        boxData[boxOffset + 0],
        boxData[boxOffset + 1],
        boxData[boxOffset + 2],
        boxData[boxOffset + 3],
        detectionScores[i],
        detectionClasses[i],
        options.flipVertically);
    _outputDetections.add(detection);
  }
  return _outputDetections;
}