Skip to content

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.

Notifications You must be signed in to change notification settings

harshit-saraswat/Social-Distancing-Detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages