a computer vision project that provides a real-time crowd control analysis dashboard utilizing the YOLOv8-seg model for object detection. The system tracks people’s movement and analyzes crowd density, speed, and occupancy metrics from uploaded videos SAHI (Slicing Aided Hyper Inference) model was used to optimize inference results, ensuring improved detection accuracy and efficiency.
- Object Detection: Utilizes the YOLOv8-seg model to detect people in video frames.
- Speed Calculation: Tracks the movement of individuals and calculates their speed.
- Hexbin Density Plot: Displays the density of people in the frame as a hexbin plot.
- Real-time Alerts: Triggers alerts if the density or speed exceeds user-defined thresholds.
- Real-time Charts: Includes visualizations for crowd density, rate of change in density, and occupancy over time.
- Crowd Count: Real-time calculation of the number of people in each frame.
- Occupancy Percentage: Calculates the percentage of the frame occupied by people.
-
Clone this repository:
git clone https://github.com/NadaQQ/CV-Crowd-Management.git
-
Install the required dependencies
pip install -r requirements.txt
-
Ensure you have a YOLO model weights file (
best80.pt). -
Run the Streamlit app:
streamlit run crowd-control-dashboard.py
This project requires the following dependencies:
ultralytics: YOLO model for object detectionstreamlit: Framework for building the dashboardopencv-python: For video processingplotly: For creating interactive plotsmatplotlib: For hexbin plotsscipy: For calculating the Euclidean distance in speed analysisnumpy: For numerical operationsSAHI: SAHI model to optimize inference results
- Upload a video file via the dashboard.
- Adjust the density and speed thresholds using the sidebar.
- View real-time crowd analysis.


