Introduction: Image Segmentation and Object Detection Implementation on BrainyPi

About: Computer Engineer, keen in learning AI&ML technologies.

This blog will help in implementation of Edge AI applications on BrainyPi. EdgeAI means computation done at the edge of given network instead of Centralized data storage facility. In this blog, will implement Image segmentation and Object detection applications. We will use TFLite library. In this blog we will implement image segmentation and object detection[1] project. I am among the lucky one who got early access to BrainyPi for making new products and try new experiments.

Supplies

Tools which are used for implementing the applications are-

  • BrainyPi access
  • Linux/ Windows Terminal

Step 1: Remote Access and Git Cloning

  • Open the terminal and establish remote access to BrainyPi using ssh command from terminal.
ssh -x pi@auth.iotiot.in -p 65530
  • Clone the github repository https://github.com/brainypi/BrainyPi-AI-Examples.git using. This repo has code for both the applications we are implementing in this blog
 git clone https://github.com/brainypi/BrainyPi-AI-Examples.git
  • we are implementing application using tflite library, so to install it use the following command in terminal.
pip install tflite-runtime 

Step 2: Opening Folder and Pre-requisites

  • For the image segmentation application- open the folder Image segmentation using the command
 cd BrainyPi-AI-Examples/TFLite/ImageSegmentation .
  • For object detection application- open the folder Object Detection using command
cd BrainyPi-AI-Examples/TFLite/ObjectDetection. 
  • there is a separate prerequisites file for executing the code. install it using
bash install-prerequisites.sh 

Step 3: Run the Python File

Run the file imageSegmentation.py, this file has 2 parameters image_dir and save_dir. Every parameter has some default value. To use some different value, use command

 python3 imageSegmentation.py --img_dir images/people.jpg .

 Run the file objectDetection.py, this file has 5 parameters models, image, threshold, labels, output. use command

python3 objectDetection.py --img_dir images/test1.jpg --threshold 0.6 .

Step 4: Output

For both the application- To see the output image, go to results folder. result.jpg file is present there. You can see both the projects output. Hurray!! we have successfully implemented our project in BrainyPi

Step 5: Refrences