Skip to content

Project measuring if people follow the appropriate distance between themselves in order to prevent COVID-19 disease.

License

Notifications You must be signed in to change notification settings

arf111/Social-Distance-Awareness

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Social-Distance-Awareness

Project measuring if people follow the appropriate distance between themselves in order to prevent dispersement of COVID-19 disease.

  • Bird eye view is implemented to precisely measure the distance between detected objects. The red lines indicate the violated distance (6 ft).
  • For detection, Yolov5 model is used.

Prerequisites

Python 3.6 or later with dependencies requirements.txt installed. Run:

$ pip install -r requirements.txt

Getting Started

To run the program, perform:

$ python main.py

To use different model of Yolov5, use yolov5s for small, yolov5m for medium, yolov5l for large, or yolov5x for extra large model. More details here. For example:

$ python main.py --yolov yolov5m

Usage

The following steps occur when user runs the main.py file:

  1. First of all, a frame will be given of the input video to define the boundary region where the detection will occur. The user must click 4 points in the frame in the order of bottom-left, top-left, top-right, and bottom-right. Note that this ordering is really important to accurately find out the distance between people. The 4 points must form a rectangle in the designated region.
  2. After selecting 4 points, 2 extra points are needed from the user to define the approx. 6 ft. distance in the frame. This will be user-defined.
  3. Finally, the violated distances will be shown in original frame in accordance with the bird view frame. Yolov5 is used to detect each person.

References

  1. Perspective Transformation: https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_imgproc/py_geometric_transformations/py_geometric_transformations.html
  2. Yolov5: https://github.com/ultralytics/yolov5

About

Project measuring if people follow the appropriate distance between themselves in order to prevent COVID-19 disease.

Topics

Resources

License

Stars

Watchers

Forks