Skip to content

Instantly share code, notes, and snippets.

@truongsinh
Created September 19, 2019 00:49
Show Gist options
  • Save truongsinh/048eda34d452ac03b65c60f574b93a48 to your computer and use it in GitHub Desktop.
Save truongsinh/048eda34d452ac03b65c60f574b93a48 to your computer and use it in GitHub Desktop.
get detection result list
for (var index = 0; index < numDetections; index++) {
String detectedClass = localLabels[outputClasses[index].toInt()];
final top = max(0.0, outputLocations[index * 4 + 0]);
final left = max(0.0, outputLocations[index * 4 + 1]);
final bottom = min(1.0, outputLocations[index * 4 + 2]);
final right = min(1.0, outputLocations[index * 4 + 3]);
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