MLECO-3189: Object detection keeps all detections
* Clear vector before each inference to make sure there are no leftover
results when running all inferences.
Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com>
Change-Id: If2417364151d7f380c3311447b10f971a5475f9e
diff --git a/source/use_case/object_detection/src/UseCaseHandler.cc b/source/use_case/object_detection/src/UseCaseHandler.cc
index 332d199..4d0877a 100644
--- a/source/use_case/object_detection/src/UseCaseHandler.cc
+++ b/source/use_case/object_detection/src/UseCaseHandler.cc
@@ -102,6 +102,9 @@
DetectorPostProcess postProcess = DetectorPostProcess(outputTensor0, outputTensor1,
results, inputImgRows, inputImgCols);
do {
+ /* Ensure there are no results leftover from previous inference when running all. */
+ results.clear();
+
/* Strings for presentation/logging. */
std::string str_inf{"Running inference... "};