GithubHelp home page GithubHelp logo

noormuhammad15 / social-distancing-detector Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rajpratyush/social-distancing-detector

0.0 0.0 0.0 18.57 MB

Detect the social distance violations in real time using OpenCV and deep learning

License: MIT License

Python 100.00%

social-distancing-detector's Introduction

Social Distance Violation Detection (SoDV) using pre-trained YOLOv3 model SoDV

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. FYP 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

  • Python
  • Numpy
  • OpenCV
  • Scipy
  • Object Detection models (Mobilenet or Googlenet or YOLO)

Steps

  1. Input the video stream using OpenCV
  2. Detect the people in the video stream using any of the object detection models
  3. Find the centroids of the identified people and calculate the distance between the centroids
  4. Check if the distance calculated above is lesser than the minimum value (in pixels) and consider it as violation
  5. Draw the bounding boxes in red color around the person if violating, green color box if the person is following the norms

💻 Install the dependencies on command line:

$ pip3 install -r requirement.txt

💻 To run the program on command line:

$ python3 social-distance-yolo.py

🎬 Output example:

outputimage

Frame 10 to 500:

outputimage outputimage outputimage
FRAME 10 FRAME 100 FRAME 200
outputimage outputimage outputimage
FRAME 300 FRAME 400 FRAME 500

🎯 Accuracy for person detection:

Dataset TP TN FP FN %
Oxford Town Centre 29 0 0 11 72.5

🎯 Accuracy for social distance violation detection:

Dataset TP TN FP FN %
Oxford Town Centre NA NA NA NA NA

⛔ Social distance violation detection using distance formula Drawback:

  • No camera calibration for intrinsic parameter

⏳ Future upgrades:

Features Status
Camera calibration for intrinsic parameter (distance) STATUS
Add facemask detection STATUS
upgrade to YOLO v4 STATUS

Kindly check out below links:

👀 YOLO Pre-Trained Model
YOLO Darknet

📊 Dataset
MegaPixels: Origins, Ethics, and Privacy Implications of Publicly Available Face Recognition Image Datasets
Oxford TownCentre

🧐 Code of Conduct

You can find our Code of Conduct here.

❤️ Thanks to our awesome contributors ✨✨

social-distancing-detector's People

Contributors

bijay555 avatar sloth-panda avatar vrushti24 avatar samir-0711 avatar akrish4 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.