How aaryan2304/cctv-video-anomaly-detection works
This repository is a video-anomaly detection product with a FastAPI service and Streamlit dashboard, plus a separate model training/evaluation workflow. Its runtime path preprocesses uploaded video frames, scores them with a reconstruction model, and exposes anomaly scores and flags. The graph also preserves documented threshold controls, monitoring, and ONNX export. Some route and dashboard wiring was not excerpted, so only documented or source-index-supported relationships are shown.
Main entry points: app.py REST API · main.py Training workflow · detector.py Anomaly detector · preprocessing.py Video preprocessing
Components 17
Video analysis
- Interactive dashboard
dashboard.py - REST API
app.py - Video preprocessing
data/preprocessing.py - Scores and flags
app.py - Threshold controls
app.py
Detection models
- Convolutional autoencoder
models/autoencoder.py - Anomaly detector
models/detector.py
Training and evaluation
- Training workflow
main.py - Video datasets
data/dataset.py - Synthetic data
data/synthetic_data.py - Performance metrics
evaluation/metrics.py - Evaluation visualizer
evaluation/visualizer.py
Operations and export
- Training configuration
config.py - Service settings
settings.py - Service monitoring
app.py - ONNX export
export_model.py
Other components
- Video user
Connections 16
- Video user → Interactive dashboard: uploads video
README.md - Interactive dashboard → REST API: requests analysis
- REST API → Video preprocessing: preprocesses frames
app.py - REST API → Anomaly detector: runs detection
app.py - Anomaly detector → Convolutional autoencoder: uses model
models/detector.py - REST API → Scores and flags: returns scores
README.md - REST API → Threshold controls: offers controls
README.md - Training workflow → Video datasets: loads data
main.py - Training workflow → Video preprocessing: preprocesses frames
main.py - Training workflow → Anomaly detector: trains model
main.py - Training workflow → Performance metrics: evaluates scores
main.py - Video datasets → Video preprocessing: uses preprocessor
data/dataset.py - Training workflow → Training configuration: loads configuration
main.py - REST API → Service settings: loads settings
app.py - REST API → Service monitoring: exposes metrics
README.md - ONNX export → Convolutional autoencoder: exports model
export_model.py