File size: 3,039 Bytes
34ac344
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bdbd028
 
 
 
 
 
e42a3c3
 
7058a19
54ec34e
 
 
 
c88ddc8
bdbd028
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71960c4
bdbd028
 
5330773
 
 
 
 
bdbd028
 
34fe804
 
5330773
 
dcb4e62
 
 
 
 
 
 
 
 
5330773
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
---
task_categories:
- object-detection
language:
- en
tags:
- computer vision
- code
- python
- traffic
- singapore
- roadway
pretty_name: Traffic Images for Object Detection
size_categories:
- 10K<n<100K
---
# Traffic Image Data Extraction Through Singapore Government API

## Description

The Singapore government offers real-time images from traffic cameras across the nation through its API. This dataset compiles a comprehensive image dataset in the form of a DataFrame by extracting data for the month of January 2024 from 6 pm to 7 pm each day using the API.

Below are sample images from the dataset:

<div style="display: flex; justify-content: space-around;">
    <img src="76.jpg" alt="Sample image from the data" width="600"/>
    <img src="61.jpg" alt="Sample image from the data" width="600"/>
</div>


## Use Cases

The resulting dataset will facilitate easy integration into various use cases including:

### Object Detection
Utilize the dataset for training object detection models to identify and analyze vehicles, pedestrians, and other objects in the traffic images.

### Traffic Trend Analysis
Leverage time-series analysis to identify and analyze traffic trends over specific periods. This can provide valuable insights into peak traffic times, congestion patterns, and potential areas for infrastructure improvement.

### Road Safety Assessment
Implement computer vision algorithms to assess road safety by analyzing traffic images for potential hazards, unusual road conditions, or non-compliance with traffic rules. This use case aims to enhance road safety monitoring and contribute to the development of intelligent transportation systems.

## Dataset Details

The dataset will comprise the following columns:

- **Timestamp**: Date and time of the image acquisition from LTA's Datamall.
- **Camera_ID**: Unique identifier assigned by LTA to each traffic camera.
- **Latitude**: Geographic coordinate of the camera's location (latitude).
- **Longitude**: Geographic coordinate of the camera's location (longitude).
- **Image_URL**: The traffic image fetched from the Image_URL provided by the API.
- **Image_Metadata**: Metadata of the image file including height, width, and MD5 hash.

## Limitations of my Dataset

The Dataset due to limited computational capability has data of only one month and 1 hour for each day.
Fetching large data (such as a year) would help in analysing the macro trends and significant patterns.

## API Documentation

For more details on accessing the traffic camera images, visit the [API Documentation](https://beta.data.gov.sg/collections/354).

## Use Case

Refer to the attached traffic_object_detection.py file to see how I used a pretrained YOLO model to detech cars and trucks. Further I generated traffic insights using the streamlit dashboard (code not on HuggingFace).

Below is a sample output of the YOLO model
<img src="Picture1.png" alt="Sample image from the data" width="600"/>

Here are the snippets of my Dashboard:




Version 2.0 of Data Analytics coming soon!