summaryrefslogtreecommitdiff
path: root/source/use_case/img_class/src/UseCaseHandler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'source/use_case/img_class/src/UseCaseHandler.cc')
-rw-r--r--source/use_case/img_class/src/UseCaseHandler.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/source/use_case/img_class/src/UseCaseHandler.cc b/source/use_case/img_class/src/UseCaseHandler.cc
index 1f1d78b..9061282 100644
--- a/source/use_case/img_class/src/UseCaseHandler.cc
+++ b/source/use_case/img_class/src/UseCaseHandler.cc
@@ -44,7 +44,6 @@ namespace app {
/* Image inference classification handler. */
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;
@@ -89,7 +88,7 @@ namespace app {
std::vector<ClassificationResult> results;
do {
- platform.data_psn->clear(COLOR_BLACK);
+ hal_lcd_clear(COLOR_BLACK);
/* Strings for presentation/logging. */
std::string str_inf{"Running inference... "};
@@ -98,7 +97,7 @@ namespace app {
LoadImageIntoTensor(ctx.Get<uint32_t>("imgIndex"), inputTensor);
/* Display this image on the LCD. */
- platform.data_psn->present_data_image(
+ hal_lcd_display_image(
static_cast<uint8_t *>(inputTensor->data.data),
nCols, nRows, nChannels,
dataPsnImgStartX, dataPsnImgStartY, dataPsnImgDownscaleFactor);
@@ -109,7 +108,7 @@ namespace app {
}
/* Display message on the LCD - inference running. */
- platform.data_psn->present_data_text(str_inf.c_str(), str_inf.size(),
+ hal_lcd_display_text(str_inf.c_str(), str_inf.size(),
dataPsnTxtInfStartX, dataPsnTxtInfStartY, false);
/* Run inference over this image. */
@@ -122,7 +121,7 @@ namespace app {
/* Erase. */
str_inf = std::string(str_inf.size(), ' ');
- platform.data_psn->present_data_text(str_inf.c_str(), str_inf.size(),
+ hal_lcd_display_text(str_inf.c_str(), str_inf.size(),
dataPsnTxtInfStartX, dataPsnTxtInfStartY, false);
auto& classifier = ctx.Get<ImgClassClassifier&>("classifier");
@@ -137,7 +136,7 @@ namespace app {
arm::app::DumpTensor(outputTensor);
#endif /* VERIFY_TEST_OUTPUT */
- if (!PresentInferenceResult(platform, results)) {
+ if (!PresentInferenceResult(results)) {
return false;
}