From b48b5b6e7c2943965d9ae7370485fd85081e4dbe Mon Sep 17 00:00:00 2001 From: Kshitij Sisodia Date: Wed, 29 Dec 2021 14:32:58 +0000 Subject: MLECO-2816: Trivial fix for inference runner output. Aligning with output from other use cases, inference runner output now prints the number of inferences as one. Change-Id: Ifc03385a5de86477508fe8c377d481b7140a8429 Signed-off-by: Kshitij Sisodia --- source/application/main/UseCaseCommonUtils.cc | 18 ++++++++---------- source/use_case/inference_runner/src/UseCaseHandler.cc | 1 + 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/source/application/main/UseCaseCommonUtils.cc b/source/application/main/UseCaseCommonUtils.cc index 0b4e779..becfc93 100644 --- a/source/application/main/UseCaseCommonUtils.cc +++ b/source/application/main/UseCaseCommonUtils.cc @@ -58,10 +58,11 @@ bool image::PresentInferenceResult(hal_platform &platform, } -bool image::PresentInferenceResult(hal_platform &platform, - const std::vector &results, - bool profilingEnabled, - const time_t infTimeMs) +bool image::PresentInferenceResult( + hal_platform &platform, + const std::vector &results, + bool profilingEnabled, + const time_t infTimeMs) { constexpr uint32_t dataPsnTxtStartX1 = 150; constexpr uint32_t dataPsnTxtStartY1 = 30; @@ -71,15 +72,13 @@ bool image::PresentInferenceResult(hal_platform &platform, constexpr uint32_t dataPsnTxtYIncr = 16; /* Row index increment. */ - if(profilingEnabled) - { + if (profilingEnabled) { platform.data_psn->set_text_color(COLOR_YELLOW); /* If profiling is enabled, and the time is valid. */ info("Final results:\n"); info("Total number of inferences: 1\n"); - if (infTimeMs) - { + if (infTimeMs) { std::string strInf = std::string{"Inference: "} + std::to_string(infTimeMs) + @@ -95,8 +94,7 @@ bool image::PresentInferenceResult(hal_platform &platform, uint32_t rowIdx1 = dataPsnTxtStartY1 + 2 * dataPsnTxtYIncr; uint32_t rowIdx2 = dataPsnTxtStartY2; - if(!profilingEnabled) - { + if (!profilingEnabled) { info("Final results:\n"); info("Total number of inferences: 1\n"); } diff --git a/source/use_case/inference_runner/src/UseCaseHandler.cc b/source/use_case/inference_runner/src/UseCaseHandler.cc index 66b7042..78d99b0 100644 --- a/source/use_case/inference_runner/src/UseCaseHandler.cc +++ b/source/use_case/inference_runner/src/UseCaseHandler.cc @@ -157,6 +157,7 @@ bool RunInferenceHandler(ApplicationContext& ctx) dataPsnTxtInfStartX, dataPsnTxtInfStartY, 0); info("Final results:\n"); + info("Total number of inferences: 1\n"); profiler.PrintProfilingResult(); #if VERIFY_TEST_OUTPUT -- cgit v1.2.1