diff options
author | Richard Burton <richard.burton@arm.com> | 2021-12-10 12:32:51 +0000 |
---|---|---|
committer | Richard <richard.burton@arm.com> | 2021-12-10 12:53:03 +0000 |
commit | 9b8d67a5389db4afeeb22c9c705252ba7f6f5915 (patch) | |
tree | 88a1e1ac5bc42313b6478f70138237ae239afee3 /source | |
parent | 233cec0af9435f5352985dfeb8c27550e7bb2abb (diff) | |
download | ml-embedded-evaluation-kit-9b8d67a5389db4afeeb22c9c705252ba7f6f5915.tar.gz |
MLECO-2684: Standardize LCD behaviour
* LCD display behavior for Run All now matches Run Next
* Remove repeated code
Signed-off-by: Richard Burton <richard.burton@arm.com>
Change-Id: I16706187fd4e7a59dd935783f5bfb8731435f381
Diffstat (limited to 'source')
-rw-r--r-- | source/application/main/UseCaseCommonUtils.cc | 14 | ||||
-rw-r--r-- | source/use_case/ad/src/UseCaseHandler.cc | 4 | ||||
-rw-r--r-- | source/use_case/asr/src/UseCaseHandler.cc | 2 | ||||
-rw-r--r-- | source/use_case/img_class/src/UseCaseHandler.cc | 4 | ||||
-rw-r--r-- | source/use_case/kws/src/UseCaseHandler.cc | 4 | ||||
-rw-r--r-- | source/use_case/noise_reduction/src/UseCaseHandler.cc | 6 | ||||
-rw-r--r-- | 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&>("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<uint32_t>("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<uint32_t>("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&>("model"); /* If the request has a valid size, set the image index. */ @@ -89,6 +87,8 @@ namespace app { std::vector<ClassificationResult> 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&>("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<uint32_t>("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<size_t> memDumpBytesWritten = std::ref(*pMemDumpBytesWritten); auto& platform = ctx.Get<hal_platform&>("platform"); - platform.data_psn->clear(COLOR_BLACK); - auto& profiler = ctx.Get<Profiler&>("profiler"); /* Get model reference. */ @@ -106,6 +104,8 @@ namespace app { audioFileAccessorFunc = ctx.Get<std::function<const char*(const uint32_t)>>("featureFileNames"); } do{ + platform.data_psn->clear(COLOR_BLACK); + auto startDumpAddress = memDumpBaseAddr + memDumpBytesWritten; auto currentIndex = ctx.Get<uint32_t>("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&>("model"); @@ -87,6 +85,7 @@ namespace app { std::vector<ClassificationResult> results; do { + platform.data_psn->clear(COLOR_BLACK); /* Strings for presentation/logging. */ std::string str_inf{"Running inference... "}; |