COVID-19 social distancing detector using OpenCV, Deep Learning, and Computer Vision. OpenCV and deep learning can be used to implement a social distancing detector. Our configuration file used to keep our implementation neat and tidy. Our detect_people utility function, which detects people in video streams using the YOLO object detection. Our Python driver script, which glues all the pieces together into a full-fledged OpenCV social distancing detector. Apply object detection to detect all people (and only people) in a video stream (see this tutorial on building an OpenCV people counter). Compute the pairwise distances between all detected people. Based on these distances, check to see if any two people are less than N pixels apart.
The initial idea of this project is to use MobileNet SSD with Caffe implementation as the person detection algorithm. In November 2020, I decided to further improve the detection algorithm by using YOLOv3 to increase the accuracy.
Detect the social distance violations in real time using OpenCV and deep learning
"Social distancing is the only way to counter Covid-19"
Requirements
Steps
💻 Install the dependencies on command line:
$ pip3 install -r requirement.txt
💻 To run the program on command line:
$ python3 social-distance-yolo.py
Frame 10 to 500:
FRAME 10 | FRAME 100 | FRAME 200 |
FRAME 300 | FRAME 400 | FRAME 500 |
Dataset | TP | TN | FP | FN | % |
---|---|---|---|---|---|
Oxford Town Centre | 29 | 0 | 0 | 11 | 72.5 |
Dataset | TP | TN | FP | FN | % |
---|---|---|---|---|---|
Oxford Town Centre | NA | NA | NA | NA | NA |
Features | Status |
---|---|
Camera calibration for intrinsic parameter (distance) | |
Add facemask detection | |
upgrade to YOLO v4 |
📊 Dataset MegaPixels: Origins, Ethics, and Privacy Implications of Publicly Available Face Recognition Image Datasets
You can find our Code of Conduct here.