System Environment:
System: Ubuntu 18.04
Opencv: opencv 3.2
Instructions:
-
Run demo.cpp on x86 unbuntu, make sure opencv and bazel are installed.
- Build libtensorflowlite.so, under the tensorflow directory.
bazel build -c opt //tensorflow/lite:libtensorflowlite.so --fat_apk_cpu=arm64-v8a
- Move .so to tensorflow_object_detection_tflite/lib
- Change find_library(TFLITE_LIBRARY tensorflow-lite "lib") to find_library(TFLITE_LIBRARY tensorflowlite "lib") in CMakeLists.txt.
- Build cmake
mkdir build cd build cmake .. make -j ./demo
-
Run demo.cpp on arm64-v8a ubuntu.
- Intall opencv on your arm64 motherboard.
- Build libtensorflow-lite.a, followed by the tensorflow tutorial https://www.tensorflow.org/lite/guide/build_arm64. Careful about the arm version, v7 or v8.
- Move .a to tensorflow_object_detection_tflite/lib
- keep find_library(TFLITE_LIBRARY tensorflow-lite "lib") unchanged.
- Build cmake
mkdir build cd build cmake .. make -j ./demo
-
If there is a flatbuffers error, you should build flatbuffers on your desktop, and use its header files and .a lib file, put and replace them into tensorflow_object_detection_tflite/include and tensorflow_object_detection_tflite/lib, respectively. You can check here to know how to build. google/flatbuffers#5569 (comment)
-
Result image