Created on 19th April 2025
β’
India's public transport system, especially its bus network, faces major challenges with unpredictable occupancy levels. Commuters are often unaware if a bus is overcrowded or has available seats, leading to delays, discomfort, missed buses, and even safety hazards due to overloading.
SahYatri addresses this issue through an affordable, AI-powered solution built using Raspberry Pi, a camera module, and a YOLO-based object detection model. It detects real-time seat occupancy inside buses by analyzing live video frames.
The data is then sent to a central server, where it is:
By giving passengers better visibility into current bus loads, and governments powerful analytics and control, SahYatri:
SahYatri is an affordable, modular, and scalable solution that contributes to:
Since we capture frames inside public buses, protecting passenger identity was a top priority.
β
Solution: Raspberry Pi deletes each image right after uploading it to the detection server. No images are stored locally, ensuring full compliance with privacy concerns.
Running YOLOv5n or YOLOv4-tiny directly on the Raspberry Pi was too resource-heavy and caused delays.
β
Solution: Offloaded all AI processing to a cloud server. The Pi now only sends frames; the server returns real-time occupancy percentages.
Keeping the occupancy data in sync across the Pi, backend, mobile app, and dashboard in near real-time was a challenge.
β
Solution: Designed efficient REST APIs, used fast DB indexing, and built lightweight microservices for better scalability and low-latency updates.
Allowing users and admins to view past occupancy trends without lag required a balance between performance and storage.
β
Solution: Integrated Neon DB with raw SQL queries and smart indexing to enable fast lookups and ~1-second delay for live updates.
Our GPS module failed, but we still needed to display real-time bus location on the dashboard.
β
Solution: Used IP-based geolocation from the server and integrated Google Maps API to estimate and display approximate location on the map.