Coder Social home page Coder Social logo

abhijitk2015 / custom-object-detection-on-android-using-tf-lite Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nstiwari/custom-object-detection-on-android-using-tf-lite

0.0 0.0 0.0 94.59 MB

An end-to-end tutorial to train a custom object detection model and deploy it on Android using TensorFlow Lite.

Python 2.54% Java 1.73% Kotlin 48.52% Jupyter Notebook 47.22%

custom-object-detection-on-android-using-tf-lite's Introduction

Custom Object Detection on Android using TF Lite

An end-to-end tutorial to train a custom object detection model and deploy it on Android using TensorFlow Lite.

Steps:

  1. Prepare your dataset and label them in PascalVOC format using LabelImg.

  2. Programmatically convert all the raw images in your dataset in the JPEG format using this script. Doing so will ensure that you don't face any error while loading your dataset during model training.

  3. Once you've converted the raw images, partition the dataset into train and test data in the following directory structure.

<your_dataset_name.zip>
|__ train
|    |__ images (all training image files - *.jpg)
|    |__ annotations (all training annotation files - *.xml)
|__ test
     |__ images (all test image files - *.jpg)
     |__ annotations (all test annotation files - *.xml) 

Once done, upload your zipped dataset on Kaggle/Google Drive.

  1. Clone the repository on your local machine.

  2. Sign in to your Google account and upload the Custom_Object_Detection_using_TF_Lite_Model_Maker.ipynb notebook on Colab.

  3. Run the notebook cells one-by-one by following the instructions.

  4. Once the TF Lite model is downloaded, copy the model.tflite model file inside Custom-Object-Detection-on-Android-using-TF-Lite/Android_App/app/src/main/assets directory.

  5. Open the project in Android Studio and let it build itself for some time.

  6. Open MainActivity.kt file and edit Line 130 by replacing <your_model.tflite> with the name of your actual TF Lite model.

  7. Build the project and install it on your phone. Enjoy your own custom-built object detector app.

Output:

GitHub Logo

custom-object-detection-on-android-using-tf-lite's People

Contributors

nstiwari avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.