From 0bc74e9674eb161342fabd0ba83c4c87b45ecd84 Mon Sep 17 00:00:00 2001 From: Matthew Sloyan Date: Tue, 10 May 2022 13:21:01 +0100 Subject: 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 Change-Id: If2417364151d7f380c3311447b10f971a5475f9e --- source/use_case/object_detection/src/UseCaseHandler.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source') 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 @@ namespace app { 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... "}; -- cgit v1.2.1