Real-Time Social Distance Monitoring tool using Computer Vision

Overview

Social Distance Detector

A Real-Time Social Distance Monitoring Tool

Project Status: Active

Table of Contents

Motivation

The current COVID-19 pandemic is showing negative effects on human health as well as on social and economic life. It is a critical and challenging task to revive public life while minimizing the risk of infection. Reducing interactions between people by social distancing is an effective and prevalent measure to reduce the risk of infection and spread of the virus within a community. And so, this project will help to monitor that.

YOLO Theory

YOLO or You Only Look Once is an algorithm that uses neural networks to provide real-time object detection. Object detection in YOLO is done as a regression problem and provides the class probabilities of the detected images. As the name suggests, the algorithm requires only a single forward propagation through a neural network to detect objects.

Detection Output

animated


A single frame from Video 1

Detection Output 1

A single frame from Video 2

Detection Output 2

Tech Stack

  • Python

Functionalities

  • Detect people who are practicing social distancing and those who are not.
  • Draw a green coloured box around those who are practicing social distancing and red for those who are not.
  • Display the following information :
    • The threshold values used for detection.
    • Number of people recognized.
    • Number of people who are practicing social distancing.
    • Number of people who are not practicing social distancing.

To Do and Further Improvements

  • Using YOLO for Image Detection
  • Calculate the distance between people and categorise them as safe and unsafe
  • Draw green coloured boxes for those who follow social distancing and red for those who don't.
  • Detect and draw boxes for image, video and live stream.
  • Adding Birds-Eye View for the Video
  • Work on the minimum pixel distance for different media.
  • Assign a score at the end of the video/stream for every person based on the time they were not socially distanced.

Requirements

The following dependencies and modules(python) are required, to run this locally

  • os, sys, argparse
  • math
  • mimetypes
  • numpy==1.21.2
  • opencv-python==4.5.3.56

To install the requirements run:

$ pip install -r requirements.txt

Run Locally

  • Clone the GitHub repository
$ git clone git@github.com:Pranav1007/Social-Distance-Detector.git
  • Move to the Project Directory
$ cd Social-Distance-Detector
  • Create a Virtual Environment (Optional)

    • Install Virtualenv using pip (If it is not installed)
     $ pip install virtualenv
    • Create the Virtual Environment
    $ virtualenv sdd
    • Activate the Virtual Environment

      • In MAC OS/Linux
      $ source sdd/bin/activate
      • In Windows
      $ source sdd\Scripts\activate
  • Install the requirements

(sdd) $ pip install -r requirements.txt
  • Run the python script run.py along with the appropriate arguements
(sdd) $ python3 run.py -m v -p media/test.mp4
  • Usage
"""
    Usage:
      usage: run.py [-h] [-m MEDIA] [-p PATH]

    optional arguements:
      -h --help                 Show this screen and exit.
      -m MEDIA --media MEDIA    Media Type (image(or i), video(or v), webcam(or w))
      -p PATH --path PATH       Path of the Media File (For webcam enter any character)
"""
  • Other options to Edit
   """
       You can go to the utilities/config.py and change the threshold values based on the video and system requirements.
   """
   # If you want to use GPU:
   Set USE_GPU = True
   # If you want to increase or decrease the minimum threshold distance
   Modify the DIST_THRES value
   # If you want to change the Non Maximum Supression Threshold or Confidence Threshold
   Modify the NMS_THRESH or CONF_THRESH values respectively
  • Dectivate the Virtual Environment (after you are done)
(sdd) $ deactivate

License

License
This project is under the Apache-2.0 License License. See LICENSE for Details.

Contributors


Pranav B Kashyap


Prakhar Singh


Avi Tewari

Owner
Pranav B
Pranav B
XViT - Space-time Mixing Attention for Video Transformer

XViT - Space-time Mixing Attention for Video Transformer This is the official implementation of the XViT paper: @inproceedings{bulat2021space, title

Adrian Bulat 33 Dec 23, 2022
K Closest Points and Maximum Clique Pruning for Efficient and Effective 3D Laser Scan Matching (To appear in RA-L 2022)

KCP The official implementation of KCP: k Closest Points and Maximum Clique Pruning for Efficient and Effective 3D Laser Scan Matching, accepted for p

Yu-Kai Lin 109 Dec 14, 2022
Build a medical knowledge graph based on Unified Language Medical System (UMLS)

UMLS-Graph Build a medical knowledge graph based on Unified Language Medical System (UMLS) Requisite Install MySQL Server 5.6 and import UMLS data int

Donghua Chen 6 Dec 25, 2022
🕵 Artificial Intelligence for social control of public administration

Non-tech crash course into Operação Serenata de Amor Tech crash course into Operação Serenata de Amor Contributing with code and tech skills Supportin

Open Knowledge Brasil - Rede pelo Conhecimento Livre 4.4k Dec 31, 2022
A collection of Reinforcement Learning algorithms from Sutton and Barto's book and other research papers implemented in Python.

Reinforcement-Learning-Notebooks A collection of Reinforcement Learning algorithms from Sutton and Barto's book and other research papers implemented

Pulkit Khandelwal 1k Dec 28, 2022
Official implementation of the paper "Steganographer Detection via a Similarity Accumulation Graph Convolutional Network"

SAGCN - Official PyTorch Implementation | Paper | Project Page This is the official implementation of the paper "Steganographer detection via a simila

ZHANG Zhi 1 Nov 26, 2021
Pcos-prediction - Predicts the likelihood of Polycystic Ovary Syndrome based on patient attributes and symptoms

PCOS Prediction 🥼 Predicts the likelihood of Polycystic Ovary Syndrome based on

Samantha Van Seters 1 Jan 10, 2022
SCU OlympicsRunning Baseline

Competition 1v1 running Environment check details in Jidi Competition RLChina2021智能体竞赛 做出的修改: 奖励重塑:修改了环境,重新设置了奖励的分配,使得奖励组成不只有零和博弈,还有探索环境的奖励。 算法微调:修改了官

ZiSeoi Wong 2 Nov 23, 2021
Morphable Detector for Object Detection on Demand

Morphable Detector for Object Detection on Demand (ICCV 2021) PyTorch implementation of the paper Morphable Detector for Object Detection on Demand. I

9 Feb 23, 2022
Preprocessed Datasets for our Multimodal NER paper

Unified Multimodal Transformer (UMT) for Multimodal Named Entity Recognition (MNER) Two MNER Datasets and Codes for our ACL'2020 paper: Improving Mult

76 Dec 21, 2022
Code repository accompanying the paper "On Adversarial Robustness: A Neural Architecture Search perspective"

On Adversarial Robustness: A Neural Architecture Search perspective Preparation: Clone the repository: https://github.com/tdchaitanya/nas-robustness.g

Chaitanya Devaguptapu 4 Nov 10, 2022
A robust pointcloud registration pipeline based on correlation.

PHASER: A Robust and Correspondence-Free Global Pointcloud Registration Ubuntu 18.04+ROS Melodic: Overview Pointcloud registration using correspondenc

ETHZ ASL 101 Dec 01, 2022
Distributed Deep learning with Keras & Spark

Elephas: Distributed Deep Learning with Keras & Spark Elephas is an extension of Keras, which allows you to run distributed deep learning models at sc

Max Pumperla 1.6k Jan 05, 2023
Face Recognize System on camera AI OAK1

FRS on OAK1 Face Recognize System on camera OAK1 This project contains our work that deploy on camera OAK1 Features Anti-Spoofing Face detection Face

Tran Anh Tuan 6 Aug 08, 2022
Aircraft design optimization made fast through modern automatic differentiation

Aircraft design optimization made fast through modern automatic differentiation. Plug-and-play analysis tools for aerodynamics, propulsion, structures, trajectory design, and much more.

Peter Sharpe 394 Dec 23, 2022
Boundary-aware Transformers for Skin Lesion Segmentation

Boundary-aware Transformers for Skin Lesion Segmentation Introduction This is an official release of the paper Boundary-aware Transformers for Skin Le

Jiacheng Wang 79 Dec 16, 2022
Awesome Remote Sensing Toolkit based on PaddlePaddle.

基于飞桨框架开发的高性能遥感图像处理开发套件,端到端地完成从训练到部署的全流程遥感深度学习应用。 最新动态 PaddleRS 即将发布alpha版本!欢迎大家试用 简介 PaddleRS是遥感科研院所、相关高校共同基于飞桨开发的遥感处理平台,支持遥感图像分类,目标检测,图像分割,以及变化检测等常用遥

146 Dec 11, 2022
MazeRL is an application oriented Deep Reinforcement Learning (RL) framework

MazeRL is an application oriented Deep Reinforcement Learning (RL) framework, addressing real-world decision problems. Our vision is to cover the complete development life cycle of RL applications ra

EnliteAI GmbH 222 Dec 24, 2022
Code for ACL 2019 Paper: "COMET: Commonsense Transformers for Automatic Knowledge Graph Construction"

To run a generation experiment (either conceptnet or atomic), follow these instructions: First Steps First clone, the repo: git clone https://github.c

Antoine Bosselut 575 Jan 01, 2023
Improving Calibration for Long-Tailed Recognition (CVPR2021)

MiSLAS Improving Calibration for Long-Tailed Recognition Authors: Zhisheng Zhong, Jiequan Cui, Shu Liu, Jiaya Jia [arXiv] [slide] [BibTeX] Introductio

DV Lab 116 Dec 20, 2022