Search code examples
androidtensorflowobject-detection

Running tensoflow inference graph in android


I am new to app development. I want to run my trained object detection model in android. The model is produced by Object Detection API. Hence the output is in frozen_inference_graph.pb format.

I have looked into the documentation page. It gives multiple options. I could not figure out which one is suitable for me. Any suggestion on which path to choose among the following :

  1. Building in Android Studio using the TensorFlow AAR from JCenter
  2. Building the Demo with TensorFlow from Source

thanks and regards skbhat


Solution

  • They have pros and cons but either way could do the work.

    1. get the prebuilt library (tensorflow_inference.so) with jni wrappers enables you to build your app with ease, so I think it's recommended way to begin.

    2. Build from source takes some time and sometimes it's troublesome (depends on your current environment), but it gives you to highly customize/optimize overall functions. so I guess it' better if you have enough knowledge on manipulating core apis (like adding/removing ops, etc.)

    To make it short, in my opinion, if you are new to android tensorflow, then take the libraries from JCenter would be more than enough.