diff options
author | Liam Barry <liam.barry@arm.com> | 2022-01-25 14:31:15 +0000 |
---|---|---|
committer | Liam Barry <liam.barry@arm.com> | 2022-01-25 16:25:17 +0000 |
commit | e958850d7672cd81a5eb48285a2df94b8f0595f0 (patch) | |
tree | 98628d840e5b1d6e96f38d31678e0cb8318d15f7 /source/application | |
parent | ee98bd6f41fc78e3f87c61b5c62f2b07bf8b817a (diff) | |
download | ml-embedded-evaluation-kit-e958850d7672cd81a5eb48285a2df94b8f0595f0.tar.gz |
MLECO-2872 Minor improvement to CommonUseCaseUtils
Replaced overloaded PresentInferenceresults with single function and removed
logic to handle arguments which are no longer passed.
Change-Id: I745271638fcf78b7121c2a4b95844b752643bac2
Signed-off-by: Liam Barry <liam.barry@arm.com>
Diffstat (limited to 'source/application')
-rw-r--r-- | source/application/main/UseCaseCommonUtils.cc | 41 | ||||
-rw-r--r-- | source/application/main/include/UseCaseCommonUtils.hpp | 28 |
2 files changed, 5 insertions, 64 deletions
diff --git a/source/application/main/UseCaseCommonUtils.cc b/source/application/main/UseCaseCommonUtils.cc index becfc93..d740d10 100644 --- a/source/application/main/UseCaseCommonUtils.cc +++ b/source/application/main/UseCaseCommonUtils.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Arm Limited. All rights reserved. + * Copyright (c) 2021-2022 Arm Limited. All rights reserved. * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -44,25 +44,10 @@ void image::ConvertImgToInt8(void* data, const size_t kMaxImageSize) } } -bool image::PresentInferenceResult(hal_platform& platform, - const std::vector<arm::app::ClassificationResult>& results) -{ - return PresentInferenceResult(platform, results, false); -} - -bool image::PresentInferenceResult(hal_platform &platform, - const std::vector<arm::app::ClassificationResult> &results, - const time_t infTimeMs) -{ - return PresentInferenceResult(platform, results, true, infTimeMs); -} - bool image::PresentInferenceResult( hal_platform &platform, - const std::vector<arm::app::ClassificationResult> &results, - bool profilingEnabled, - const time_t infTimeMs) + const std::vector<arm::app::ClassificationResult> &results) { constexpr uint32_t dataPsnTxtStartX1 = 150; constexpr uint32_t dataPsnTxtStartY1 = 30; @@ -72,32 +57,14 @@ bool image::PresentInferenceResult( constexpr uint32_t dataPsnTxtYIncr = 16; /* Row index increment. */ - 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) { - std::string strInf = - std::string{"Inference: "} + - std::to_string(infTimeMs) + - std::string{"ms"}; - platform.data_psn->present_data_text( - strInf.c_str(), strInf.size(), - dataPsnTxtStartX1, dataPsnTxtStartY1, 0); - } - } platform.data_psn->set_text_color(COLOR_GREEN); /* Display each result. */ uint32_t rowIdx1 = dataPsnTxtStartY1 + 2 * dataPsnTxtYIncr; uint32_t rowIdx2 = dataPsnTxtStartY2; - if (!profilingEnabled) { - info("Final results:\n"); - info("Total number of inferences: 1\n"); - } + info("Final results:\n"); + info("Total number of inferences: 1\n"); for (uint32_t i = 0; i < results.size(); ++i) { std::string resultStr = diff --git a/source/application/main/include/UseCaseCommonUtils.hpp b/source/application/main/include/UseCaseCommonUtils.hpp index a3b606d..c91dc4a 100644 --- a/source/application/main/include/UseCaseCommonUtils.hpp +++ b/source/application/main/include/UseCaseCommonUtils.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Arm Limited. All rights reserved. + * Copyright (c) 2021-2022 Arm Limited. All rights reserved. * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -57,32 +57,6 @@ namespace image{ **/ bool PresentInferenceResult(hal_platform & platform, const std::vector < arm::app::ClassificationResult > & results); - - - /** - * @brief Presents inference results along with the inference time using the data presentation - * object. - * @param[in] platform Reference to the hal platform object. - * @param[in] results Vector of classification results to be displayed. - * @param[in] results Inference time in ms. - * @return true if successful, false otherwise. - **/ - bool PresentInferenceResult(hal_platform & platform, - const std::vector < arm::app::ClassificationResult > & results, - const time_t infTimeMs); - - /** - * @brief Presents inference results along with the inference time using the data presentation - * object. - * @param[in] platform Reference to the hal platform object. - * @param[in] results Vector of classification results to be displayed. - * @param[in] results Inference time in ms. - * @return true if successful, false otherwise. - **/ - bool PresentInferenceResult(hal_platform & platform, - const std::vector < arm::app::ClassificationResult > & results, - bool profilingEnabled, - const time_t infTimeMs = 0); } /** |