Skip to content

Latest commit

 

History

History

object_detection_demo

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Object detection with TensorFlow Object Detection API.

Application detects 3 kinds of objects: hazelnut, fig and date.

Object detection

This is a front-end solution for object detection on Android. For the back-end solution, please, visit my project for image classification on Android.

There are 2 main components:

  1. model training scripts - Google Colab *.ipynb scripts to use TensorFlow object detection API.
  2. mobile app - a mobile application that uses trained model in Android. It was copied from TensorFlow Lite object detection Android Demo.

TensorFlow Object Detection API is an open source framework built on top of TensorFlow that makes it easy to construct, train and deploy object detection models.

To run model on your mobile phone:

  • Take existing pre-trained model from the model zoo, test it with demo_1.ipynb script or train your own model on a new dataset (demo_2.ipynb).
  • Create *.tar.gz or *.zip file from detect.tflite with your model and labelmap.txt with your labels. Save *.tar.gz or *.zip to the Google Drive. Note: labelmap.txt file should start with ??? string, because zero position is reserved. So your class labels will start from the 1st position after ??? string.
  • Get downloadable direct link using direct link generator for Google Drive, Dropbox or Onedrive.
  • Replace link in the mobile app download_model.gradle file on your link. Use zipTree for *.zip and tarTree for *.tar.gz. Replace the link
  • Our model is not quantized, so set quantized to false in DetectorActivity.java file Set quantized to false
  • Delete build folder and clean assets folder. Rebuild the project: Build --> Make Project then Build --> Build Bundles --> Build APK.
  • Run mobile app (Run --> Run 'app') in Android Studio and enjoy!

Links: