Skip to content

wangguangyuan/tensorflow_object_detection_tflite

 
 

Repository files navigation

System Environment:

System: Ubuntu 18.04

Opencv: opencv 3.2

Instructions:

  1. Run demo.cpp on x86 unbuntu, make sure opencv and bazel are installed.

    1. Build libtensorflowlite.so, under the tensorflow directory.
                bazel build -c opt //tensorflow/lite:libtensorflowlite.so --fat_apk_cpu=arm64-v8a
    
    1. Move .so to tensorflow_object_detection_tflite/lib
    2. Change find_library(TFLITE_LIBRARY tensorflow-lite "lib") to find_library(TFLITE_LIBRARY tensorflowlite "lib") in CMakeLists.txt.
    3. Build cmake
            mkdir build
            cd build
            cmake ..
            make -j
            ./demo
    
  2. Run demo.cpp on arm64-v8a ubuntu.

    1. Intall opencv on your arm64 motherboard.
    2. 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.
    3. Move .a to tensorflow_object_detection_tflite/lib
    4. keep find_library(TFLITE_LIBRARY tensorflow-lite "lib") unchanged.
    5. Build cmake
            mkdir build
            cd build
            cmake ..
            make -j
            ./demo
    
  3. 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)

  4. Result image

Screenshot

About

This is a repo for mobilenet-ssd tflite c++ on x86 and arm64

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 80.6%
  • Python 4.7%
  • C 3.7%
  • Fortran 2.9%
  • Java 1.1%
  • Shell 1.0%
  • Other 6.0%