Instance Segmentation on Android

Hi, I’m a lvl 1 in machine learning and to cut thing short is it possible to make an instance segmentation model and implement the model on android (using camera for the image input) ?

Hi @Muh_Andar_Sugianto

Absolutely! Creating an instance segmentation model and implementing it on Android for real-time camera input is totally feasible, even for a level 1 in machine learning. It might require some effort and learning, but it’s an achievable goal with the right resources and approach.

Here’s a breakdown of the process:

1. Training the Instance Segmentation Model:

  • Choose a Model: Popular options for mobile deployment include EfficientDet-Lite, Mask R-CNN, and U-Net. Consider factors like accuracy, size, and inference speed when choosing.
  • Prepare Training Data: You’ll need high-quality images with objects you want to segment and corresponding masks that identify each instance. Tools like VGG Image Annotator can help with annotation.
  • Train the Model: Use cloud platforms like Google Colab or AWS SageMaker to train your model on your prepared data. Libraries like TensorFlow for instance segmentation.

2. Implementing the Model on Android:

  • Convert the Model: TensorFlow Lite Converter helps convert your trained model to a lightweight format optimized for mobile devices.
  • Use an SDK: Frameworks like TensorFlow Lite and MediaPipe offer libraries for mobile object detection and segmentation. They provide camera integration, inference pipelines, and result visualization tools.
  • Develop the Android App: Integrate the chosen SDK into your Android app, handle camera input, perform on-device inference, and display the segmentation results (e.g., outlines around each object instance).

I am not expert on the part of Android and TFlite conversions. May be these tutorial can help you from TensorFlow

Thanks.

1 Like