Coder Social home page Coder Social logo

socialdistancingai's Introduction

SocialDistancingAI

Using python, deep learning and computer vision to monitor social distancing. Idea Credits: LandingAI

Watch the video

How to install?

It’s advisable to make a new virtual environment for this project and install the dependencies. Following steps can be taken to download get started with the project

Clone the repository

git clone https://github.com/aqeelanwar/SocialDistancingAI.git

Install required packages

The provided requirements.txt file can be used to install all the required packages. Use the following command

cd SocialDistancingAI
pip install –r requirements.txt

Run the project

cd SocialDistancingAI
python main.py --videpath "vid_short.mp4"

Running main.py will open a window of the first frame in the video. At this point the code expects the user to mark 6 points by clicking appropriate positions on the frame.

First 4 points:

The first 4 among the 6 required points are used to mark the Region of Interest (ROI) where you want to monitor. Moreover, the lines marked by these points should be parallel lines in real world as seen from above. For example these lines could be the curbs of the road. These 4 points need to be provided in a pre-defined order which is following.

  • Point1 (bl): Bottom left
  • Point2 (br): Bottom right
  • Point3 (tl): Top left
  • Point4 (tr): Top right

Last 2 points:

The last two points are used to mark two points 6 feet apart in the region of interest. For example this could be a person's height (easier to mark on the frame)

The gif below will help understand the points better mark4points mark4points

How does it work?

The complete block diagram of the algorithm can be seen below. Block Diagram

A detailed article on the working of this project can be found here

Idea credits: LandingAI

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.