Giter Club home page Giter Club logo

rushidarge / people-tracking-and-counting Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 21.95 MB

This project utilizes the YOLO (You Only Look Once) object detection algorithm combined with the ByteTrack multi-object tracking algorithm to monitor and count people passing a specified marker. The direction of movement (right-to-left or left-to-right) is recorded, and counters are incremented accordingly.

Python 100.00%
bytetrack cnn deep-learning object-detection object-tracking yolo yolov9

people-tracking-and-counting's Introduction

People Tracking with YOLO and ByteTrack

This project tracks people using the YOLO and ByteTrack algorithms, counting individuals passing a marker and categorizing their direction as right-to-left or left-to-right.

Demo

Our crossing line is between the pole and the noticeboard bottom.

video_2_demo.mp4

Table of Contents

Description

This project utilizes the YOLO (You Only Look Once) object detection algorithm combined with the ByteTrack multi-object tracking algorithm to monitor and count people passing a specified marker. The direction of movement (right-to-left or left-to-right) is recorded, and counters are incremented accordingly.

Working:

  1. Read Video:

    • The code starts by loading a video or connecting to a live camera feed. This is like pressing play on a video player.
  2. Finding People (YOLO):

    • The code uses a deep learning model called YOLO (You Only Look Once) to find people in each frame of the video. Think of YOLO as a really smart pair of glasses that can spot people instantly in any picture.
  3. Tracking People (ByteTrack):

    • Once YOLO spots a person, ByteTrack takes over to follow that person as they move from one frame to the next. ByteTrack is like a high-tech tracking algorithm that keeps an eye on each person so it knows where they go.
  4. Counting People:

    • The code has a "marker" or an imaginary line in the video (that it gets from the mask.png file). Whenever a person crosses this line, the code notes down which direction they are moving:
      • If they cross from right to left, one counter goes up.
      • If they cross from left to right, another counter goes up.
  5. Displaying Results:

    • The code continuously updates and shows the counts for how many people have crossed the line in each direction. This is like a scoreboard that keeps track of the movement of people in real time.

Installation

  1. Clone the repository:

    git clone https://github.com/rushidarge/People-Tracking-and-Counting.git
    cd People-Tracking-and-Counting
  2. Create and activate a virtual environment (optional but recommended):

    python3 -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install the required dependencies:

    pip install -r requirements.txt

Usage

  1. Prepare your input video or camera feed.
  2. Update your path for video, mask, and out in config.json
  3. Run the main tracking script:
    python get_count_dynamic.py
  4. View the results and counters in the console output or as specified in the configuration.
  5. Your video is saved in videos/predicition_output/

Features

  • Person detection using YOLO
  • Multi-object tracking with ByteTrack
  • Direction-based counting
  • Easy configuration and customization

Limitation

  • We need to tune our logic sometimes we miss a person from counting.
  • If people are overlapping we lose track of them.
  • Two people walking simultaneously then we miss that person in counting, we need to place the camera strategically.
  • To make it real-time we need GPU.

Bibliography

Yolo Model : https://github.com/WongKinYiu/yolov9

Bytetrack Algorithm: https://medium.com/tech-blogs-by-nest-digital/object-tracking-object-detection-tracking-using-bytetrack-0aafe924d292

Ultralytics: https://docs.ultralytics.com/modes/track/

people-tracking-and-counting's People

Contributors

rushidarge avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.