Hello readers! Continuing from my previous article where I explained the theoretical part of our object detection model, here I will explain how to actually implement our social distance monitoring tool.

As already discussed, we have to first detect people and then use some heuristics on top of that to achieve our goal.

For implementing the people detection, we will use Facebook’s Detectronlibrary which has all the trained weights for RetinaNetfor people detection.

After detecting all the people in a given frame, we will use simple pixel distances to calculate how far the person is from another person. After calculating the distance between two people we can put a threshold on that distance to decide if two people are near or far away from each other.

We can make the model more robust?

We are going to use a simple method that I discussed before. We can also do some calibration if we know where we are placing the camera. For example, if we know where we are going to put the camera, we can take an image of a 1 meter long pipe, or something of known dimension, and look at how many pixels it is taking up in the image. This will give us an idea about how many pixels correspond to how much length which we can use to calculate the actual distance.

One other method we can use is augmented reality (AR) on mobile phones. While using AR we can estimate the actual distance between two points as it simulates the real world distance by taking the location of the cell phone as (0,0,0). If we know the location of people in a frame, we can combine with AR and find the distance between them.

We are not going to do anything fancy, but just a simple task of trying out various threshold values on pixel distance to make it work for a given video. In the demonstration that I am going to show, you will see that people who are far apart will have green boxes around them whereas if they are near to each other, the box will turn red.

#augmented-reality #heartbeat #object-detection #real-time-analytics #machine-learning

Monitoring Social Distancing Using People Detection
1.80 GEEK