This builds upon the android-bootstrap project used to consume Lobe Exported Tensorflow Lite models. Instead, this project uses available APIs for retrieving predictions and appending project example sets.
Lobe is an easy-to-use free tool to help you start working with machine learning.
This project was created to help you bootstrap your Lobe project on android. Built with Kotlin.
In this stage we’re going to get you setup so you can build, launch, and play with your app. These instructions are written for macOS, the only system you can develop android apps on.
To start, we’re going to download ("clone") this repository.
If you already have git
installed, skip to Step 2.
If you prefer to use the GitHub Desktop app, click on the "Code" button above and click "Open with GitHub Desktop":
Otherwise, we need to install a few things:
First, open a Terminal window.
Next, copy & paste the following into a Terminal window and hit return.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew doctor
brew install git
Now that we have installed git
, you can clone this repo with the following command. You'll want to navigate to a folder in Terminal where you'd like to store these files. If you need help, here's a gentle introduction to navigation in the terminal.
git clone https://github.com/lobe/android-bootstrap.git
Step 2 - Installing Android Studio
Next, we're going to install Android Studio, a free tool from Google, via the their website. This is a fairly straightforward process that could take an hour or more, as the IDE app is pretty large.
Once it's done, open on this repository from inside Android Studio.
Now we need to export your custom model from Lobe. If you'd like, you can skip to the deploying your app section if you just want to see this app working with the default sample model.
This project connects to your instance of Lobe on the same machine or local network by referencing it's IP. In the future, we'd like to replace this manual step with an automatic connection. After starting Lobe, determine your machines IP and set it in the code or in-app after deploying.
Next, we'll want to get this app onto your phone so you can see it working live with your device's camera. To do this, plug in your device via a USB cable and, in the open Android Studio window, press the play button in the top right corner of the window.
And there you have it! Your app should be running on your device. And finally, if you'd like to post your app (running your custom image classification model) to the Google Play Store, you're more than welcome to do so. Follow the instructions here to get the process rolling. You'll need to have an Google Developer account.
This app is meant as a starting place for your own project. Below is a high level overview of the project to get you started. Like any good bootstrap app, this project has been kept intentionally simple. There are only two main components in two files, CameraActivity.kt
and DetectorActivity.kt
.
If you can think of anything you'd like to add, or bugs you find, please reach out! PRs will be openly accepted (if they keep project simple, bonus points for making it even simpler) and issues will be triaged.
For project ideas or feedback, please visit our community on Reddit!
We look forward to seeing the awesome projects you put out there into the world! Cheers!