summaryrefslogtreecommitdiff
path: root/source/use_case/img_class/src/UseCaseHandler.cc
diff options
context:
space:
mode:
authorIsabella Gottardi <isabella.gottardi@arm.com>2021-04-07 17:15:31 +0100
committerAlexander Efremov <alexander.efremov@arm.com>2021-04-12 14:00:49 +0000
commit8df12f37531d57a10cba2f8b2e8b6a9065202dd5 (patch)
treeba833d15649c3b0f885d57b40d3916970b3fd2c8 /source/use_case/img_class/src/UseCaseHandler.cc
parent37ce22ebc9cf3e8529d9914c0eed0f718243d961 (diff)
downloadml-embedded-evaluation-kit-8df12f37531d57a10cba2f8b2e8b6a9065202dd5.tar.gz
MLECO-1870: Cherry pick profiling changes from dev to open source repo
* Documentation update Change-Id: If85e7ebc44498840b291c408f14e66a5a5faa424 Signed-off-by: Isabella Gottardi <isabella.gottardi@arm.com>
Diffstat (limited to 'source/use_case/img_class/src/UseCaseHandler.cc')
-rw-r--r--source/use_case/img_class/src/UseCaseHandler.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/use_case/img_class/src/UseCaseHandler.cc b/source/use_case/img_class/src/UseCaseHandler.cc
index a412fec..f7e83f5 100644
--- a/source/use_case/img_class/src/UseCaseHandler.cc
+++ b/source/use_case/img_class/src/UseCaseHandler.cc
@@ -74,6 +74,7 @@ namespace app {
bool ClassifyImageHandler(ApplicationContext& ctx, uint32_t imgIndex, bool runAll)
{
auto& platform = ctx.Get<hal_platform&>("platform");
+ auto& profiler = ctx.Get<Profiler&>("profiler");
constexpr uint32_t dataPsnImgDownscaleFactor = 2;
constexpr uint32_t dataPsnImgStartX = 10;
@@ -144,7 +145,7 @@ namespace app {
info("Running inference on image %u => %s\n", ctx.Get<uint32_t>("imgIndex"),
get_filename(ctx.Get<uint32_t>("imgIndex")));
- RunInference(platform, model);
+ RunInference(model, profiler);
/* Erase. */
str_inf = std::string(str_inf.size(), ' ');
@@ -167,6 +168,8 @@ namespace app {
return false;
}
+ profiler.PrintProfilingResult();
+
_IncrementAppCtxImageIdx(ctx);
} while (runAll && ctx.Get<uint32_t>("imgIndex") != curImIdx);
@@ -230,6 +233,8 @@ namespace app {
uint32_t rowIdx1 = dataPsnTxtStartY1 + 2 * dataPsnTxtYIncr;
uint32_t rowIdx2 = dataPsnTxtStartY2;
+ info("Final results:\n");
+ info("Total number of inferences: 1\n");
for (uint32_t i = 0; i < results.size(); ++i) {
std::string resultStr =
std::to_string(i + 1) + ") " +