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
Chinese Advertisement Board Identification(Pytorch)

Chinese-Advertisement-Board-Identification. We use YoloV5 to extract the ROI of the location of the chinese word. Next, we sort the bounding box and recognize every chinese words which we extracted.

Li-Wei Hsiao 12 Jul 21, 2022
Main repository for the HackBio'2021 Virtual Internship Experience for #Team-Greider ❤️

Hello 🤟 #Team-Greider The team of 20 people for HackBio'2021 Virtual Bioinformatics Internship 💝 🖨️ 👨‍💻 HackBio: https://thehackbio.com 💬 Ask us

Siddhant Sharma 7 Oct 20, 2022
Applying curriculum to meta-learning for few shot classification

Curriculum Meta-Learning for Few-shot Classification We propose an adaptation of the curriculum training framework, applicable to state-of-the-art met

Stergiadis Manos 3 Oct 25, 2022
nn_builder lets you build neural networks with less boilerplate code

nn_builder lets you build neural networks with less boilerplate code. You specify the type of network you want and it builds it. Install pip install n

Petros Christodoulou 157 Nov 20, 2022
A sample pytorch Implementation of ACL 2021 research paper "Learning Span-Level Interactions for Aspect Sentiment Triplet Extraction".

Span-ASTE-Pytorch This repository is a pytorch version that implements Ali's ACL 2021 research paper Learning Span-Level Interactions for Aspect Senti

来自丹麦的天籁 10 Dec 06, 2022
Code for "On the Effects of Batch and Weight Normalization in Generative Adversarial Networks"

Note: this repo has been discontinued, please check code for newer version of the paper here Weight Normalized GAN Code for the paper "On the Effects

Sitao Xiang 182 Sep 06, 2021
[ICLR'21] Counterfactual Generative Networks

This repository contains the code for the ICLR 2021 paper "Counterfactual Generative Networks" by Axel Sauer and Andreas Geiger. If you want to take the CGN for a spin and generate counterfactual ima

88 Jan 02, 2023
Deep Q-Learning Network in pytorch (not actively maintained)

pytoch-dqn This project is pytorch implementation of Human-level control through deep reinforcement learning and I also plan to implement the followin

Hung-Tu Chen 342 Jan 01, 2023
Codes of paper "Unseen Object Amodal Instance Segmentation via Hierarchical Occlusion Modeling"

Unseen Object Amodal Instance Segmentation (UOAIS) Seunghyeok Back, Joosoon Lee, Taewon Kim, Sangjun Noh, Raeyoung Kang, Seongho Bak, Kyoobin Lee This

GIST-AILAB 92 Dec 13, 2022
LibFewShot: A Comprehensive Library for Few-shot Learning.

LibFewShot Make few-shot learning easy. Supported Methods Meta MAML(ICML'17) ANIL(ICLR'20) R2D2(ICLR'19) Versa(NeurIPS'18) LEO(ICLR'19) MTL(CVPR'19) M

<a href=[email protected]&L"> 603 Jan 05, 2023
SANet: A Slice-Aware Network for Pulmonary Nodule Detection

SANet: A Slice-Aware Network for Pulmonary Nodule Detection This paper (SANet) has been accepted and early accessed in IEEE TPAMI 2021. This code and

Jie Mei 39 Dec 17, 2022
Reusable constraint types to use with typing.Annotated

annotated-types PEP-593 added typing.Annotated as a way of adding context-specific metadata to existing types, and specifies that Annotated[T, x] shou

125 Dec 26, 2022
Async API for controlling Hue Lights

Hue API Async API for controlling Hue Lights Documentation: hue-api.nirantak.com Source: github.com/nirantak/hue-api Installation This is an async cli

Nirantak Raghav 4 Nov 16, 2022
PixelPyramids: Exact Inference Models from Lossless Image Pyramids (ICCV 2021)

PixelPyramids: Exact Inference Models from Lossless Image Pyramids This repository contains the PyTorch implementation of the paper PixelPyramids: Exa

Visual Inference Lab @TU Darmstadt 8 Dec 11, 2022
[CVPR 2022] Unsupervised Image-to-Image Translation with Generative Prior

GP-UNIT - Official PyTorch Implementation This repository provides the official PyTorch implementation for the following paper: Unsupervised Image-to-

Shuai Yang 125 Jan 03, 2023
Unrolled Variational Bayesian Algorithm for Image Blind Deconvolution

unfoldedVBA Unrolled Variational Bayesian Algorithm for Image Blind Deconvolution This repository contains the Pytorch implementation of the unrolled

Yunshi HUANG 2 Jul 10, 2022
Adversarial Robustness Comparison of Vision Transformer and MLP-Mixer to CNNs

Adversarial Robustness Comparison of Vision Transformer and MLP-Mixer to CNNs ArXiv Abstract Convolutional Neural Networks (CNNs) have become the de f

Philipp Benz 12 Oct 24, 2022
RCD: Relation Map Driven Cognitive Diagnosis for Intelligent Education Systems

RCD: Relation Map Driven Cognitive Diagnosis for Intelligent Education Systems This is our implementation for the paper: Weibo Gao, Qi Liu*, Zhenya Hu

BigData Lab @USTC 中科大大数据实验室 10 Oct 16, 2022
CPU inference engine that delivers unprecedented performance for sparse models

The DeepSparse Engine is a CPU runtime that delivers unprecedented performance by taking advantage of natural sparsity within neural networks to reduce compute required as well as accelerate memory b

Neural Magic 1.2k Jan 09, 2023
PyTorch implementation of "Learn to Dance with AIST++: Music Conditioned 3D Dance Generation."

Learn to Dance with AIST++: Music Conditioned 3D Dance Generation. Installation pip install -r requirements.txt Prepare Dataset bash data/scripts/pre

Zj Li 8 Sep 07, 2021