Giter Site home page Giter Site logo

peoplecounting's Introduction

People Counting

Project Aim

The aim of this project is to develop a robust system for counting people in crowded environments using advanced computer vision techniques. This involves using the YOLOv8 model, which is known for its high performance in object detection tasks, to detect and track individuals in video feeds. The project focuses on accurately counting the number of people crossing a predefined line, making it applicable for scenarios such as traffic monitoring and managing crowd flow in public areas.

Project Overview

The primary goal of this repository is to implement a people counting system using the YOLOv8 object detection model from Ultralytics. The model is trained on the Crowd Human dataset [1], the CrowdHuman dataset is large, rich-annotated and contains high diversity, ensuring it can generalize well across different environments with varied crowd densities. The system processes video feeds, detects and tracks people, and counts how many cross a designated line in the video.

Table of Contents

Getting Started

Prerequisites

  • Python
  • YOLOv8 (Ultralytics)

Installation

  1. Clone the repository: git clone https://github.com/omerAJ/peopleCounting.git cd people-counting

  2. Install required Python libraries: pip install -r requirements.txt

Usage

Detection

  • Just detect and count

    • Use the provided script in Scripts/counting.py to run the YOLOv8 model on your video feed. This script loads the pre-trained YOLOv8 model and applies it to detect and count people in the video, it tracks the detected individuals across frames and counts how many cross a predefined line in the video feed. Adjust the line coordinates in the script based on your specific requirements.
  • Count and collect GT

    • In addition to detect and count this code can also be used to collect GT counts to evaluate performance of model. As you watch the video, the model counts are automatically incremented and you can use key presses to count the actual people in/out.

Training

Dataset

The crowd human dataset used for training the YOLO is placed in D://omer/crowdHuman The folder includes:

  1. original data
  2. data converted to YOLO format
  3. annotation of head of human

Training

  • use train.py to train the model, provide it path to the data.yaml file and select the model you want to train.

Pre-trained weights

  • all pretrained models are saved in D://omer/YOLO_weights

Contributing

Full credits to the mentioned papers.

[1] @article{shao2018crowdhuman, title={CrowdHuman: A Benchmark for Detecting Human in a Crowd}, author={Shao, Shuai and Zhao, Zijian and Li, Boxun and Xiao, Tete and Yu, Gang and Zhang, Xiangyu and Sun, Jian}, journal={arXiv preprint arXiv:1805.00123}, year={2018} }

Acknowledgements

  • This project was done at Centre for Urban Informatics, Technology, and Policy (CITY @ LUMS)

peoplecounting's People

Contributors

omeraj avatar

Stargazers

Fine avatar  avatar

Watchers

 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.