From eedc5ec6f2a4cc9d661bc6cb87880fec6d8a3201 Mon Sep 17 00:00:00 2001 From: "CaptainDario @ MBP M1" Date: Thu, 20 Jun 2024 12:25:51 +0900 Subject: [PATCH 1/6] updated cmake for arm64 / x86 --- .../audio_classification/linux/CMakeLists.txt | 16 ++++++++++++++-- .../linux/CMakeLists.txt | 16 ++++++++++++++-- .../linux/CMakeLists.txt | 16 ++++++++++++++-- .../linux/CMakeLists.txt | 16 ++++++++++++++-- example/style_transfer/linux/CMakeLists.txt | 16 ++++++++++++++-- .../super_resolution_esrgan/linux/CMakeLists.txt | 16 ++++++++++++++-- example/text_classification/linux/CMakeLists.txt | 16 ++++++++++++++-- 7 files changed, 98 insertions(+), 14 deletions(-) diff --git a/example/audio_classification/linux/CMakeLists.txt b/example/audio_classification/linux/CMakeLists.txt index 2113bed..1dff681 100644 --- a/example/audio_classification/linux/CMakeLists.txt +++ b/example/audio_classification/linux/CMakeLists.txt @@ -138,7 +138,19 @@ if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") COMPONENT Runtime) endif() +# get tf lite binaries +message(STATUS "TF Lite detected processor architecture: ${CMAKE_SYSTEM_PROCESSOR}") +if(CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64") + set(TF_LITE_SO ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c_arm64.so) +elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + set(TF_LITE_SO ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c_x86.so) +endif() + install( - FILES ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c-linux.so - DESTINATION ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ + FILES + ${TF_LITE_SO} + DESTINATION + ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ + RENAME + libtensorflowlite_c.so ) \ No newline at end of file diff --git a/example/image_classification_mobilenet/linux/CMakeLists.txt b/example/image_classification_mobilenet/linux/CMakeLists.txt index b4ab441..3c14832 100644 --- a/example/image_classification_mobilenet/linux/CMakeLists.txt +++ b/example/image_classification_mobilenet/linux/CMakeLists.txt @@ -138,7 +138,19 @@ if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") COMPONENT Runtime) endif() +# get tf lite binaries +message(STATUS "TF Lite detected processor architecture: ${CMAKE_SYSTEM_PROCESSOR}") +if(CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64") + set(TF_LITE_SO ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c_arm64.so) +elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + set(TF_LITE_SO ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c_x86.so) +endif() + install( - FILES ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c-linux.so - DESTINATION ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ + FILES + ${TF_LITE_SO} + DESTINATION + ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ + RENAME + libtensorflowlite_c.so ) \ No newline at end of file diff --git a/example/live_object_detection_ssd_mobilenet/linux/CMakeLists.txt b/example/live_object_detection_ssd_mobilenet/linux/CMakeLists.txt index 38ecaa2..f7ff16c 100644 --- a/example/live_object_detection_ssd_mobilenet/linux/CMakeLists.txt +++ b/example/live_object_detection_ssd_mobilenet/linux/CMakeLists.txt @@ -138,7 +138,19 @@ if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") COMPONENT Runtime) endif() +# get tf lite binaries +message(STATUS "TF Lite detected processor architecture: ${CMAKE_SYSTEM_PROCESSOR}") +if(CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64") + set(TF_LITE_SO ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c_arm64.so) +elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + set(TF_LITE_SO ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c_x86.so) +endif() + install( - FILES ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c-linux.so - DESTINATION ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ + FILES + ${TF_LITE_SO} + DESTINATION + ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ + RENAME + libtensorflowlite_c.so ) \ No newline at end of file diff --git a/example/object_detection_ssd_mobilenet/linux/CMakeLists.txt b/example/object_detection_ssd_mobilenet/linux/CMakeLists.txt index deff719..8d15ec3 100644 --- a/example/object_detection_ssd_mobilenet/linux/CMakeLists.txt +++ b/example/object_detection_ssd_mobilenet/linux/CMakeLists.txt @@ -138,7 +138,19 @@ if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") COMPONENT Runtime) endif() +# get tf lite binaries +message(STATUS "TF Lite detected processor architecture: ${CMAKE_SYSTEM_PROCESSOR}") +if(CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64") + set(TF_LITE_SO ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c_arm64.so) +elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + set(TF_LITE_SO ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c_x86.so) +endif() + install( - FILES ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c-linux.so - DESTINATION ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ + FILES + ${TF_LITE_SO} + DESTINATION + ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ + RENAME + libtensorflowlite_c.so ) \ No newline at end of file diff --git a/example/style_transfer/linux/CMakeLists.txt b/example/style_transfer/linux/CMakeLists.txt index 769ead6..ce692b3 100644 --- a/example/style_transfer/linux/CMakeLists.txt +++ b/example/style_transfer/linux/CMakeLists.txt @@ -138,7 +138,19 @@ if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") COMPONENT Runtime) endif() +# get tf lite binaries +message(STATUS "TF Lite detected processor architecture: ${CMAKE_SYSTEM_PROCESSOR}") +if(CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64") + set(TF_LITE_SO ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c_arm64.so) +elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + set(TF_LITE_SO ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c_x86.so) +endif() + install( - FILES ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c-linux.so - DESTINATION ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ + FILES + ${TF_LITE_SO} + DESTINATION + ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ + RENAME + libtensorflowlite_c.so ) \ No newline at end of file diff --git a/example/super_resolution_esrgan/linux/CMakeLists.txt b/example/super_resolution_esrgan/linux/CMakeLists.txt index 436aa68..c43c24b 100644 --- a/example/super_resolution_esrgan/linux/CMakeLists.txt +++ b/example/super_resolution_esrgan/linux/CMakeLists.txt @@ -138,7 +138,19 @@ if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") COMPONENT Runtime) endif() +# get tf lite binaries +message(STATUS "TF Lite detected processor architecture: ${CMAKE_SYSTEM_PROCESSOR}") +if(CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64") + set(TF_LITE_SO ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c_arm64.so) +elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + set(TF_LITE_SO ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c_x86.so) +endif() + install( - FILES ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c-linux.so - DESTINATION ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ + FILES + ${TF_LITE_SO} + DESTINATION + ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ + RENAME + libtensorflowlite_c.so ) \ No newline at end of file diff --git a/example/text_classification/linux/CMakeLists.txt b/example/text_classification/linux/CMakeLists.txt index 1a5c5cb..ad63b1b 100644 --- a/example/text_classification/linux/CMakeLists.txt +++ b/example/text_classification/linux/CMakeLists.txt @@ -138,7 +138,19 @@ if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") COMPONENT Runtime) endif() +# get tf lite binaries +message(STATUS "TF Lite detected processor architecture: ${CMAKE_SYSTEM_PROCESSOR}") +if(CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64") + set(TF_LITE_SO ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c_arm64.so) +elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + set(TF_LITE_SO ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c_x86.so) +endif() + install( - FILES ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c-linux.so - DESTINATION ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ + FILES + ${TF_LITE_SO} + DESTINATION + ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ + RENAME + libtensorflowlite_c.so ) \ No newline at end of file From 433ae6d9866b7d5ef99a64967fe9c32003adf53b Mon Sep 17 00:00:00 2001 From: "CaptainDario @ MBP M1" Date: Thu, 20 Jun 2024 12:26:02 +0900 Subject: [PATCH 2/6] updated install instructions --- README.md | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9169399..7515be3 100644 --- a/README.md +++ b/README.md @@ -97,16 +97,30 @@ For this, first a `.so` needs to be built. You can follow the [Bazel build guide As a second step, the library needs to be added to your application's project. This is a simple procedure 1. Create a folder called `blobs` in the top level of your project -2. Copy the `libtensorflowlite_c-linux.so` to this folder -3. Append following lines to your `linux/CMakeLists.txt` +2. Copy the `libtensorflowlite_c.so` to this folder +3. Rename the file matching you architecture + 1. arm -> libtensorflowlite_c_arm64.so + 2. x86 -> libtensorflowlite_c_x86.so +4. Append following lines to your `linux/CMakeLists.txt` ``` Make ... # get tf lite binaries +message(STATUS "TF Lite detected processor architecture: ${CMAKE_SYSTEM_PROCESSOR}") +if(CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64") + set(TF_LITE_SO ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c_arm64.so) +elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + set(TF_LITE_SO ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c_x86.so) +endif() + install( - FILES ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c-linux.so - DESTINATION ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ + FILES + ${TF_LITE_SO} + DESTINATION + ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ + RENAME + libtensorflowlite_c.so ) ``` From 1e8905bfff350c226dbff6f6ab06796ab2dabb6b Mon Sep 17 00:00:00 2001 From: "CaptainDario @ MBP M1" Date: Thu, 20 Jun 2024 12:27:42 +0900 Subject: [PATCH 3/6] updated install instructions for arm64 / x 86 --- README.md | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7515be3..9e54b15 100644 --- a/README.md +++ b/README.md @@ -132,16 +132,30 @@ For this, first a `.dll` needs to be built. You can follow the [Bazel build guid As a second step, the library needs to be added to your application's project. This is a simple procedure 1. Create a folder called `blobs` in the top level of your project -2. Copy the `libtensorflowlite_c-win.dll` to this folder -3. Append following lines to your `windows/CMakeLists.txt` +2. Copy the `libtensorflowlite_c.dll` to this folder +3. Rename the file matching you architecture + 1. arm -> `libtensorflowlite_c_arm64.dll` + 2. x86 -> `libtensorflowlite_c_x86.dll` +4. Append following lines to your `windows/CMakeLists.txt` ``` Make ... # get tf lite binaries +message(STATUS "TF Lite detected processor architecture: ${CMAKE_SYSTEM_PROCESSOR}") +if(CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64") + set(TF_LITE_DLL ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c_arm64.dll) +elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + set(TF_LITE_DLL ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c_x86.dll) +endif() + install( - FILES ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c-win.dll - DESTINATION ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ + FILES + ${TF_LITE_DLL} + DESTINATION + ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ + RENAME + libtensorflowlite_c.dll ) ``` From 7d6f94fc765b10a3a0d41cc08bbc04b26a0bb014 Mon Sep 17 00:00:00 2001 From: "CaptainDario @ MBP M1" Date: Thu, 20 Jun 2024 12:31:01 +0900 Subject: [PATCH 4/6] updated cmake for arm / x86 --- .../audio_classification/windows/CMakeLists.txt | 15 +++++++++++++-- .../windows/CMakeLists.txt | 15 +++++++++++++-- .../windows/CMakeLists.txt | 15 +++++++++++++-- .../windows/CMakeLists.txt | 15 +++++++++++++-- example/style_transfer/windows/CMakeLists.txt | 15 +++++++++++++-- .../windows/CMakeLists.txt | 15 +++++++++++++-- .../text_classification/windows/CMakeLists.txt | 15 +++++++++++++-- 7 files changed, 91 insertions(+), 14 deletions(-) diff --git a/example/audio_classification/windows/CMakeLists.txt b/example/audio_classification/windows/CMakeLists.txt index efe8f88..f5d4aec 100644 --- a/example/audio_classification/windows/CMakeLists.txt +++ b/example/audio_classification/windows/CMakeLists.txt @@ -102,7 +102,18 @@ install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) # get tf lite binaries +message(STATUS "TF Lite detected processor architecture: ${CMAKE_SYSTEM_PROCESSOR}") +if(CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64") + set(TF_LITE_DLL ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c_arm64.dll) +elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + set(TF_LITE_DLL ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c_x86.dll) +endif() + install( - FILES ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c-win.dll - DESTINATION ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ + FILES + ${TF_LITE_DLL} + DESTINATION + ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ + RENAME + libtensorflowlite_c.dll ) \ No newline at end of file diff --git a/example/image_classification_mobilenet/windows/CMakeLists.txt b/example/image_classification_mobilenet/windows/CMakeLists.txt index 7f47e5f..e605920 100644 --- a/example/image_classification_mobilenet/windows/CMakeLists.txt +++ b/example/image_classification_mobilenet/windows/CMakeLists.txt @@ -102,7 +102,18 @@ install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) # get tf lite binaries +message(STATUS "TF Lite detected processor architecture: ${CMAKE_SYSTEM_PROCESSOR}") +if(CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64") + set(TF_LITE_DLL ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c_arm64.dll) +elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + set(TF_LITE_DLL ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c_x86.dll) +endif() + install( - FILES ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c-win.dll - DESTINATION ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ + FILES + ${TF_LITE_DLL} + DESTINATION + ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ + RENAME + libtensorflowlite_c.dll ) \ No newline at end of file diff --git a/example/live_object_detection_ssd_mobilenet/windows/CMakeLists.txt b/example/live_object_detection_ssd_mobilenet/windows/CMakeLists.txt index 2a48b62..dd267de 100644 --- a/example/live_object_detection_ssd_mobilenet/windows/CMakeLists.txt +++ b/example/live_object_detection_ssd_mobilenet/windows/CMakeLists.txt @@ -102,7 +102,18 @@ install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) # get tf lite binaries +message(STATUS "TF Lite detected processor architecture: ${CMAKE_SYSTEM_PROCESSOR}") +if(CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64") + set(TF_LITE_DLL ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c_arm64.dll) +elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + set(TF_LITE_DLL ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c_x86.dll) +endif() + install( - FILES ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c-win.dll - DESTINATION ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ + FILES + ${TF_LITE_DLL} + DESTINATION + ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ + RENAME + libtensorflowlite_c.dll ) \ No newline at end of file diff --git a/example/object_detection_ssd_mobilenet/windows/CMakeLists.txt b/example/object_detection_ssd_mobilenet/windows/CMakeLists.txt index 29f1d10..b6e9215 100644 --- a/example/object_detection_ssd_mobilenet/windows/CMakeLists.txt +++ b/example/object_detection_ssd_mobilenet/windows/CMakeLists.txt @@ -102,7 +102,18 @@ install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) # get tf lite binaries +message(STATUS "TF Lite detected processor architecture: ${CMAKE_SYSTEM_PROCESSOR}") +if(CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64") + set(TF_LITE_DLL ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c_arm64.dll) +elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + set(TF_LITE_DLL ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c_x86.dll) +endif() + install( - FILES ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c-win.dll - DESTINATION ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ + FILES + ${TF_LITE_DLL} + DESTINATION + ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ + RENAME + libtensorflowlite_c.dll ) \ No newline at end of file diff --git a/example/style_transfer/windows/CMakeLists.txt b/example/style_transfer/windows/CMakeLists.txt index 9d94d52..0151653 100644 --- a/example/style_transfer/windows/CMakeLists.txt +++ b/example/style_transfer/windows/CMakeLists.txt @@ -102,7 +102,18 @@ install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) # get tf lite binaries +message(STATUS "TF Lite detected processor architecture: ${CMAKE_SYSTEM_PROCESSOR}") +if(CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64") + set(TF_LITE_DLL ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c_arm64.dll) +elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + set(TF_LITE_DLL ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c_x86.dll) +endif() + install( - FILES ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c-win.dll - DESTINATION ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ + FILES + ${TF_LITE_DLL} + DESTINATION + ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ + RENAME + libtensorflowlite_c.dll ) \ No newline at end of file diff --git a/example/super_resolution_esrgan/windows/CMakeLists.txt b/example/super_resolution_esrgan/windows/CMakeLists.txt index 4b1beb9..fe99f0c 100644 --- a/example/super_resolution_esrgan/windows/CMakeLists.txt +++ b/example/super_resolution_esrgan/windows/CMakeLists.txt @@ -102,7 +102,18 @@ install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) # get tf lite binaries +message(STATUS "TF Lite detected processor architecture: ${CMAKE_SYSTEM_PROCESSOR}") +if(CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64") + set(TF_LITE_DLL ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c_arm64.dll) +elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + set(TF_LITE_DLL ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c_x86.dll) +endif() + install( - FILES ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c-win.dll - DESTINATION ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ + FILES + ${TF_LITE_DLL} + DESTINATION + ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ + RENAME + libtensorflowlite_c.dll ) \ No newline at end of file diff --git a/example/text_classification/windows/CMakeLists.txt b/example/text_classification/windows/CMakeLists.txt index 1ecd857..6c86c29 100644 --- a/example/text_classification/windows/CMakeLists.txt +++ b/example/text_classification/windows/CMakeLists.txt @@ -102,7 +102,18 @@ install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) # get tf lite binaries +message(STATUS "TF Lite detected processor architecture: ${CMAKE_SYSTEM_PROCESSOR}") +if(CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64") + set(TF_LITE_DLL ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c_arm64.dll) +elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + set(TF_LITE_DLL ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c_x86.dll) +endif() + install( - FILES ${PROJECT_BUILD_DIR}/../blobs/libtensorflowlite_c-win.dll - DESTINATION ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ + FILES + ${TF_LITE_DLL} + DESTINATION + ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ + RENAME + libtensorflowlite_c.dll ) \ No newline at end of file From 41492ba8b8e58650d96f7196762556628154e3d7 Mon Sep 17 00:00:00 2001 From: "CaptainDario @ MBP M1" Date: Thu, 20 Jun 2024 12:31:30 +0900 Subject: [PATCH 5/6] formatting --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9e54b15..b5d8476 100644 --- a/README.md +++ b/README.md @@ -99,8 +99,8 @@ As a second step, the library needs to be added to your application's project. T 1. Create a folder called `blobs` in the top level of your project 2. Copy the `libtensorflowlite_c.so` to this folder 3. Rename the file matching you architecture - 1. arm -> libtensorflowlite_c_arm64.so - 2. x86 -> libtensorflowlite_c_x86.so + 1. arm -> `libtensorflowlite_c_arm64.so` + 2. x86 -> `libtensorflowlite_c_x86.so` 4. Append following lines to your `linux/CMakeLists.txt` ``` Make From 637a3ec22343e7e2b95987d0d982dbdb29c77719 Mon Sep 17 00:00:00 2001 From: "CaptainDario @ MBP M1" Date: Thu, 20 Jun 2024 12:34:23 +0900 Subject: [PATCH 6/6] corrected binary names --- README.md | 4 ++-- example/audio_classification/linux/CMakeLists.txt | 2 +- example/audio_classification/windows/CMakeLists.txt | 2 +- example/image_classification_mobilenet/linux/CMakeLists.txt | 2 +- example/image_classification_mobilenet/windows/CMakeLists.txt | 2 +- .../live_object_detection_ssd_mobilenet/linux/CMakeLists.txt | 2 +- .../windows/CMakeLists.txt | 2 +- example/object_detection_ssd_mobilenet/linux/CMakeLists.txt | 2 +- example/object_detection_ssd_mobilenet/windows/CMakeLists.txt | 2 +- example/style_transfer/linux/CMakeLists.txt | 2 +- example/style_transfer/windows/CMakeLists.txt | 2 +- example/super_resolution_esrgan/linux/CMakeLists.txt | 2 +- example/super_resolution_esrgan/windows/CMakeLists.txt | 2 +- example/text_classification/linux/CMakeLists.txt | 2 +- example/text_classification/windows/CMakeLists.txt | 2 +- 15 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index b5d8476..d33aa63 100644 --- a/README.md +++ b/README.md @@ -120,7 +120,7 @@ install( DESTINATION ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ RENAME - libtensorflowlite_c.so + libtensorflowlite_c-linuxlibtensorflowlite_c-linux.so ) ``` @@ -155,7 +155,7 @@ install( DESTINATION ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ RENAME - libtensorflowlite_c.dll + libtensorflowlite_c-win.dll ) ``` diff --git a/example/audio_classification/linux/CMakeLists.txt b/example/audio_classification/linux/CMakeLists.txt index 1dff681..aae6cb9 100644 --- a/example/audio_classification/linux/CMakeLists.txt +++ b/example/audio_classification/linux/CMakeLists.txt @@ -152,5 +152,5 @@ install( DESTINATION ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ RENAME - libtensorflowlite_c.so + libtensorflowlite_c-linux.so ) \ No newline at end of file diff --git a/example/audio_classification/windows/CMakeLists.txt b/example/audio_classification/windows/CMakeLists.txt index f5d4aec..92662ff 100644 --- a/example/audio_classification/windows/CMakeLists.txt +++ b/example/audio_classification/windows/CMakeLists.txt @@ -115,5 +115,5 @@ install( DESTINATION ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ RENAME - libtensorflowlite_c.dll + libtensorflowlite_c-win.dll ) \ No newline at end of file diff --git a/example/image_classification_mobilenet/linux/CMakeLists.txt b/example/image_classification_mobilenet/linux/CMakeLists.txt index 3c14832..d935926 100644 --- a/example/image_classification_mobilenet/linux/CMakeLists.txt +++ b/example/image_classification_mobilenet/linux/CMakeLists.txt @@ -152,5 +152,5 @@ install( DESTINATION ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ RENAME - libtensorflowlite_c.so + libtensorflowlite_c-linux.so ) \ No newline at end of file diff --git a/example/image_classification_mobilenet/windows/CMakeLists.txt b/example/image_classification_mobilenet/windows/CMakeLists.txt index e605920..3ba8152 100644 --- a/example/image_classification_mobilenet/windows/CMakeLists.txt +++ b/example/image_classification_mobilenet/windows/CMakeLists.txt @@ -115,5 +115,5 @@ install( DESTINATION ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ RENAME - libtensorflowlite_c.dll + libtensorflowlite_c-win.dll ) \ No newline at end of file diff --git a/example/live_object_detection_ssd_mobilenet/linux/CMakeLists.txt b/example/live_object_detection_ssd_mobilenet/linux/CMakeLists.txt index f7ff16c..d8c2bd4 100644 --- a/example/live_object_detection_ssd_mobilenet/linux/CMakeLists.txt +++ b/example/live_object_detection_ssd_mobilenet/linux/CMakeLists.txt @@ -152,5 +152,5 @@ install( DESTINATION ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ RENAME - libtensorflowlite_c.so + libtensorflowlite_c-linux.so ) \ No newline at end of file diff --git a/example/live_object_detection_ssd_mobilenet/windows/CMakeLists.txt b/example/live_object_detection_ssd_mobilenet/windows/CMakeLists.txt index dd267de..14614c0 100644 --- a/example/live_object_detection_ssd_mobilenet/windows/CMakeLists.txt +++ b/example/live_object_detection_ssd_mobilenet/windows/CMakeLists.txt @@ -115,5 +115,5 @@ install( DESTINATION ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ RENAME - libtensorflowlite_c.dll + libtensorflowlite_c-win.dll ) \ No newline at end of file diff --git a/example/object_detection_ssd_mobilenet/linux/CMakeLists.txt b/example/object_detection_ssd_mobilenet/linux/CMakeLists.txt index 8d15ec3..7f543c9 100644 --- a/example/object_detection_ssd_mobilenet/linux/CMakeLists.txt +++ b/example/object_detection_ssd_mobilenet/linux/CMakeLists.txt @@ -152,5 +152,5 @@ install( DESTINATION ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ RENAME - libtensorflowlite_c.so + libtensorflowlite_c-linux.so ) \ No newline at end of file diff --git a/example/object_detection_ssd_mobilenet/windows/CMakeLists.txt b/example/object_detection_ssd_mobilenet/windows/CMakeLists.txt index b6e9215..f386d6a 100644 --- a/example/object_detection_ssd_mobilenet/windows/CMakeLists.txt +++ b/example/object_detection_ssd_mobilenet/windows/CMakeLists.txt @@ -115,5 +115,5 @@ install( DESTINATION ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ RENAME - libtensorflowlite_c.dll + libtensorflowlite_c-win.dll ) \ No newline at end of file diff --git a/example/style_transfer/linux/CMakeLists.txt b/example/style_transfer/linux/CMakeLists.txt index ce692b3..ed11cd3 100644 --- a/example/style_transfer/linux/CMakeLists.txt +++ b/example/style_transfer/linux/CMakeLists.txt @@ -152,5 +152,5 @@ install( DESTINATION ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ RENAME - libtensorflowlite_c.so + libtensorflowlite_c-linux.so ) \ No newline at end of file diff --git a/example/style_transfer/windows/CMakeLists.txt b/example/style_transfer/windows/CMakeLists.txt index 0151653..231fb40 100644 --- a/example/style_transfer/windows/CMakeLists.txt +++ b/example/style_transfer/windows/CMakeLists.txt @@ -115,5 +115,5 @@ install( DESTINATION ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ RENAME - libtensorflowlite_c.dll + libtensorflowlite_c-win.dll ) \ No newline at end of file diff --git a/example/super_resolution_esrgan/linux/CMakeLists.txt b/example/super_resolution_esrgan/linux/CMakeLists.txt index c43c24b..aef7451 100644 --- a/example/super_resolution_esrgan/linux/CMakeLists.txt +++ b/example/super_resolution_esrgan/linux/CMakeLists.txt @@ -152,5 +152,5 @@ install( DESTINATION ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ RENAME - libtensorflowlite_c.so + libtensorflowlite_c-linux.so ) \ No newline at end of file diff --git a/example/super_resolution_esrgan/windows/CMakeLists.txt b/example/super_resolution_esrgan/windows/CMakeLists.txt index fe99f0c..a74f1ff 100644 --- a/example/super_resolution_esrgan/windows/CMakeLists.txt +++ b/example/super_resolution_esrgan/windows/CMakeLists.txt @@ -115,5 +115,5 @@ install( DESTINATION ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ RENAME - libtensorflowlite_c.dll + libtensorflowlite_c-win.dll ) \ No newline at end of file diff --git a/example/text_classification/linux/CMakeLists.txt b/example/text_classification/linux/CMakeLists.txt index ad63b1b..46e112d 100644 --- a/example/text_classification/linux/CMakeLists.txt +++ b/example/text_classification/linux/CMakeLists.txt @@ -152,5 +152,5 @@ install( DESTINATION ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ RENAME - libtensorflowlite_c.so + libtensorflowlite_c-linux.so ) \ No newline at end of file diff --git a/example/text_classification/windows/CMakeLists.txt b/example/text_classification/windows/CMakeLists.txt index 6c86c29..2044c01 100644 --- a/example/text_classification/windows/CMakeLists.txt +++ b/example/text_classification/windows/CMakeLists.txt @@ -115,5 +115,5 @@ install( DESTINATION ${INSTALL_BUNDLE_DATA_DIR}/../blobs/ RENAME - libtensorflowlite_c.dll + libtensorflowlite_c-win.dll ) \ No newline at end of file