An edge-to-cloud computer vision and analytics platform built for the Purplle Tech Challenge.
Dashboard: https://store-intelligence-ai.onrender.com
API Documentation: https://store-intelligence-ai.onrender.com/docs
- Decoupled Edge-to-Cloud Architecture: Uses YOLOv8 and OpenCV at the edge to track visitors at 25+ FPS. Transmits telemetry as JSON to the cloud.
- High-Concurrency PostgreSQL Backend: Migrated from SQLite to containerized PostgreSQL utilizing SQLAlchemy 2.0 and
SessionLocaldependency injection to eliminate 100% of database-locking bottlenecks during multi-camera telemetry bursts. - Mathematical Correlation Engine: Computer Vision edge nodes frequently drop IDs. The API utilizes a custom "camera-aware" heuristic to rebuild disjointed customer journeys, recovering 100% of dropped tracking IDs to build perfect, cascading conversion funnels.
- Real-Time SPA Dashboard: An asynchronous Streamlit dashboard that isolates DOM updates via
@st.fragmentto auto-refresh metrics every 2 seconds without full-page UI flashes.
CCTV → YOLOv8 Edge Tracker → Telemetry JSON → FastAPI → PostgreSQL → Mathematical Correlation Engine → Streamlit Dashboard
📦 Store-Intelligence
├── app/
├── dashboard/
├── doc/
├── pipeline/
├── data/
├── tests/
├── Dockerfile
├── run.sh
├── requirements-api.txt
├── requirements-edge.txt
├── store_layout.json
└── README.md
| Layer | Technology |
|---|---|
| Backend | FastAPI |
| Frontend | Streamlit |
| Database | PostgreSQL |
| Computer Vision | YOLOv8 |
| Deployment | Docker |
| Hosting | Render |
| Language | Python 3.11 |
git clone https://github.com/ayushsin9h/Store-Intelligence.git
cd Store-Intelligencepython -m venv venvWindows:
venv\Scripts\activateLinux/Mac:
source venv/bin/activatepip install -r requirements-api.txt
pip install streamlit pandas requestsmkdir data
uvicorn app.main:app --host 0.0.0.0 --port 8000API Docs:
http://localhost:8000/docs
streamlit run dashboard/web_dashboard.pyDashboard:
http://localhost:8501
pip install -r requirements-edge.txt
python pipeline/detect.py --source resources/Store_1/cam1.mp4- Visitor Count
- Active Visitors
- Session Duration
- Conversion Funnel
- Queue Length
- Wait Time
- Zone Occupancy
- Dwell Time
GET /health
POST /ingest
GET /analytics/funnel
GET /analytics/zones
GET /analytics/queue
GET /dashboarddocker build -t store-intelligence .
docker run -p 8000:8000 store-intelligenceUses:
- Dockerfile
- run.sh
- FastAPI
- Streamlit
- Auto Port Binding
✅ Customer Journey Tracking
✅ Retail Conversion Analytics
✅ Queue Monitoring
✅ Zone Intelligence
✅ Multi-Store Visibility
✅ Edge-to-Cloud Architecture
✅ Real-Time Dashboarding
Transforming CCTV footage into actionable retail intelligence through Computer Vision, Analytics, and Cloud Engineering.