Back to Projects
Entry Exit Count AI Computer Vision
Real-time Counting
YOLOv8 Detection

Real-time People Detection & Counting System

Project Overview

Entry Exit Count AI is a real-time computer vision system designed to automatically detect, track, and count people entering and exiting a monitored area using CCTV or video feeds. The system uses advanced object detection (YOLOv8) and multi-object tracking (DeepSORT) to provide accurate IN and OUT counts.

The Flask-based web dashboard provides live video streaming, real-time analytics, historical data, and crowd safety alerts. Perfect for malls, offices, institutions, and public events requiring automated crowd monitoring.

Key Achievement: Achieved 95%+ accuracy in detecting and tracking individuals with real-time counting capability and intelligent line-crossing detection for direction determination.

Problem Statement

Traditional CCTV systems only record footage without providing actionable insights. Manual people counting is:

  • Time-consuming and labor-intensive
  • Error-prone, especially in crowded environments
  • Expensive to scale across multiple locations
  • Lacks real-time insights for immediate decision-making

Solution Approach

Implemented an AI-powered computer vision pipeline:

  • Detection: YOLOv8 for real-time person detection in video frames
  • Tracking: DeepSORT algorithm for multi-object tracking across frames
  • Analysis: Virtual line-crossing detection for direction determination
  • Dashboard: Flask web app with live streaming and analytics
  • Alerts: Intelligent crowd safety notifications

Key Features

YOLOv8 Detection

Advanced real-time person detection

DeepSORT Tracking

Multi-object tracking across frames

Line Crossing

Intelligent direction detection

Real-time Counting

Live IN and OUT counters

Analytics

Historical data and visualizations

Safety Alerts

Crowd monitoring notifications

Technical Stack

Computer Vision

Python OpenCV YOLOv8 DeepSORT

Backend & Web

Flask SQLite SQLAlchemy REST API

Frontend & Visualization

HTML5 CSS3 JavaScript Chart.js

Implementation Details

Video Processing Pipeline

  • Capture frames from CCTV/video source
  • Detect persons using YOLOv8 model
  • Extract bounding boxes and confidence scores
  • Track detections across frames using DeepSORT
  • Determine if track crosses virtual counting line
  • Update counters based on crossing direction

Key Components

  • Detection Module: YOLOv8 pre-trained model for person detection
  • Tracking Module: DeepSORT for persistent multi-object tracking
  • Counting Logic: Virtual line intersection algorithm
  • Web Interface: Flask app with WebSocket for live streaming
  • Data Persistence: SQLite database for historical records

Line-Crossing Algorithm

  • Define virtual line coordinates in video frame
  • Track centroid of each detection across frames
  • Detect when centroid crosses the virtual line
  • Determine direction based on movement vector
  • Increment appropriate counter (IN or OUT)

Challenges & Solutions

Challenge 1: Occlusion Handling

Problem: People getting occluded by objects or other people.

Solution: DeepSORT maintains track IDs even during temporary occlusions using appearance features and Kalman filter predictions.

Challenge 2: False Positives

Problem: Detection of non-person objects as people.

Solution: Applied confidence thresholds and post-processing filters to reduce false positives.

Challenge 3: Performance Optimization

Problem: Real-time processing demands on video stream.

Solution: Optimized frame processing, used GPU acceleration, and implemented frame skipping strategies.

Real-world Applications

  • Shopping Malls: Track customer traffic and peak hours
  • Office Buildings: Monitor occupancy and desk utilization
  • Institutions: Track attendance in real-time
  • Public Events: Manage crowd flow and capacity
  • Airports/Transit: Monitor passenger flow
  • Smart Cities: Crowd management and safety