From 9b8d67a5389db4afeeb22c9c705252ba7f6f5915 Mon Sep 17 00:00:00 2001 From: Richard Burton Date: Fri, 10 Dec 2021 12:32:51 +0000 Subject: MLECO-2684: Standardize LCD behaviour * LCD display behavior for Run All now matches Run Next * Remove repeated code Signed-off-by: Richard Burton Change-Id: I16706187fd4e7a59dd935783f5bfb8731435f381 --- source/application/main/UseCaseCommonUtils.cc | 14 +++----------- source/use_case/ad/src/UseCaseHandler.cc | 4 ++-- source/use_case/asr/src/UseCaseHandler.cc | 2 ++ source/use_case/img_class/src/UseCaseHandler.cc | 4 ++-- source/use_case/kws/src/UseCaseHandler.cc | 4 ++-- source/use_case/noise_reduction/src/UseCaseHandler.cc | 6 +++--- source/use_case/vww/src/UseCaseHandler.cc | 3 +-- 7 files changed, 15 insertions(+), 22 deletions(-) diff --git a/source/application/main/UseCaseCommonUtils.cc b/source/application/main/UseCaseCommonUtils.cc index e48e308..0b4e779 100644 --- a/source/application/main/UseCaseCommonUtils.cc +++ b/source/application/main/UseCaseCommonUtils.cc @@ -118,17 +118,9 @@ bool image::PresentInferenceResult(hal_platform &platform, dataPsnTxtStartX2, rowIdx2, 0); rowIdx2 += dataPsnTxtYIncr; - if(profilingEnabled) - { - info("%" PRIu32 ") %" PRIu32 " (%f) -> %s\n", i, results[i].m_labelIdx, - results[i].m_normalisedVal, results[i].m_label.c_str()); - } - else - { - info("%" PRIu32 ") %" PRIu32 " (%f) -> %s\n", i, - results[i].m_labelIdx, results[i].m_normalisedVal, - results[i].m_label.c_str()); - } + info("%" PRIu32 ") %" PRIu32 " (%f) -> %s\n", i, + results[i].m_labelIdx, results[i].m_normalisedVal, + results[i].m_label.c_str()); } return true; diff --git a/source/use_case/ad/src/UseCaseHandler.cc b/source/use_case/ad/src/UseCaseHandler.cc index b20b63e..bc6ec7a 100644 --- a/source/use_case/ad/src/UseCaseHandler.cc +++ b/source/use_case/ad/src/UseCaseHandler.cc @@ -68,8 +68,6 @@ namespace app { constexpr uint32_t dataPsnTxtInfStartX = 20; constexpr uint32_t dataPsnTxtInfStartY = 40; - platform.data_psn->clear(COLOR_BLACK); - auto& model = ctx.Get("model"); /* If the request has a valid size, set the audio index */ @@ -114,6 +112,8 @@ namespace app { auto audioDataStride = nMelSpecVectorsInAudioStride * frameStride; do { + platform.data_psn->clear(COLOR_BLACK); + auto currentIndex = ctx.Get("clipIndex"); /* Get the output index to look at based on id in the filename. */ diff --git a/source/use_case/asr/src/UseCaseHandler.cc b/source/use_case/asr/src/UseCaseHandler.cc index d469255..f13de0d 100644 --- a/source/use_case/asr/src/UseCaseHandler.cc +++ b/source/use_case/asr/src/UseCaseHandler.cc @@ -101,6 +101,8 @@ namespace app { /* Loop to process audio clips. */ do { + platform.data_psn->clear(COLOR_BLACK); + /* Get current audio clip index. */ auto currentIndex = ctx.Get("clipIndex"); diff --git a/source/use_case/img_class/src/UseCaseHandler.cc b/source/use_case/img_class/src/UseCaseHandler.cc index effc06f..3812d81 100644 --- a/source/use_case/img_class/src/UseCaseHandler.cc +++ b/source/use_case/img_class/src/UseCaseHandler.cc @@ -52,8 +52,6 @@ namespace app { constexpr uint32_t dataPsnTxtInfStartX = 150; constexpr uint32_t dataPsnTxtInfStartY = 40; - platform.data_psn->clear(COLOR_BLACK); - auto& model = ctx.Get("model"); /* If the request has a valid size, set the image index. */ @@ -89,6 +87,8 @@ namespace app { std::vector results; do { + platform.data_psn->clear(COLOR_BLACK); + /* Strings for presentation/logging. */ std::string str_inf{"Running inference... "}; diff --git a/source/use_case/kws/src/UseCaseHandler.cc b/source/use_case/kws/src/UseCaseHandler.cc index a951e55..3d95753 100644 --- a/source/use_case/kws/src/UseCaseHandler.cc +++ b/source/use_case/kws/src/UseCaseHandler.cc @@ -75,8 +75,6 @@ namespace app { (arm::app::DsCnnModel::ms_inputRowsIdx > arm::app::DsCnnModel::ms_inputColsIdx)? arm::app::DsCnnModel::ms_inputRowsIdx : arm::app::DsCnnModel::ms_inputColsIdx); - platform.data_psn->clear(COLOR_BLACK); - auto& model = ctx.Get("model"); /* If the request has a valid size, set the audio index. */ @@ -137,6 +135,8 @@ namespace app { const float secondsPerSample = 1.0/audio::DsCnnMFCC::ms_defaultSamplingFreq; do { + platform.data_psn->clear(COLOR_BLACK); + auto currentIndex = ctx.Get("clipIndex"); /* Creating a mfcc features sliding window for the data required for 1 inference. */ diff --git a/source/use_case/noise_reduction/src/UseCaseHandler.cc b/source/use_case/noise_reduction/src/UseCaseHandler.cc index 4934abb..12b4ab3 100644 --- a/source/use_case/noise_reduction/src/UseCaseHandler.cc +++ b/source/use_case/noise_reduction/src/UseCaseHandler.cc @@ -64,8 +64,6 @@ namespace app { std::reference_wrapper memDumpBytesWritten = std::ref(*pMemDumpBytesWritten); auto& platform = ctx.Get("platform"); - platform.data_psn->clear(COLOR_BLACK); - auto& profiler = ctx.Get("profiler"); /* Get model reference. */ @@ -106,6 +104,8 @@ namespace app { audioFileAccessorFunc = ctx.Get>("featureFileNames"); } do{ + platform.data_psn->clear(COLOR_BLACK); + auto startDumpAddress = memDumpBaseAddr + memDumpBytesWritten; auto currentIndex = ctx.Get("clipIndex"); @@ -211,7 +211,7 @@ namespace app { DumpDenoisedAudioFooter(memDumpBaseAddr + memDumpBytesWritten, memDumpMaxLen - memDumpBytesWritten); - info("Final results:\n"); + info("All inferences for audio clip complete.\n"); profiler.PrintProfilingResult(); IncrementAppCtxClipIdx(ctx); diff --git a/source/use_case/vww/src/UseCaseHandler.cc b/source/use_case/vww/src/UseCaseHandler.cc index d384032..8165bb0 100644 --- a/source/use_case/vww/src/UseCaseHandler.cc +++ b/source/use_case/vww/src/UseCaseHandler.cc @@ -50,8 +50,6 @@ namespace app { constexpr uint32_t dataPsnTxtInfStartX = 150; constexpr uint32_t dataPsnTxtInfStartY = 70; - - platform.data_psn->clear(COLOR_BLACK); time_t infTimeMs = 0; auto& model = ctx.Get("model"); @@ -87,6 +85,7 @@ namespace app { std::vector results; do { + platform.data_psn->clear(COLOR_BLACK); /* Strings for presentation/logging. */ std::string str_inf{"Running inference... "}; -- cgit v1.2.1