Skip to content

LorenzoAgnolucci/SocialDistancingDetector

Repository files navigation

Social Distancing Detector

Table of Contents

About The Project

Demo

In Social Distancing Detector we present a tool to monitor people's compliance to social distancing in crowded places in real-time. Our approach is based on YOLOv3 neural network to detect pedestrian in a video stream and on homography to get the bird view of a user-selected ROI. From people's position in the bird view we measure the pairwise distance and then we show the results.

For more information, read the report located in the repo root.

Built With

Getting Started

To get a local copy up and running follow these simple steps.

Installation

  1. Clone the repo
git clone https://github.com/LorenzoAgnolucci/SocialDistancingDetector.git
  1. Download the network weights from the link in yolo-coco/yolov3_weights.txt and copy them in the yolo-coco folder

  2. If you want to run the code on a GPU (strongly recommended but not necessary), follow this tutorial to compile OpenCV accordingly

  3. The project provides a requirements.txt file that can be used to install all the dependencies (except for OpenCV if you compiled it) in order to avoid dependency/reproducibility problems. For example in your virtual environment run

pip install -r requirements.txt

Usage

  1. If you want to calibrate your camera print a chessboard, take at least 20 photos from different angles and distances and copy them in a folder. Run camera_calibration.py modifying the paths and the chessboard parameters as needed

  2. If needed change the frame_to_skip parameter in VideoGet.py to skip an arbitrary number of frames to reduce the latency

  3. Run social_distance_detector.py and choose the input video stream (optionally adding the calibration matrices path) between the available ones:

    • Computer webcam
    • IP webcam
    • Local video (some examples are in /video)
    • Link to stream (some examples are in webcam_stream.txt)

Authors

Acknowledgments

Image and Video Analysis © Course held by Professor Pietro Pala - Computer Engineering Master Degree @University of Florence

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages