Original article was published by Priyanka P. Pattnaik on Artificial Intelligence on Medium
Object Detection with Mask-R-CNN
Day by day when the world is moving towards the new models and technology, here I am trying to learn a step by step. The MRCNN name I discovered while finding out how the object detection is actually done after I understood the term CNN. Before focusing on the MRCNN I am going to give a basic light on CNN.
This is one of the best pictures of a sunset in Africa. In CNN I have tried to differentiate the pictures according to the class sunset or sunrise and CNN does that. While looking carefully at this picture we can see that it has so many different features like clouds, trees, birds, giraffe, rhinoceros. So, in order to extend the classification, I come across this term i.e. Detection.
In this image, we can see how different objects are detected in a single image. So as per the definition Object detection is a computer vision technique that allows us to identify and locate objects in an image or video. Different techniques have been used for the detection. In my experiment, I choose the MCRNN for my curiosity.
The typical deep learning definition of Masking is that it is a way to tell sequence-processing layers that certain timesteps in the input are missing, and thus should be skipped when processing the data. Padding is a special form of masking were the masked steps are at the start or at the beginning of a sequence. The MRCNN differentiates itself by improving the faster R-CNN. It includes two most important features that you will find unique that are
- It replaces the ROI pooling module with more accurate ROI align module
- It inserts an additional branch out of the ROI align module.
In the first step, you need to clone the repo and install all the dependencies.
I have used the google colab and for doing this code you need to add two more requirements. As the upgraded version of tensorflow has no attribute log. So, install the right version while doing the code.
The above code shows the training. In order to define the id names Index of the class in the list is its ID. For example, to get an ID of the road class, use: class_names.index(‘road’). And in the end, you can train the image.
Brought to You by
COE-AI(CET-BBSR)- A Initiative by CET-BBSR, Tech Mahindra and BPUT to provide to solutions to Real-world problems through ML and IoT