How ctrl-piyush/vad-project works
This repository is a weakly supervised video-anomaly detection research pipeline with an optional serving dashboard and explanation workflow. The main path is dataset validation and splitting, snippet-feature extraction, MIL model training and tuning, then evaluation or single-video inference with localisation and calibration. Optional retrieval-augmented explanations add groundedness checks. The graph preserves the README’s analysis, frame-dataset and API/dashboard capabilities. Relationships are supported by README workflow statements or the supplied source index; unsampled implementation details are not assumed.
Main entry points: infer.py Single-video inference · train.py MIL training · features.py Snippet features · evaluate.py Final evaluation
Components 27
Data preparation
- Dataset validation
vad/data/validate.py - Validation split
vad/data/make_val_split.py - Frame dataset access
vad/data/frames.py - Snippet features
vad/data/features.py - Dataset analysis
vad/analysis.py
Detection pipeline
- MIL training
vad/train.py - MIL model and loss
vad/models.py - Feature bags and normalisation
vad/data/bags.py - Temporal resampling
vad/seq.py - Hyperparameter tuning
vad/tune.py - Final evaluation
vad/evaluate.py - Detection metrics
vad/metrics.py - Temporal localisation
vad/localize.py - Confidence calibration
vad/calibration.py - Single-video inference
vad/infer.py
Explanations
- Retrieval index builder
vad/explain/build_index.py - Incident retrieval store
vad/explain/rag.py - Explanation pipeline
vad/explain/pipeline.py - Vision and language models
vad/explain/models.py - Groundedness checks
vad/explain/groundedness.py
User interfaces
- FastAPI service
api/main.py - Streamlit dashboard
app/streamlit_app.py - Dashboard jobs
app/jobs.py
Shared runtime
- Configuration and paths
vad/config.py
Other components
- Researcher / reviewer
- UCF-Crime data
- Pretrained CNN / external models
Connections 44
- Researcher / reviewer → Dataset validation: checks data
README.md - UCF-Crime data → Dataset validation: validates
README.md - Dataset validation → Validation split: creates manifest
README.md - UCF-Crime data → Frame dataset access: provides frames
- Frame dataset access → Snippet features: supplies frames
vad/data/features.py - UCF-Crime data → Snippet features: provides videos
README.md - Snippet features → MIL training: cached features
vad/train.py - MIL training → Feature bags and normalisation: loads feature bags
vad/train.py - MIL training → MIL model and loss: trains
vad/train.py - MIL training → Detection metrics: scores validation
vad/train.py - Feature bags and normalisation → Temporal resampling: resamples snippets
vad/data/bags.py - Researcher / reviewer → Dataset analysis: runs analysis
README.md - Dataset analysis → Snippet features: analyzes feature data
- Researcher / reviewer → Hyperparameter tuning: tunes model
README.md - Hyperparameter tuning → MIL training: selects configurations
- Researcher / reviewer → Final evaluation: evaluates runs
README.md - Final evaluation → MIL training: loads trained runs
vad/evaluate.py - Final evaluation → Detection metrics: computes metrics
vad/evaluate.py - Final evaluation → Temporal localisation: computes intervals
vad/evaluate.py - Final evaluation → Confidence calibration: calibrates scores
vad/evaluate.py - Researcher / reviewer → Single-video inference: analyzes video
README.md - Single-video inference → Snippet features: extracts features
vad/infer.py - Single-video inference → MIL training: loads model
vad/infer.py - Single-video inference → Temporal localisation: localizes snippets
vad/infer.py - Single-video inference → Confidence calibration: calibrates confidence
vad/infer.py - Pretrained CNN / external models → Snippet features: embeds snippets
- Researcher / reviewer → Retrieval index builder: builds index
README.md - Retrieval index builder → Incident retrieval store: creates index
vad/explain/build_index.py - Researcher / reviewer → Explanation pipeline: requests explanation
README.md - Explanation pipeline → Incident retrieval store: retrieves incidents
vad/explain/pipeline.py - Explanation pipeline → Vision and language models: encodes and explains
vad/explain/pipeline.py - Explanation pipeline → Groundedness checks: checks support
vad/explain/pipeline.py - Pretrained CNN / external models → Vision and language models: provides pretrained models
- Researcher / reviewer → FastAPI service: calls service
README.md - FastAPI service → Single-video inference: invokes analysis
api/main.py - Researcher / reviewer → Streamlit dashboard: uses dashboard
README.md - Streamlit dashboard → Single-video inference: runs analysis
app/streamlit_app.py - Streamlit dashboard → Explanation pipeline: requests explanations
app/streamlit_app.py - Streamlit dashboard → Incident retrieval store: uses retrieval
app/streamlit_app.py - Streamlit dashboard → Dashboard jobs: delegates jobs
app/streamlit_app.py - Dataset validation → Configuration and paths: loads paths
vad/data/validate.py - Snippet features → Configuration and paths: loads paths
vad/data/features.py - MIL training → Configuration and paths: loads paths
vad/train.py - Single-video inference → Configuration and paths: loads paths
vad/infer.py