Person In/Out Detection algorithm based on the original YOLOv5.
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.
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".
Camera | In/Out event | Gif |
---|---|---|
Cam. 1 | In | |
Cam. 2 | Out | |
Cam. 3 | In | |
Cam. 4 | Out |
A quick guide on how to create an anaconda environment, download the dependencies and run the application: