Skip to content

Instantly share code, notes, and snippets.

@truongsinh
Created September 19, 2019 00:47
Show Gist options
  • Save truongsinh/20d49cd72c134d96d809dc07d8e6fcf3 to your computer and use it in GitHub Desktop.
Save truongsinh/20d49cd72c134d96d809dc07d8e6fcf3 to your computer and use it in GitHub Desktop.
combine to a single new list
// ...
final List<DetectionResult> results = List();
for (var index = 0; index < numDetections; index++) {
String detectedClass = localLabels[outputClasses[index].toInt()];
// final top // explain shortly after
// final left // explain shortly after
// final bottom // explain shortly after
// final right // explain shortly after
final thisSesult = DetectionResult(
rect: Rect.fromLTRB(left, top, right, bottom),
confidenceInClass: outputScores[index],
detectedClass: detectedClass,
);
results.add(thisSesult);
}
return results;
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment