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
ICCV2021: Code for 'Spatial Uncertainty-Aware Semi-Supervised Crowd Counting'

ICCV2021: Code for 'Spatial Uncertainty-Aware Semi-Supervised Crowd Counting'

Yanda Meng 14 May 13, 2022
Video Corpus Moment Retrieval with Contrastive Learning (SIGIR 2021)

Video Corpus Moment Retrieval with Contrastive Learning PyTorch implementation for the paper "Video Corpus Moment Retrieval with Contrastive Learning"

ZHANG HAO 42 Dec 29, 2022
PyTorch implementation of CVPR 2020 paper (Reference-Based Sketch Image Colorization using Augmented-Self Reference and Dense Semantic Correspondence) and pre-trained model on ImageNet dataset

Reference-Based-Sketch-Image-Colorization-ImageNet This is a PyTorch implementation of CVPR 2020 paper (Reference-Based Sketch Image Colorization usin

Yuzhi ZHAO 11 Jul 28, 2022
Python port of R's Comprehensive Dynamic Time Warp algorithm package

Welcome to the dtw-python package Comprehensive implementation of Dynamic Time Warping algorithms. DTW is a family of algorithms which compute the loc

Dynamic Time Warping algorithms 154 Dec 26, 2022
Adaptable tools to make reinforcement learning and evolutionary computation algorithms.

Pearl The Parallel Evolutionary and Reinforcement Learning Library (Pearl) is a pytorch based package with the goal of being excellent for rapid proto

38 Jan 01, 2023
MWPToolkit is a PyTorch-based toolkit for Math Word Problem (MWP) solving.

MWPToolkit is a PyTorch-based toolkit for Math Word Problem (MWP) solving. It is a comprehensive framework for research purpose that integrates popular MWP benchmark datasets and typical deep learnin

119 Jan 04, 2023
Tutorial on active learning with the Nvidia Transfer Learning Toolkit (TLT).

Active Learning with the Nvidia TLT Tutorial on active learning with the Nvidia Transfer Learning Toolkit (TLT). In this tutorial, we will show you ho

Lightly 25 Dec 03, 2022
Cobalt Strike teamserver detection.

Cobalt-Strike-det Cobalt Strike teamserver detection. usage: cobaltstrike_verify.py [-l TARGETS] [-t THREADS] optional arguments: -h, --help show this

TimWhite 17 Sep 27, 2022
Pytorch implementation for "Implicit Feature Alignment: Learn to Convert Text Recognizer to Text Spotter".

Implicit Feature Alignment: Learn to Convert Text Recognizer to Text Spotter This is a pytorch-based implementation for paper Implicit Feature Alignme

wangtianwei 61 Nov 12, 2022
A python implementation of Deep-Image-Analogy based on pytorch.

Deep-Image-Analogy This project is a python implementation of Deep Image Analogy.https://arxiv.org/abs/1705.01088. Some results Requirements python 3

Peng Lu 171 Dec 14, 2022
Context Decoupling Augmentation for Weakly Supervised Semantic Segmentation

Context Decoupling Augmentation for Weakly Supervised Semantic Segmentation The code of: Context Decoupling Augmentation for Weakly Supervised Semanti

54 Dec 12, 2022
Code for the paper "On the Power of Edge Independent Graph Models"

Edge Independent Graph Models Code for the paper: "On the Power of Edge Independent Graph Models" Sudhanshu Chanpuriya, Cameron Musco, Konstantinos So

Konstantinos Sotiropoulos 0 Oct 26, 2021
Vehicle speed detection with python

Vehicle-speed-detection In the project simulate the tracker.py first then simulate the SpeedDetector.py. Finally, a new window pops up and the output

3 Dec 15, 2022
Regression Metrics Calculation Made easy for tensorflow2 and scikit-learn

Regression Metrics Installation To install the package from the PyPi repository you can execute the following command: pip install regressionmetrics I

Ashish Patel 11 Dec 16, 2022
Implementation of Geometric Vector Perceptron, a simple circuit for 3d rotation equivariance for learning over large biomolecules, in Pytorch. Idea proposed and accepted at ICLR 2021

Geometric Vector Perceptron Implementation of Geometric Vector Perceptron, a simple circuit with 3d rotation equivariance for learning over large biom

Phil Wang 59 Nov 24, 2022
Pytorch reimplement of the paper "A Novel Cascade Binary Tagging Framework for Relational Triple Extraction" ACL2020. The original code is written in keras.

CasRel-pytorch-reimplement Pytorch reimplement of the paper "A Novel Cascade Binary Tagging Framework for Relational Triple Extraction" ACL2020. The o

longlongman 170 Dec 01, 2022
AlphaNet Improved Training of Supernet with Alpha-Divergence

AlphaNet: Improved Training of Supernet with Alpha-Divergence This repository contains our PyTorch training code, evaluation code and pretrained model

Facebook Research 87 Oct 10, 2022
PoseCamera is python based SDK for human pose estimation through RGB webcam.

PoseCamera PoseCamera is python based SDK for human pose estimation through RGB webcam. Install install posecamera package through pip pip install pos

WonderTree 7 Jul 20, 2021
State-of-the-art language models can match human performance on many tasks

Status: Archive (code is provided as-is, no updates expected) Grade School Math [Blog Post] [Paper] State-of-the-art language models can match human p

OpenAI 259 Jan 08, 2023
ByteTrack(Multi-Object Tracking by Associating Every Detection Box)のPythonでのONNX推論サンプル

ByteTrack-ONNX-Sample ByteTrack(Multi-Object Tracking by Associating Every Detection Box)のPythonでのONNX推論サンプルです。 ONNXに変換したモデルも同梱しています。 変換自体を試したい方はByteT

KazuhitoTakahashi 16 Oct 26, 2022