From 1172fc6038352303b0801ef525235e27f3404c6d Mon Sep 17 00:00:00 2001 From: Kris Date: Thu, 9 Mar 2023 15:42:37 +0800 Subject: [PATCH] update usage of himax tflm sdk --- Makefile | 5 ++++- examples/handwriting/himax_we1_evb/image_provider.cc | 4 ++++ examples/person_detection/himax_we1_evb/image_provider.cc | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b965924..d6e45cb 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ LIB_LOC = third_party/ LIB_NAME = lib.zip THIRD_PARTY_LIB_NAME = third_party_lib_v04 -SDK_LINK = https://www.himax.com.tw/we-i/himax_we1_sdk_v20.zip +SDK_LINK = https://www.himax.com.tw/we-i/himax_we1_sdk_v21.zip SDK_LOC = . SDK_NAME = sdk.zip @@ -349,6 +349,7 @@ CCFLAGS+= \ -I./third_party/kissfft/tools LDFLAGS+= \ +-buildlib \ $(MLI_PATH)/libmli.a \ -Hheap=8192 \ -Hnocopyr \ @@ -364,6 +365,7 @@ $(SDK_PATH)/liblibcommon.a \ $(SDK_PATH)/liblibaudio.a \ $(SDK_PATH)/liblibsecurity.a \ $(SDK_PATH)/liblibsensordp.a \ +$(SDK_PATH)/liblibclib.a \ $(SDK_PATH)/liblibtflm.a else ifeq ($(ARC_TOOLCHAIN), gnu) @@ -456,6 +458,7 @@ $(SDK_PATH)/liblibcommon.a \ $(SDK_PATH)/liblibaudio.a \ $(SDK_PATH)/liblibsecurity.a \ $(SDK_PATH)/liblibsensordp.a \ +$(SDK_PATH)/liblibclib.a \ $(SDK_PATH)/liblibtflm.a \ -Wl,--end-group endif # ARC_TOOLCHAIN diff --git a/examples/handwriting/himax_we1_evb/image_provider.cc b/examples/handwriting/himax_we1_evb/image_provider.cc index 8666f8d..eddcee4 100644 --- a/examples/handwriting/himax_we1_evb/image_provider.cc +++ b/examples/handwriting/himax_we1_evb/image_provider.cc @@ -27,6 +27,10 @@ TfLiteStatus GetImage(tflite::ErrorReporter* error_reporter, int image_width, static bool is_initialized = false; if (!is_initialized) { + g_pimg_config.sensor_type = HX_DRV_SENSOR_TYPE_HM0360_MONO; + g_pimg_config.format = HX_DRV_VIDEO_FORMAT_YUV400; + g_pimg_config.img_width = 640; + g_pimg_config.img_height = 480; if (hx_drv_sensor_initial(&g_pimg_config) != HX_DRV_LIB_PASS) { return kTfLiteError; } diff --git a/examples/person_detection/himax_we1_evb/image_provider.cc b/examples/person_detection/himax_we1_evb/image_provider.cc index 3cf754f..0f03911 100644 --- a/examples/person_detection/himax_we1_evb/image_provider.cc +++ b/examples/person_detection/himax_we1_evb/image_provider.cc @@ -31,6 +31,10 @@ TfLiteStatus GetImage(tflite::ErrorReporter* error_reporter, int image_width, static bool is_initialized = false; if (!is_initialized) { + g_pimg_config.sensor_type = HX_DRV_SENSOR_TYPE_HM0360_MONO; + g_pimg_config.format = HX_DRV_VIDEO_FORMAT_YUV400; + g_pimg_config.img_width = 640; + g_pimg_config.img_height = 480; if (hx_drv_sensor_initial(&g_pimg_config) != HX_DRV_LIB_PASS) { return kTfLiteError; }