How yaswanthkumarmallela01/abnormal-event-detection works
This is a Flask-based surveillance-video anomaly detection application. Users upload a video or analyze a browser camera feed; the Flask app dispatches inference locally or to the optional Modal service, then returns scores, alerts, and visual results. IP-camera middleware can submit frames through a documented API. The core analysis extracts and preprocesses frames, scores sequences with a ConvLSTM autoencoder, and applies thresholding. Optional training produces model weights and a threshold. Relationships not evidenced by excerpts or README statements are omitted; Modal integration is shown as optional.
Main entry points: app.py Flask application · pipeline.py Video analysis · app.js Client controls · convlstm_autoencoder.py ConvLSTM autoencoder
Components 16
Web experience
- Web interface
templates/index.html - Client controls
static/app.js - Alerts and visualization
static/app.js
Application and inference
- Flask application
app.py - Modal inference service
modal_infer.py
Anomaly analysis
- Video analysis
pipeline.py - Frame preprocessing
pipeline.py - Sequence scoring
pipeline.py - Adaptive thresholding
pipeline.py - Detection utilities
detection_utils.py
Models and training
- ConvLSTM autoencoder
model/convlstm_autoencoder.py - Model training
train.py - Model weights
weights
Other components
- Viewer
- Browser camera
- IP camera middleware
Connections 20
- Viewer → Web interface: uses
README.md - Web interface → Client controls: loads
README.md - Client controls → Flask application: submits video
README.md - Browser camera → Client controls: provides frames
static/app.js - Client controls → Flask application: posts frames
static/app.js - IP camera middleware → Flask application: posts frames
README.md - Flask application → Video analysis: runs locally
app.py - Flask application → Detection utilities: requests event hints
app.py - Flask application → Modal inference service: dispatches optionally
app.py - Modal inference service → ConvLSTM autoencoder: builds model
modal_infer.py - Video analysis → Frame preprocessing: prepares frames
pipeline.py - Frame preprocessing → Sequence scoring: forms sequences
pipeline.py - Video analysis → ConvLSTM autoencoder: builds model
pipeline.py - Sequence scoring → Adaptive thresholding: scores sequences
pipeline.py - Video analysis → Adaptive thresholding: calculates threshold
pipeline.py - Flask application → Alerts and visualization: returns results
static/app.js - Client controls → Alerts and visualization: renders alerts
static/app.js - Model training → ConvLSTM autoencoder: trains
train.py - Model training → Model weights: saves weights
README.md - Video analysis → Model weights: loads threshold
pipeline.py