How can I introduce a pre-trained model for classification in an android app and see like in a real-time video view how it is detecting stuff?
I'm using Android Studio with Java and I want to use a pre-trained model (just for informative purposes - it is not important to the question - one of these more precisely https://github.com/thatbrguy/Pedestrian-Detection/blob/master/object_detection/g3doc/detection_model_zoo.md)
Are there any APIs to make this possible? Or is it another way?
Thanks a lot for your time! Any help is greatly appreciated:)
You should check out this guide to embed TensorFlow models in Android: https://www.tensorflow.org/lite/inference_with_metadata/codegen -- this will generate wrapper code to enable integration on Android.
Note, there are a number of ways to export TF models, and you'll need to follow the export instructions carefully to ensure the TF model is what is required for TFLite inference.
Related
As the title says im attempting to build TensorFlow Lite for Java Desktop without Android. There doesn't seem to be any official guide or build on the Tensorflow Github / Website. Does anyone know of an existing 3rd party maven/gradle link that achieves this, or a concrete way to build Tensorflow for Java desktop without Android.
I've tried the following link but when I preform the steps, I get various Bazel build errors.
https://gist.github.com/JnCrMx/144f3169bde1da6856815b3419122ab0
I have written a library for Object Detection in Java. You can have a look if you want: JavaTF
If you want you can just follow the instructions I provided on the Readme file, and test the functionality. Currently it does not support TFLite, but the saved_model format is quite good too. You can have a look how things are done, I think for a TFLite model it is not much different.
Let me know if it helps :)
I am using the PocketSphinx Demo project for my hot word detection Android app and now I'd like to extract the MFCC features. Is it possible to do so with PocketSphinx?
Also, I've read many posts about using Sphinx 4 for Android, some say it can be done, some say it can't. I personaly didn't manage to make it work.
Thank you for your help,
now I'd like to extract the MFCC features. Is it possible to do so with PocketSphinx?
No, this feature is not supported
Also, I've read many posts about using Sphinx 4 for Android, some say it can be done, some say it can't. I personaly didn't manage to make it work. Thank you for your help,
Sphinx4 on Android is not supported either
I am really new to the java & android apps development. Currently I'm doing a prototype application about the voice recognition. Which use the sphinx4 speech recognition. I'm really no idea that, is that Sphinx4 can be used on the android SDK?
Using Sphinx4.0 to build a speech recog. Android application (this shows that, it can't)
https://sourceforge.net/p/cmusphinx/discussion/sphinx4/thread/ce6ee093/ (But this said it can.)
if yes, i really no idea how to make use of the sphinx4, anyone can kindly provide the guide for me to complete the prototype?
Thanks for your kindly help.
It is possible to run Sphinx4 on android, however, you need to remove sphinx4 parts that use desktop-specific java api like java sound API. You still can have the core in place and demo should work as expected.
You need to reimplement Microphone class to use android API for sound input.
For more details see the discussion about that:
https://sourceforge.net/p/cmusphinx/mailman/message/31317160/
So it is some work and it requires coding skills. If you don't have that, use pocketsphinx instead like Opiatefuchs suggests you. It's well documented approach which requires minimum efforts.
I also tried to do some App with Pocketsphinx, not Sphinx4. I think this is really not designed for android, but maybe You could get it work. But for which reason? PocketSphinx is a good designed API for including in Android. I had mad some tutorial on my website for how to get the Pocketsphinx work, I advise to stop thinking about Sphinx4 because it would be a heavy coding thing to get it work. PocketSpinx has all You need...look at my Tutorial, this is a better way:
https://sites.google.com/site/opiatefuchs/home/pocketsphinxandroiddemo
Until now I stopped working on it, but when I got time, I will start to include Pocketsphix into an apk. But this tut only shows how to get the example demo work and set up Your runtime environment to work with Pocketsphinx.
We are trying to have an online handwritten text recognizer for the Android platform. The inbuilt Gesture Recognition in android uses (from what I gather from the code) a K-NN checking of points, most probably the control points of a smoothed Bezier curve.
Instead of that we'll get some standard feature data from the points generated by the user on the touchscreen and then train an SVM for about 50 character classes (initially) to check how well our feature selection is working.
So considering that this SVM will have to run on a mobile phone which may not be state of the art in terms of processing power, which library should be used? Also to be considered is which library will be most easily integrated into development on the Android SDK using Eclipse IDE?
I have LibSVM in mind, but anyone with experience of using such on mobile platform should be able to give an educated guess of what to go for.
Thanks in advance.
I gather that what you need to do on the Android device is only evaluating the SVM on new data and not training. In that case, you really don't need any library. You just need to output the model (the weights) from LIBSVM or whatever library/method you plan to use, into your source code (whatever it is) and evaluate it on new data as your Android application requires.
It seems as if every Android application I really want to make is impossible to make with the current SDK. It doesn't give me access to certain things I would like to work with. This is an example of one of these things.
I know it is possible since I've seen apps in the market that do things that the SDK cannot do. My basic question is can someone point me in the direction of how to create such an application. I've searched around, but all of the links I've found are for developing with the SDK. A simple link to a tutorial that can show me how to access Android elements that aren't available through the SDK would be great.
Thanks.
You will not find a tutorial on it because the NDK is in flux..
What I have found is ..
One of the Eclipse CDT has blog posts on how to setup NDK projects in Eclipse.
The people who know Android Embedded C and frameworks are usually on certain IRc channel.
Plenty of code documentation..
Google search for android jni wrapper blog posts.
But keep this in mind several areas require state management as hey interact with hardware buffers in a certain way..ie audio..video..etc.