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!
- 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)
- Clone the repository:
git clone https://github.com/Mercity-AI/Crowd-Management-Demo.git
cd Crowd-Management-Demo
- Create and activate a virtual environment:
python -m venv venv
# On Windows
.\venv\Scripts\activate
# On Linux/Mac
source venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
- Place your videos in the
videos
directory - Run the processing script:
python process_videos.py
- Check the
results
directory for processed videos
- Run the Streamlit app:
streamlit run streamlit_app.py
- Open your browser at http://localhost:8501
- Upload a video using the file uploader
- Click "Process Video" to start processing
- View the results and download the processed video
.
├── videos/ # Input videos directory
├── results/ # Processed videos with tracking
├── demo/ # Demo GIFs
├── process_videos.py
├── requirements.txt
└── README.md
The processed videos include:
- Green bounding boxes around detected people
- Person ID numbers for tracking
- Total person count in the top-left corner
- Python 3.8 or higher
- OpenCV
- PyTorch
- Ultralytics (YOLOv8)
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- YOLOv8 for the object detection model
- ByteTrack for the tracking algorithm