How ven12345678/swim-secure-portfolio works
SwimSecure is a live drowning-risk monitoring product: operators choose a local, uploaded, or remote camera feed; the dashboard streams frames to the backend, which detects and tracks swimmers, estimates risk, and returns results for alerts and incident review. Sessions, frame events, and operator feedback are persisted for the history dashboard. The README also documents configurable thresholds, QR-based remote streaming, and emergency dispatch/location selection. Several backend and UI excerpts are partial or unsampled, so uncertain internal wiring is omitted; the dispatch modal is shown as an operator-facing workflow, not a verified connection to emergency services.
Main entry points: main.py FastAPI stream API · page.tsx Live dashboard · VideoProcessor.tsx Video processor · inference.py YOLO and LSTM
Components 20
Live monitoring
- Live dashboard
frontend/src/app/page.tsx - Video processor
frontend/src/components/VideoProcessor.tsx - Remote camera page
frontend/src/app/camera/page.tsx - FastAPI stream API
backend/main.py - Viewer broadcast
backend/main.py
Detection and risk
- YOLO and LSTM
backend/inference.py - YOLO weights
backend/models/yolo_best.pt - LSTM weights
backend/models/lstm_best_final.pt - Person tracker
backend/tracker.py
Incident records
- Session history
frontend/src/app/history/page.tsx - Async database access
backend/database.py - Session event feedback models
backend/models.py - PostgreSQL
Operator tools
- Alert system
frontend/src/components/AlertSystem.tsx - Alert feedback
frontend/src/app/page.tsx - Emergency dispatch modal
frontend/src/components/EmergencyDispatchModal.tsx - Location selector
frontend/src/components/LocationSelector.tsx
Other components
- Pool operator
- Mobile camera
- OpenStreetMap geocoder
Connections 24
- Pool operator → Live dashboard: operates
- Mobile camera → Remote camera page: captures video
- Live dashboard → Video processor: selects source
- Video processor → FastAPI stream API: streams frames
- Remote camera page → FastAPI stream API: streams frames
- FastAPI stream API → YOLO and LSTM: runs detection
- FastAPI stream API → Person tracker: updates tracks
- FastAPI stream API → Viewer broadcast: broadcasts results
- Viewer broadcast → Video processor: sends remote results
- FastAPI stream API → Video processor: returns results
- YOLO and LSTM → YOLO weights: loads weights
- YOLO and LSTM → LSTM weights: loads weights
- Live dashboard → FastAPI stream API: updates thresholds
- Live dashboard → Alert system: shows risk alerts
- Alert system → Alert feedback: offers verdict
- Alert feedback → FastAPI stream API: submits feedback
- Live dashboard → Emergency dispatch modal: opens dispatch
- Emergency dispatch modal → Location selector: sets location
- Location selector → OpenStreetMap geocoder: searches address
- Live dashboard → Session history: opens history
- Session history → FastAPI stream API: requests history
- FastAPI stream API → Async database access: queries and persists
- Async database access → Session event feedback models: uses schema
- Async database access → PostgreSQL: reads and writes