badalyaz / in-out-detection

Perosn In/Out detection using YOLOv5.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Person In/Out

License: MIT

Person In/Out Detection algorithm based on the original YOLOv5.

GUI Description

The algorithm uses YOLOv5 for person and door detection.

To run the GUI app, follow the below instructions:

  • Run the script,
python3 app.py
  • Click the start button to open the view from the camera,
  • Click the detect door button to run the main algorithm.

Algorithm Description

The In/Out algorithm is implemented in a straightforward way. After a door is detected by Door YOLO, Person YOLO turns on and works until the window is closed.

Note: For getting the instructions on how to download the Door Detection model, go to the models/README.md.

When a person is located closer than a threshold distance from the door (called a threshold zone around the door), he is detected by YOLO. After the person disappears from the YOLO detector's sight, it takes the person’s bounding box from the last frame where the person was visible and computes the IoM (Intersection over Minimum) of the bounding box and the door. If the IoM is greater than a threshold, the output is - "Out", if it is smaller - "In".

In/Out event Examples

Camera In/Out event Gif
Cam. 1 In

Cam. 2 Out

Cam. 3 In

Cam. 4 Out

How to use

A quick guide on how to create an anaconda environment, download the dependencies and run the application:

About

Perosn In/Out detection using YOLOv5.

License:MIT License


Languages

Language:Python 55.0%Language:Jupyter Notebook 44.3%Language:Shell 0.5%Language:Dockerfile 0.2%