This project utilizes a modern architecture to provide real-time insights via a React-based dashboard. The backend is powered by Flask, with YoloV5 inferencing for car detection, and leverages MongoDB for aggregated analytics.
- Real-time image streams of 90 cameras are fetched from the Singapore Government's Developer Portal (https://beta.data.gov.sg API).
- The images are then processed by a Flask server using YoloV5 for car detection.
- Detected car data is then stored in MongoDB, a NoSQL database, for aggregated analytics.
The schema for storing detection results from the cameras is structured as follows:
{
"camera_id": "string",
"timestamp": "datetime",
"detection_results": {
"cars": [
{
"bounding_box": {
"x": "int",
"y": "int",
"width": "int",
"height": "int"
},
"density": "int"
}
],
"trucks": [
{
"bounding_box": {
"x": "int",
"y": "int",
"width": "int",
"height": "int"
},
"density": "int"
}
],
"pedestrians": [
{
"bounding_box": {
"x": "int",
"y": "int",
"width": "int",
"height": "int"
},
"density": "int"
}
],
"two_wheelers": [
{
"bounding_box": {
"x": "int",
"y": "int",
"width": "int",
"height": "int"
},
"density": "int"
}
]
}
}
- Redis is used as a cache to retrieve data faster, enhancing the performance of the system.
- Finally, the React dashboard consumes the data to provide real-time insights to the end-user.
- Real-time car detection and analytics
- Scalable NoSQL database integration
- Fast data retrieval with Redis caching
- Interactive React dashboard for insights visualization