outputsToNMSPredictions method
Implementation
List<ResultObjectDetection> outputsToNMSPredictions(List<double> outputs) {
DateTime startTime = DateTime.now(); // Record the start time
List<ResultObjectDetection> predictions;
if (objectDetectionModelType == ObjectDetectionModelType.yolov5) {
predictions = outputsToNMSPredictionsYolov5(outputs);
} else {
predictions = outputsToNMSPredictionsYoloV8(outputs);
}
DateTime endTime = DateTime.now(); // Record the end time
int executionTime = endTime
.difference(startTime)
.inMilliseconds; // Calculate the execution time in milliseconds
print(
" outputsToNMSPredictions: Execution time: $executionTime milliseconds");
return predictions;
}