- Machine Learning Projects for Mobile Applications
- Karthikeyan NG
- 358字
- 2021-06-10 19:41:40
Installing Android NDK and SDK
You need Android NDK to build the TensorFlow Lite code. You can download this from NDK Archives, accessed through the following link.
Android Studio comes with SDK tools. You need to access build tools version 23 or higher (the application runs on devices with API 21 or higher).
You can update the WORKSPACE file in the root of the directory with the API level and path to both SDK and NDK.
Update the api_level and location of the SDK and NDK at the root of the repository. If you open SDK Manager from Studio, you can find the SDK path. For example, note the following for SDK:
android_sdk_repository (
name = "androidsdk",
api_level = 27,
build_tools_version = "27.0.3",
path = "/Users/coco/Library/Android/sdk",
)
And for Android NDK archives:
android_ndk_repository(
name = "androidndk",
path = "/home/coco/android-ndk-r14b/",
api_level = 19,
)
At the time of writing, android-ndk-r14b-darwin-x86_64.zip is used from the NDK Archives. You can adjust the preceding parameters based on the availability.
Now, we are ready to build the source code. To build the demo app, run Bazel:
bazel build --cxxopt=--std=c++11
//tensorflow/contrib/lite/java/demo/app/src/main:TfLiteCameraDemo
Caution: Due to a bug, Bazel only supports the Python 2 environment right now.
The demo app here uses the TensorFlow Lite Java API, which takes a single image as input and produces the same in output. The output contains a two-dimensional array. The first array contains the category index value, and the second dimension contains the confidence value of the classification. From the values, it displays the top three to the user on the frontend.
- 顯卡維修知識精解
- 深入淺出SSD:固態存儲核心技術、原理與實戰(第2版)
- Mastering Manga Studio 5
- Artificial Intelligence Business:How you can profit from AI
- Apple Motion 5 Cookbook
- BeagleBone Robotic Projects
- 單片機原理及應用:基于C51+Proteus仿真
- 基于網絡化教學的項目化單片機應用技術
- 微控制器的應用
- Corona SDK Mobile Game Development:Beginner's Guide
- 創客電子:Arduino和Raspberry Pi智能制作項目精選
- Advanced Machine Learning with R
- 詳解FPGA:人工智能時代的驅動引擎
- 施耐德M241/251可編程序控制器應用技術
- MicroPython Cookbook