Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Python cache and build artifacts
__pycache__/
*.py[cod]
*.pyo
*.pyd
*.so
*.egg-info/
build/
dist/

# Virtual environments
.venv/
venv/
env/
ENV/

# Notebook and editor artifacts
.ipynb_checkpoints/
.vscode/
.idea/

# Test and coverage output
.pytest_cache/
.coverage
.coverage.*
htmlcov/

# Logs and local environment files
*.log
.env
.env.*

# Model artifacts
*.pt
*.pth
*.onnx

# Data and generated outputs
data/
outputs/
results/
runs/
checkpoints/
temp/
tmp/

# Media artifacts
*.mp4
*.avi
*.mov
*.mkv
*.png
*.jpg
*.jpeg
*.csv
*.json

# OS files
.DS_Store
Thumbs.db
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
# Crowd Monitoring Module (Orion Project)

## Overview

This repository contains the Crowd Monitoring module for the Orion project under Redback Operations.

The purpose of this module is to analyse stadium crowd behaviour and density using computer vision and data analytics. The expected outputs include:

- crowd heatmaps
- density metrics
- zone-based analytics
- behaviour insights for integration into the Orion analytics dashboard

## Objectives

- Detect and analyse spectators in stadium footage
- Estimate crowd density and distribution
- Generate zone-based crowd analytics
- Produce crowd heatmaps and visualisations
- Develop AI-based crowd behaviour analysis
- Optionally predict future attendance using machine learning models

## Proposed Pipeline

```text
Video Input
|
v
Frame Extraction (OpenCV)
|
v
Person Detection (YOLOv8)
|
v
Crowd Density Estimation
|
v
Zone-based Analysis
|
v
Heatmap Generation
|
v
Analytics Output (JSON / CSV)
|
v
Behaviour Analysis / Prediction
```

## Tech Stack

- Python
- YOLOv8 (Ultralytics)
- OpenCV
- NumPy
- Pandas

## 👥 Team Tasks (7 Members)

Each team member owns one task. Follow the README in each task folder for detailed objectives and deliverables.

| # | Task Folder | Team Member | Objective |
|---|-------------|-------------|-----------|
| 1 | **video_processing** | Member 1 | Extract frames and prepare video data |
| 2 | **crowd_detection** | Member 2 | Detect persons using YOLOv8 |
| 3 | **density_zoning** | Member 3 | Calculate density and zone-based analytics |
| 4 | **heatmap** | Member 4 | Generate crowd heatmaps |
| 5 | **analytics_output** | Member 5 | Create reports and output files (JSON/CSV) |
| 6 | **crowd_behaviour_analytics** | Member 6 | Analyze crowd movement and behavior patterns |
| 7 | **crowd_allocation_risk_zone** | Member 7 | Assess risk levels and crowd allocation strategy |

**Optional:** `prediction_optional/` - Attendance prediction (if time permits)

---

## Task Guidance

Each task folder contains its own `README.md` with:

- 🎯 Task objective
- 📥 Expected inputs and outputs
- 💡 Implementation notes
- ✅ Suggested deliverables

This keeps the semester plan split into smaller, easier-to-manage work packages.

---

## Project Structure

```text
2026_T1/
|-- data/ # Sample videos and frames
|-- docs/ # Documentation and notes
|-- shared/ # Common utilities and configs
|-- requirements.txt # Dependencies
|-- README.md # This file
|
|-- Task Folders (one per member):
|-- video_processing/ # Task 1: Video extraction & preparation
|-- crowd_detection/ # Task 2: Person detection (YOLOv8)
|-- density_zoning/ # Task 3: Density & zone analysis
|-- heatmap/ # Task 4: Heatmap generation
|-- analytics_output/ # Task 5: Report generation
|-- crowd_behaviour_analytics/ # Task 6: Behavior analysis
|-- crowd_allocation_risk_zone/ # Task 7: Risk assessment & allocation
|
|-- Optional:
`-- prediction_optional/ # Optional: Attendance prediction
```

---

## 🚀 Getting Started

1. **Find your task** in the table above
2. **Read the README** in your task folder
3. **Follow the implementation notes**
4. **Deliver outputs** as specified
5. **Update your README** with progress

---

## 📋 Integration Points

Tasks run in sequence:

```
video_processing (Task 1)
crowd_detection (Task 2)
density_zoning (Task 3)
heatmap (Task 4) + analytics_output (Task 5)
crowd_behaviour_analytics (Task 6)
crowd_allocation_risk_zone (Task 7)
Dashboard / Report Integration
```

---

## 💬 Collaboration

- **Shared utilities:** Use files in `shared/` folder
- **Input/Output:** Check task README for I/O specifications
- **Questions:** Document in docs/ folder
- **Results:** Save outputs to designated location in your task folder
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Analytics Output

## Objective

Generate structured outputs that can be consumed by the Orion dashboard or related services.

## Scope

- Export analysis results in JSON and CSV formats
- Define a clean schema for crowd metrics
- Prepare data for backend and frontend integration

## Inputs

- Detection results
- Density and zoning summaries
- Heatmap metadata if relevant

## Outputs

- JSON files
- CSV files
- A documented output structure

## Implementation Notes

- Keep field names stable and descriptive
- Include timestamps, frame IDs, and zone metrics where useful
- Design the structure so it can be used before full production data exists
- Prefer simple schemas first, then extend only if needed

## Suggested Deliverables

- A serializer or export script
- Example JSON and CSV output
- A short schema note in this folder or `docs/`
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Crowd Allocation & Risk Zone Planning

## Objective

Assess crowd safety risk levels across zones and provide recommendations for crowd allocation and management strategies to prevent dangerous situations.

## Scope

- Identify high-risk zones based on crowd density thresholds
- Assess cumulative risk factors (density, behavior, movement patterns)
- Create risk zone maps for different crowd levels
- Suggest crowd allocation strategies to balance load
- Develop evacuation or crowd control recommendations

## Inputs

- Per-zone density counts from density_zoning task
- Crowd behaviour analysis from crowd_behaviour_analytics task
- Zone definitions and capacity data
- Historical incident or risk data (if available)

## Outputs

- Risk zone classifications (low, medium, high, critical)
- Risk heatmaps with threshold indicators
- Crowd allocation recommendations
- Safety alerts and warnings
- Evacuation route suggestions (if applicable)

## Implementation Notes

- Define clear density thresholds for each risk level per zone
- Combine density metrics with behavior flags to assess risk
- Keep allocation recommendations practical and implementable
- Focus first on identifying critical zones, then suggest improvements
- Document risk thresholds and decision logic clearly

## Suggested Deliverables

- Risk zone map visualization
- Allocation recommendation report (JSON/CSV)
- Risk threshold configuration file
- Examples showing critical scenarios and responses
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Crowd Behaviour Analytics

## Objective

Analyse movement patterns in the crowd and detect behaviour that may indicate risk or unusual conditions.

## Scope

- Analyse crowd movement over time
- Detect sudden crowd movement
- Detect abnormal behaviour
- Detect crowd surges

## Inputs

- Sequential detections across frames
- Optional tracking or motion features

## Outputs

- Behaviour event flags
- Movement summaries
- Data that can support alerting or dashboard visualisation

## Implementation Notes

- Start with simple movement heuristics before advanced models
- Compare position changes across frames
- Focus first on interpretable signals that are easy to validate
- Document assumptions clearly because this task can become ambiguous quickly

## Suggested Deliverables

- A prototype behaviour analysis script
- A few example scenarios or simulated cases
- A list of event definitions used by the module
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Crowd Detection

## Objective

Detect spectators in stadium footage using a person-level detection pipeline.

## Scope

- Run person detection on frames or video
- Focus on detecting spectators rather than general scene objects
- Compare results against the previous segmentation-based approach where useful
- Prepare detection outputs for density and zone analysis

## Inputs

- Extracted video frames
- Sample stadium footage

## Outputs

- Bounding boxes for detected people
- Confidence scores
- Structured detection results for later tasks

## Implementation Notes

- Use YOLOv8 through Ultralytics
- Start with the `person` class only
- Save outputs in a simple format such as JSON or CSV
- Record known failure cases such as occlusion, distance, and low lighting

## Suggested Deliverables

- A detection script or notebook
- Sample visual output with boxes drawn on frames
- A saved set of person coordinates or detections
Loading
Loading