How abhinav-narra/cafe-ai works
This is a local Tea Stall CCTV monitoring application. Its main workflow captures webcam, CCTV-stream, or video frames; detects and tracks people and items; creates visit sessions and debounced serving events; persists analytics in SQLite while publishing annotated frames and recordings; and presents live monitoring and date-filtered analytics in Streamlit. The graph also preserves worker enrollment, runtime configuration, telemetry, and review capabilities. Some subsystem links rely on README statements or SOURCE INDEX references; unsampled implementation details are not inferred.
Main entry points: main.py Frame orchestration · app.py Streamlit entry · views.py Analytics views · components.py Live UI components
Components 24
Capture and vision
- Frame orchestration
main.py - YOLO detection
detection/detector.py - Frame pipeline
utils/pipeline.py
Tracking and analytics
- Visit tracking
tracking/person_tracker.py - Service events
analytics/event_processor.py - Cup counting
analytics/cup_counter.py - Plate counting
analytics/plate_counter.py - Service totals
analytics/service_counter.py - Worker recognition
analytics/worker_recognition.py
Local persistence
- SQLite analytics
database/database.py - Data models
database/models.py - Video recording
utils/video_recorder.py
Dashboard
- Streamlit entry
dashboard/app.py - Analytics views
dashboard/views.py - Live UI components
dashboard/components.py - Dashboard styling
dashboard/styles.py
Runtime support
- Runtime settings
utils/settings.py - Runtime telemetry
utils/telemetry.py - Frame overlays
utils/visualization.py - ROI geometry
utils/roi.py - Runtime configuration
config.py
Other components
- Camera operator
- Camera or video
- Dashboard user
Connections 32
- Camera operator → Frame orchestration: starts analysis
README.md - Camera or video → Frame orchestration: provides frames
README.md - Frame orchestration → Frame pipeline: coordinates buffering
main.py - Frame orchestration → YOLO detection: runs inference
main.py - Frame orchestration → Visit tracking: updates visits
main.py - Frame orchestration → Service events: processes events
main.py - Frame orchestration → Worker recognition: matches workers
main.py - Frame orchestration → Service totals: updates totals
main.py - Frame orchestration → SQLite analytics: persists analytics
README.md - Frame orchestration → Video recording: records frames
main.py - Frame orchestration → Frame overlays: annotates frames
main.py - Frame orchestration → Runtime telemetry: publishes status
main.py - Frame orchestration → ROI geometry: uses regions
main.py - Service events → Cup counting: counts cups
analytics/event_processor.py - Service events → Plate counting: counts plates
analytics/event_processor.py - Visit tracking → ROI geometry: checks regions
tracking/person_tracker.py - Frame overlays → ROI geometry: draws regions
utils/visualization.py - Dashboard user → Streamlit entry: opens dashboard
README.md - Streamlit entry → Analytics views: routes pages
dashboard/app.py - Streamlit entry → Live UI components: builds interface
dashboard/app.py - Streamlit entry → Dashboard styling: injects styles
dashboard/app.py - Streamlit entry → Runtime settings: applies settings
dashboard/app.py - Streamlit entry → SQLite analytics: creates repository
dashboard/app.py - Streamlit entry → Worker recognition: creates recognizer
dashboard/app.py - Analytics views → SQLite analytics: reads analytics
dashboard/views.py - Analytics views → Worker recognition: registers workers
dashboard/views.py - Analytics views → Video recording: lists recordings
dashboard/views.py - Live UI components → Runtime telemetry: reads status
dashboard/components.py - Live UI components → ROI geometry: renders regions
dashboard/components.py - Analytics views → Live UI components: renders panels
dashboard/views.py - Runtime settings → Runtime configuration: updates values
utils/settings.py - SQLite analytics → Data models: uses schema