Skip to content

A dashboard for monitoring 1 meter social distancing for outdoor areas using computer vision

Notifications You must be signed in to change notification settings

tharakarehan/social-distancing-tracker

Repository files navigation

social-distancing-tracker

This is a dashboard for monitoring one meter social distancing for outdoor areas using computer vision. This can be implemented realtime on CPU thanks to OpenVino model optimisation. To track objects (people), SORT algorithm with Kalmann Filter (tracker) and Hungarian algorithm (data association) has been used. Pre-trained openvino people detection model (MobileNetV2 SSD) has been used for detection. Perspective transformation has been used to get the bird's eye view to enhance the distance measurement accuracy. OpenCV is used for image processing.

Demo: https://www.youtube.com/watch?v=joDZVKSOvhM

Installation

Install OpenVino 2021.4

Create a new conda environment. If you dont have conda installed download miniconda

conda create -n sdt python=3.8 

Clone this repository to your computer and navigate to the directory.

Activate new enviroment

conda activate std  

Install all the libraries used

pip install -r requirements.txt  

Initialize OpenVino

source /opt/intel/openvino_2021/bin/setupvars.sh  

Usage

Run the script run_sort.py

usage: run_sort.py [-h] [-i INPUT_FILE] -m MODEL_PATH [-t THRESHOLD]
                   [-o OUTPUT_FILE] [-c CAMERA] [--save] [--find_homography]
                   [--no_bbox] [--slow]

Run SORT

optional arguments:
  -h, --help            show this help message and exit
  -i INPUT_FILE, --input_file INPUT_FILE
                        input videos file path name
  -m MODEL_PATH, --model_path MODEL_PATH
                        path to the model
  -t THRESHOLD, --threshold THRESHOLD
                        threshold for detections
  -o OUTPUT_FILE, --output_file OUTPUT_FILE
                        output video file path name
  -c CAMERA, --camera CAMERA
                        camera stream index
  --save                whether to save the video
  --find_homography     if the transformation matrix is not available
  --no_bbox             circles will be drawn instead of bounding boxes
  --slow                reduce the fps of the video if too high

With Bounding Boxes for Visualization

License

MIT

Releases

No releases published

Packages

No packages published

Languages