Building TensorFlow Lite for Java Desktop without Android - java

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 :)

Related

Computer Vision in Android Studio

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.

Is there any way to call python code in android develop without installing sl4a?

I have found some ways to using python to build android app.But all of them need to install sl4a and pythonforandroid.
It is so complicated,so is there any way to package sl4a to my android app project,and once I install the apk,I needn't install sl4a any more.
You can use Kivy at following link :
Python for Android
It will can help u have a look to the following topic :
How can I integrate a Python code in the Android Java app?
hope this help you.
You can do this. What it comes down to is packaging the Python interpreter (compiled by the NDK) in your app, and starting it via the standard NDK mechanisms. This is the same thing that e.g. Kivy does, but you'd be adding the code to your own app rather than (like Kivy) using a java bootstrap then letting the Python manage everything else.
One option, which has seen a little discussion/development recently, is to use python-for-android to build all the python components, then copy them into your java project (and add the code to handle it). This is possible, but not currently as easy as it could be, you'd need to look into how it works internally to get the outputs you need.
Another option that is probably easier right now if you don't need compiled code beyond python itself is to directly use the precompiled python binaries of the CrystaX NDK, in which case including the python binaries comes down to only adding them to your Android.mk. You'd still need some C and NDK code to interact with the interpreter, but the process is quite straightforward.
(SL4A has some Android build tools of its own, which you could also use for this, but I don't know what you'd need to do to integrate it as I think SL4A does extra things on top of just having the python interpreter present).

I have to create google maps for android but the code I presently have is in java script developed in .net

My maps project is basically developed by using java script in .net,
All the files are in .cs format. I want to convert this entire project into android project
or if there is any source code present please provide me.
I am presently using android development tool plugin for android development.
The default sample maps is not working in my eclipse.
Suggest me any other options?
How to resolve this issue?
If you are comfortable with using c# already and really only need the maps. You should look into Xamarin

Android OCR Native library

I am trying to develop a Android OCR app (for home use).
I had the idea to use the Asprise OCR in the app but instead of the windows version I was gonna use the Linux version.
The problem is, I don't know how to handle the native libraries. They have the extension .SH
I'm developing in Eclipse.
Google recently released an OCR API, so you probably want to use that:
https://developers.google.com/vision/text-overview
Just add the following line to your dependecies:
compile 'com.google.android.gms:play-services-vision:9.2.0'
I would recommend you to use Android Studio instead of Eclipse and related to the OCR library, you could use Tesseract, which is an open source library developed by Google.
Here you have more information and a practical example to follow:
https://solidgeargroup.com/ocr-on-android
That reference may help you:
http://gaut.am/making-an-ocr-android-app-using-tesseract/
Hope this helps
Update 13/04/17: Removed the broken link, will put it back if it goes up again.

How do Online App Creator work? Is there any example source code to look?

There are a lot of solutions for creating an app online like http://www.theappbuilder.com.
How do they build these apps? Is there any example source code to look at cause these tools are all over the internet?
This app builder uses Webview, set to full screen what shows HTML5 page that you can make with this tool. I think it might be possible to see some code. These kinds of tools are helpful for some easy apps, if you want full control and make something more complicated you will need to use Android-sdk or some other hybrid sdk-s(appcelerator, corona-sdk, adobe flash buider and so on).
You can use Ionic for that, i have similar project that i am working on right now since ionic is built in top of angular and html and produce /www folder for you and you can simply use command ionic cordova build android to convert to the apk, if you want it to run on server you can call those command using php exec() command.
In a comment above, you ask about open source alternatives. Take a look at something like PhoneGap. It is close enough that it should give you an understanding of the general approach.

Categories

Resources