Skip to content

Mercity-AI/Crowd-Management-Demo

Repository files navigation

Crowd Management Demo

A real-time crowd management system using YOLOv8 for person detection and tracking. This system can process multiple video feeds to track and count people in crowds.

Built and managed by Mercity AI!

Read our detailed blog on Crowd Management Systems!

Demo

Crowd Tracking Demo 1 Crowd Tracking Demo 2

Features

  • Real-time person detection and tracking using YOLOv8
  • Multiple video processing support
  • Person counting and ID tracking
  • Visual bounding boxes and tracking IDs
  • Support for various video formats (mp4, avi, mov, mkv)

Installation

  1. Clone the repository:
git clone https://github.com/Mercity-AI/Crowd-Management-Demo.git
cd Crowd-Management-Demo
  1. Create and activate a virtual environment:
python -m venv venv
# On Windows
.\venv\Scripts\activate
# On Linux/Mac
source venv/bin/activate
  1. Install dependencies:
pip install -r requirements.txt

Usage

Command Line Processing

  1. Place your videos in the videos directory
  2. Run the processing script:
python process_videos.py
  1. Check the results directory for processed videos

Streamlit Web Interface

  1. Run the Streamlit app:
streamlit run streamlit_app.py
  1. Open your browser at http://localhost:8501
  2. Upload a video using the file uploader
  3. Click "Process Video" to start processing
  4. View the results and download the processed video

Project Structure

.
├── videos/          # Input videos directory
├── results/         # Processed videos with tracking
├── demo/           # Demo GIFs
├── process_videos.py
├── requirements.txt
└── README.md

Output

The processed videos include:

  • Green bounding boxes around detected people
  • Person ID numbers for tracking
  • Total person count in the top-left corner

Requirements

  • Python 3.8 or higher
  • OpenCV
  • PyTorch
  • Ultralytics (YOLOv8)

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • YOLOv8 for the object detection model
  • ByteTrack for the tracking algorithm

About

This is a PoC repository to show how to track and see people individually in a crowd.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages