testSsdGenerateAnchors function

  1. @visibleForTesting
Float32List testSsdGenerateAnchors(
  1. SSDAnchorOptions opts
)

Test-only: flattens generated SSD anchors into a Float32List for unit tests.

Implementation

@visibleForTesting
Float32List testSsdGenerateAnchors(SSDAnchorOptions opts) {
  final anchors = generateAnchors(opts);
  final result = Float32List(anchors.length * 2);
  for (int i = 0; i < anchors.length; i++) {
    result[i * 2] = anchors[i][0];
    result[i * 2 + 1] = anchors[i][1];
  }
  return result;
}