Code Monkey home page Code Monkey logo

social-distancing-detection's Introduction

Social-Distancing-Detection

This repo contains code for a covid19 utility- social distancing detection using Tiny Yolo Model to be able to run on smaller GPU systems too.

This is a Computer Vision Project which served as one part of my Final Year Project- Implementation of Face Detection and Object Tracking Techniques to Develop Covid19 Utilities for Face Mask Detection and Social Distancing Violations Detection

The project features use of Transfer Learning to save time.

Model Download Files

Model Weight Files : Google Drive

Dataset Used

We used a pretrained YOLOv3 Model on COCO Dataset for this project.

Methodology Used

  • To explain the working of this system, we start by taking each frame from a video feed and decrease it's size to 1/4 of original frame size for faster processing.

  • Then the image is passed through a YOLOv3 model (tiny-yolo for faster execution but poorer results) to get bounding boxes of each person in the video.

  • Once we get the bounding boxes, we calculate the centroids of each box and then use an itertools method to get all combinations of the centroids.

  • Distance between each combination of centroid is calculated and checked across a threshold value.

  • If distance is less than threshold value then those are marked as violations else safe.

For better results, more preprocessing can be done for each image and a better/faster object detection model can be used.

Social Distancing Detection Use Case:

usecase-image

Social Distancing Detection Architecture:

architecture-image

Social Distancing Detection Flow Chart:

flowchart-image

Social Distancing Detection Module Heirarchy Diagram:

module-hierarchy-image

Model Results

YOLO v3 Table of Results:

model-table-image

Outputs:

Regular Feed Output:

good-image

No Violations Feed Output:

no-violations-image

All Violations Feed Output:

all-violations-image

Failures:

Object Detection Model Failure:

failure-image

half Off Prediction:

half-off-image

To Do:

  1. Add Pipelines
  2. Model Retraining Support
  3. UI Interface
  4. Accuracy/Precision/Recall Improvement
  5. Deployment
  6. Requirements and project documentation
  7. Realtime Detection Performance
  8. Add Bird Eye View and transforme coordinates/centroids accordingly for better results.
  9. Self configuration of threshold value depending on camera location.
  10. Non GPU device support.

Inspiration:

In this time of pandemic struck world, I had to do my part as an AI/ML engineer to develop something which can actually be used. Though this project is far from over, but it's the start of something. Later I was able to mentor a team in a hackathon on a similar problem statement as my final year project and this starting guide/code helped them a lot, so it's probably a win - win situation.

Acknowledgements:

A special thanks to Adrian Rosebrock and his blog at PyImageSearch for helping out with this project.

Also thanks to many other github contributors who've worked on similar projects. Thanks for your repos and guidance.

Another shoutout to Landing AI

social-distancing-detection's People

Contributors

harshit-saraswat avatar

Stargazers

 avatar

Watchers

 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.