Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
76a5e4a
branch testing
mayuselva Mar 19, 2026
e04c84c
test file removed
mayuselva Mar 19, 2026
634ab98
Creating new branch
quan-le Mar 19, 2026
3ed5971
Creating new branch
quan-le Mar 19, 2026
09fe012
Merge branch 'Player-Tracking' of https://github.com/lucastargett/red…
quan-le Mar 19, 2026
b2406a3
Remove test file
quan-le Mar 19, 2026
1c84fe9
created service structure & whole flow
mayuselva Mar 23, 2026
f5cd3e3
Added toggle highlight functionality to Player Performance stat cards
shalukasw Mar 24, 2026
d08bc1c
feat: implement video processing and update gitignore and add config …
aniket939 Mar 25, 2026
12b82e6
Implement crowd allocation risk zone assessment - density-based risk …
s225009786 Mar 27, 2026
9b15089
Merge pull request #1 from s225009786/CM/density-zoning-SP1-new
lucastargett Mar 29, 2026
7452f35
crowd detection implementation
ShivamSaini09 Mar 29, 2026
0fd0ac0
implement baseline crowd behaviour analysis
mayuselva Mar 30, 2026
6c440fe
Merge pull request #3 from lucastargett/CM/crowd-behaviour-analytics-…
MAYURA26-bot Mar 30, 2026
4287fd5
Merge pull request #4 from lucastargett/CM/Video-processing-SP1-new
MAYURA26-bot Mar 30, 2026
3249f8a
Merge pull request #5 from lucastargett/CM/crowd-detection-SP1-new
MAYURA26-bot Mar 30, 2026
322790d
crowd_allocation_risk_zone copied
mayuselva Mar 30, 2026
a2b5f43
Implement auth and health schemas with route integration
lucastargett Mar 30, 2026
da15a5a
correction cm/crowd_behaviour_analytics - missed zones to send as output
mayuselva Mar 30, 2026
446cabb
update ignore file to allow shared config and add vidoe processing co…
aniket939 Mar 30, 2026
6afae27
Merge pull request #6 from lucastargett/CM/Video-processing-SP1-new
MAYURA26-bot Mar 30, 2026
bc727e0
add density zoning logic
TolaniRidmini Mar 30, 2026
278272c
Merge branch 'CM/density-zoning-SP1-new' of https://github.com/lucast…
TolaniRidmini Mar 30, 2026
05c9176
Implement Sprint 1 heatmap generation
chiranthgowdaxaus Mar 30, 2026
8f18ff1
Merge pull request #8 from lucastargett/CM/density-zoning-SP1-new
MAYURA26-bot Mar 30, 2026
45d6d5e
YOLO Model file
ShivamSaini09 Mar 30, 2026
96a1676
Merge pull request #9 from lucastargett/CM/crowd-detection-SP1-new
MAYURA26-bot Mar 30, 2026
d26f6eb
Merge pull request #10 from lucastargett/CM/heatmap-SP1-new
MAYURA26-bot Mar 30, 2026
330b835
Added toggle highlight feature to API Diagnostics dashboard cards
shalukasw Mar 31, 2026
06e5e18
Added Crowd Monitoring report to Browse Reports
shalukasw Mar 31, 2026
65f299b
Merge backend-feature/auth-schemas into backend-api-gateway
TOMINJOSE88 Mar 31, 2026
1753d79
Merge backend-feature/auth-schemas into backend-api-gateway
TOMINJOSE88 Mar 31, 2026
b96a587
Mock service layer
TOMINJOSE88 Mar 31, 2026
f995ddf
Mock service layer
TOMINJOSE88 Mar 31, 2026
356d517
fix: correcedt model path and aligned output to required schema
ShivamSaini09 Mar 31, 2026
663b942
Merge pull request #12 from lucastargett/CM/crowd-detection-SP1-new
MAYURA26-bot Mar 31, 2026
fdd2c49
add parameter to process video function in shared service and add sam…
aniket939 Mar 31, 2026
100c010
Merge pull request #13 from lucastargett/CM/Video-processing-SP1-new
MAYURA26-bot Mar 31, 2026
dd87db7
CORS config and route wiring
TOMINJOSE88 Mar 31, 2026
e12af75
CORS config and route wiring
TOMINJOSE88 Mar 31, 2026
d3d646e
Database models and planner update
TOMINJOSE88 Mar 31, 2026
bff1a54
Database models and planner update
TOMINJOSE88 Mar 31, 2026
cb7f3df
Connecting mock player and crowd services to routes
WilliamHamilton22 Apr 1, 2026
650a1e9
auth schemas, mock services, database, and CORS
TOMINJOSE88 Apr 1, 2026
f6d06fe
auth schemas, mock services, database, and CORS
TOMINJOSE88 Apr 1, 2026
353044b
Connecting mock player and crowd services to routes
WilliamHamilton22 Apr 1, 2026
8679bf3
Implement auth core - bcrypt hashing, JWT tokens, and RBAC dependencies
TOMINJOSE88 Apr 1, 2026
742a94b
Implement auth core - bcrypt hashing, JWT tokens, and RBAC dependencies
TOMINJOSE88 Apr 1, 2026
43cc5fe
implemented .env, config.py, global error handling and logging in mai…
Prabhnoor911 Apr 1, 2026
6e1d125
Add global error handler, logging config, and DEBUG flag
TOMINJOSE88 Apr 1, 2026
3db7f2e
Revert "Add global error handler, logging config, and DEBUG flag"
TOMINJOSE88 Apr 1, 2026
a9ee3f5
Fix LoginRequest to use email instead of username
TOMINJOSE88 Apr 1, 2026
a9a72f1
Implement real auth routes and job schemas
TOMINJOSE88 Apr 1, 2026
9a05c37
Implement Week 4: upload route, job routes, background processing
TOMINJOSE88 Apr 1, 2026
f9929d0
Add auth and health tests, fix UserResponse UUID type
TOMINJOSE88 Apr 1, 2026
d50d2ed
Auto-create DB tables on startup and add .env.example
TOMINJOSE88 Apr 2, 2026
2e0498c
Merge William's PR #15: connect mock services to routes
TOMINJOSE88 Apr 2, 2026
edeb283
Merge Prabhnoor's PR #16: global error handler and logging
TOMINJOSE88 Apr 2, 2026
ed67763
Implement ReIdentification testing pipeline for tracking model when l…
quan-le Apr 3, 2026
4795c1b
Merge pull request #17 from lucastargett/backend-api-gateway
lucastargett Apr 3, 2026
10ff6cd
Merge pull request #11 from shalukasw/FrontEnd
lucastargett Apr 3, 2026
e1a784a
Implement testing Jersey OCR pipeline
quan-le Apr 5, 2026
6b54d76
Adding documentation for the re-identification and jersey ocr
quan-le Apr 5, 2026
0016943
Add files via upload
sri-bandara Apr 5, 2026
411396c
Merge pull request #19 from lucastargett/Modelling-Sri
quan-le Apr 5, 2026
ba91a13
Merge pull request #20 from lucastargett/Player-Tracking
lucastargett Apr 7, 2026
242d150
Merge pull request #18 from lucastargett/crowd-monitoring
lucastargett Apr 7, 2026
9df88a5
feat: add safest zone card to crowd monitor
Scott7ss Apr 8, 2026
78c47a3
Implemented async PostgreSQL setup and user/job models
Prabhnoor911 Apr 12, 2026
71fa787
Merge pull request #26 from Prabhnoor911/feature/database
lucastargett Apr 12, 2026
31abe88
Merge pull request #24 from Scott7ss/scott/safest-zone-card
lucastargett Apr 12, 2026
e62bcd1
frontend-sp2: Update Compare Players to select team before player
Scott7ss Apr 13, 2026
00e204e
Add JWT refresh token flow and update API contract
TOMINJOSE88 Apr 13, 2026
744e776
Updated work from last sprint
J4k3Ng0 Apr 13, 2026
148fe08
Merge pull request #28 from lucastargett/UpdatedFrontEnd
lucastargett Apr 14, 2026
2a24571
Merge branch 'backend-api-gateway'
TOMINJOSE88 Apr 15, 2026
3661f87
Merge branch 'main' of https://github.com/lucastargett/redback-orion
TOMINJOSE88 Apr 15, 2026
2deed4f
Fix database.py: revert async engine to sync (psycopg2 compatible)
TOMINJOSE88 Apr 15, 2026
26c41dc
Fix Swagger auth and UUID serialization in job schemas
TOMINJOSE88 Apr 15, 2026
b9c9a6c
Merge pull request #31 from lucastargett/backend-api-gateway
lucastargett Apr 15, 2026
02cfa9e
Merge pull request #30 from lucastargett/frontend-sp2/scott-avg-time-…
lucastargett Apr 15, 2026
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
Expand Up @@ -58,3 +58,14 @@ tmp/
# OS files
.DS_Store
Thumbs.db

# Allow our specific configuration files even if they are .json
!shared/config/*.json

# Ignore the actual heavy files
data/raw/*.mp4
video_processing/data/extracted_frames/*.jpg

# But allow the folder structure (the .gitkeep files)
!data/raw/.gitkeep
!video_processing/data/extracted_frames/.gitkeep
Original file line number Diff line number Diff line change
Expand Up @@ -2,150 +2,184 @@

## Overview

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

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

- crowd heatmaps
- density metrics
- zone-based analytics
- behaviour insights for integration into the Orion analytics dashboard
- task folders for implementation work
- a shared schema layer for agreed JSON contracts
- a shared service layer for FastAPI integration

The goal is to let team members work independently while keeping inputs and outputs consistent for backend integration.

## 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
- detect people in stadium footage
- estimate density across zones
- generate heatmaps
- analyse crowd behaviour
- identify risk zones
- keep JSON input and output formats clear for backend work

## Proposed Pipeline
## 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
->
Video Processing
->
Crowd Detection
->
Density Zoning
->
Heatmap
->
Crowd Behaviour Analytics
->
Crowd Allocation / Risk Zone
```

## Tech Stack

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

## 👥 Team Tasks (7 Members)
## Task Folders

Each task folder is mainly for implementation.

Each member should use:

- `README.md` for task guidance
- `SCHEMA.md` for exact input and output format
- `main.py` for implementation
- `output/` for generated files

Current task folders:

Each team member owns one task. Follow the README in each task folder for detailed objectives and deliverables.
- `video_processing/`
- `crowd_detection/`
- `density_zoning/`
- `heatmap/`
- `analytics_output/`
- `crowd_behaviour_analytics/`
- `crowd_allocation_risk_zone/`
- `prediction_optional/`

| # | 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 |
## Shared Folder

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

---
Contains shared settings such as thresholds, paths, and common configuration values.

## Task Guidance
### `shared/schemas/`

Each task folder contains its own `README.md` with:
Contains the agreed request and response JSON contracts for the 3 services.

- 🎯 Task objective
- 📥 Expected inputs and outputs
- 💡 Implementation notes
- ✅ Suggested deliverables
### `shared/services/`

This keeps the semester plan split into smaller, easier-to-manage work packages.
Contains the FastAPI service layer:

---
- `main.py` starts the app
- `routes.py` defines the endpoints
- `models.py` defines typed request and response models
- service files call functions from the task folders

## Project Structure
## Current 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
|- README.md
|- requirements.txt
|- data/
|- docs/
|- shared/
| |- README.md
| |- config/
| |- schemas/
| `- services/
|- video_processing/
|- crowd_detection/
|- density_zoning/
|- heatmap/
|- analytics_output/
|- crowd_behaviour_analytics/
|- crowd_allocation_risk_zone/
`- prediction_optional/
```

---
## Service Flow

```text
Frontend / Backend
->
FastAPI Routes
->
Shared Service Files
->
Task Folder Implementations
->
Schema-based JSON Response
```

## API Endpoints

The current service layer exposes 3 main endpoints:

## 🚀 Getting Started
- `POST /process-detection`
- `POST /process-analytics`
- `POST /process-intelligence`

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
These endpoints use typed FastAPI models so Swagger can show clear request and response formats.

---
## Working Rule

## 📋 Integration Points
- task folders contain implementation
- task `SCHEMA.md` files define internal handoff format
- `shared/schemas/` defines service-level contract
- `shared/services/models.py` defines typed API models for Swagger and validation
- service files should follow schema definitions exactly
- do not add extra JSON wrapper layers unless the team agrees

Tasks run in sequence:
## Getting Started

1. Read this root `README.md`
2. Open your assigned task folder
3. Read `README.md` and `SCHEMA.md`
4. Implement your task in `main.py`
5. Save outputs in `output/`
6. Keep your input and output aligned with the agreed schema

## Install Dependencies

```bash
pip install -r requirements.txt
```

## Run FastAPI Service

```bash
uvicorn shared.services.main:app --reload
```
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

## Open Swagger UI

After the server starts, open:

```text
http://127.0.0.1:8000/
```

---
In the current setup, Swagger UI is served on the root URL.

## 💬 Collaboration
## Collaboration Notes

- **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
- backend team should use `shared/schemas/` as the source of truth
- FastAPI Swagger is generated from `shared/services/models.py`
- implementation teams should follow their task `SCHEMA.md`
- if a field name changes, update schema first and then update service and task code
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,39 @@

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

## Recommended Structure

```text
analytics_output/
|- README.md
|- main.py
`- output/
```

### Why This Structure

- `main.py` keeps the task simple and easy to understand
- `output/` stores generated JSON, CSV, or export files
- add `utils.py` only if `main.py` becomes messy or too long

## Correct Approach

- keep the real implementation for this task inside this folder
- write the main export logic in `main.py`
- save generated files inside `output/`
- if helper code starts repeating, then create `utils.py`
- the shared service layer can later call functions from this task folder

## When To Add `utils.py`

Create `utils.py` only when:

- `main.py` becomes hard to read
- helper functions are repeated
- you want to separate small reusable logic such as JSON formatting or CSV writing

Do not create extra files too early. Start simple, then split only when needed.

## Scope

- Export analysis results in JSON and CSV formats
Expand All @@ -28,9 +61,11 @@ Generate structured outputs that can be consumed by the Orion dashboard or relat
- 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
- Keep the task folder minimal at the start
- Store reusable helpers in `shared/` only if they are needed by multiple folders

## Suggested Deliverables

- A serializer or export script
- A simple `main.py` script for exporting results
- 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,40 @@
# Analytics Output Task Schema

## Purpose

This task exports results into files for reporting or dashboard use. It is separate from the current analytics service contract.

## Input JSON

```json
{
"video_id": "match_01",
"zones": [
{
"zone_id": "A1",
"person_count": 8,
"density": 0.72
}
],
"heatmap": {
"image_path": "output/heatmap_match_01.png"
},
"crowd_state": "increasing_density"
}
```

## Output JSON

```json
{
"video_id": "match_01",
"json_path": "output/match_01_analytics.json",
"csv_path": "output/match_01_analytics.csv"
}
```

## Notes

- this task is for export only
- it is not part of the current `crowd_analytics_service` flow
- backend team should not depend on this task for the live analytics service response right now
Loading
Loading