Instance segmentation is a vital task in computer vision, and it plays a significant role in detecting objects in an image by identifying and locating each object’s pixel-wise boundaries. Although various instance segmentation models are available, most of them require high-end GPUs for efficient performance. However, in this blog, we present an alternate solution to Yoloact Edge used on Jetson Nano for instance segmentation, i.e., CPU-efficient Instance Segmentation on Brainy Pi Jetson nano alternative.
Dependencies Installation
To start with, we need to install the necessary libraries required for the task. We can install PyYAML and Detectron2 by executing the following command:
pip install pyyaml==5.1
pip install 'git+https://github.com/facebookresearch/detectron2.git'
Once the libraries are installed, we can import the required classes and functions from the detectron2 package to perform instance segmentation.
Deploy CPU Efficient Instance Segmentation on Brainy Pi – Jetson nano alternative.
To deploy the instance segmentation model on Brainy Pi, we need to clone the instance-segmentation repository and run the test.py script, passing the name of the input image as an argument. The model offers low latency instance segmentation even on an image with ten or more objects with accurate results.
Run the following command on the terminal of BrainyPi
git clone git clone https://github.com/brainypi/BrainyPi-AI-Examples.git
cd BrainyPi-AI-Examples/Detectron2
Usage
1. Download model from here
2. Run the following command
python test.py Carspotters.jpg