Skip to content

Varuni08/People-Tracking-Zone-Monitoring

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Real-Time People Tracking and Zone Monitoring

A computer vision system that detects and tracks people in video using YOLOv8. It assigns persistent IDs, monitors a defined zone, calculates dwell time, and logs alerts when a person remains inside the zone for more than three seconds.

Features

  • Real-time person detection using YOLOv8
  • Persistent multi-object tracking
  • Unique tracking ID for each detected person
  • Configurable monitored zone
  • Per-person dwell-time calculation
  • Automatic alerts after three seconds inside the zone
  • Timestamped alert logging
  • Live confidence scores and tracking statistics

Use Cases

  • Retail customer movement analysis
  • Restricted-area monitoring
  • Queue and waiting-time analysis
  • Workplace safety monitoring
  • Occupancy and behavioural analytics

Installation

pip install -r requirements.txt

## Usage

Place a video named retail_store.mp4 in the project directory and run:

python people_tracker.py

Press q to stop the application.

The YOLOv8 model weights are downloaded automatically by Ultralytics when the program runs for the first time.

## Configuration

Change the monitored zone coordinates inside people_tracker.py:

ZONE = (200, 300, 800, 600)

The values represent:

(x1, y1, x2, y2)

To use another video, update:

run(source="retail_store.mp4")

## Alert Logic

When the centre point of a tracked person's bounding box enters the monitored zone, the system begins calculating dwell time.

An alert is generated when the same person remains inside the zone for more than three seconds.

Alerts are written to:

tracking_log.txt

## Project Structure

People-Tracking/
├── people_tracker.py
├── requirements.txt
├── README.md
└── .gitignore

Model weights, videos, generated logs, virtual environments, and cache files are excluded from the repository.

About

Real-time person-tracking with YOLOv8, zone-dwell analytics and automatic alerts.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages