Bappadala Rohith Kumar Naidu commited on
Commit
6a0c11d
Β·
1 Parent(s): d710a81

docs: add comprehensive Dataset Card with scripts pipeline documentation

Browse files

- Added HuggingFace metadata tags (license, task, language, size)
- Full data contents table with sources and sizes
- Scripts/ folder structure documented with origin paths
- Quickstart commands for running each data acquisition script
- Notes on Pro vs basic fetcher versions

Files changed (1) hide show
  1. README.md +157 -3
README.md CHANGED
@@ -1,3 +1,157 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ task_categories:
4
+ - object-detection
5
+ - question-answering
6
+ language:
7
+ - en
8
+ - hi
9
+ tags:
10
+ - road-safety
11
+ - india
12
+ - emergency-services
13
+ - traffic-law
14
+ - geospatial
15
+ - rag
16
+ pretty_name: SafeVisionAI Dataset Hub
17
+ size_categories:
18
+ - 1B<n<10B
19
+ ---
20
+
21
+ # SafeVisionAI Dataset Hub πŸ›‘οΈ
22
+
23
+ > The **Intelligence Layer** for the SafeVisionAI platform β€” IIT Madras Road Safety Hackathon 2026
24
+
25
+ This repository hosts all datasets, pre-trained models, notebooks, and **reproducible data acquisition scripts** that power the SafeVisionAI application. It is designed to be cloned directly into Google Colab or any research environment.
26
+
27
+ **Main Application Repo:** [SafeVision-AI/SafeVision-AI](https://github.com/SafeVision-AI/SafeVision-AI)
28
+
29
+ ---
30
+
31
+ ## ⚑ Quickstart (Google Colab)
32
+
33
+ ```python
34
+ # Clone the entire intelligence layer
35
+ !git clone https://huggingface.co/datasets/rohith083/SafeVisionAI-Dataset-Hub /content/data
36
+
37
+ # Symlink into the app structure
38
+ import os
39
+ os.makedirs("/content/SafeVisionAI/chatbot_service", exist_ok=True)
40
+ !ln -sfn /content/data/data/chatbot_service/data /content/SafeVisionAI/chatbot_service/data
41
+ ```
42
+
43
+ ---
44
+
45
+ ## πŸ“¦ Repository Structure
46
+
47
+ ```
48
+ SafeVisionAI-Dataset-Hub/
49
+ β”œβ”€β”€ data/ ← 3.6 GB of raw intelligence data
50
+ β”‚ β”œβ”€β”€ chatbot_service/data/ ← Legal PDFs, GIS CSVs, accident data, models
51
+ β”‚ └── backend/datasets/ ← Challan rules, road infrastructure
52
+ β”‚
53
+ β”œβ”€β”€ scripts/ ← Reproducible data acquisition pipeline
54
+ β”‚ β”œβ”€β”€ scripts/data/ ← Root-level data scripts (fetchers, extractors)
55
+ β”‚ β”œβ”€β”€ backend/data/ ← Backend data transforms (pure Python)
56
+ β”‚ └── chatbot_service/data/ ← Pro Overpass GIS fetchers
57
+ β”‚
58
+ └── notebooks/ ← Research notebooks and analysis
59
+ ```
60
+
61
+ ---
62
+
63
+ ## πŸ—‚οΈ Data Contents
64
+
65
+ | Category | Files | Size | Source |
66
+ |---|---|---|---|
67
+ | Emergency Services GIS | `hospitals.csv`, `police_stations.csv`, `fire_stations.csv`, `ambulance.csv` | ~150 MB | OpenStreetMap Overpass API |
68
+ | Legal Documents | `motor_vehicles_act_1988.pdf`, `mv_amendment_act_2019.pdf` | ~30 MB | MoRTH / Indian Kanoon |
69
+ | Accident Statistics | `kaggle_india_accidents.csv`, `morth_2022/*.csv` | ~250 MB | MoRTH / Kaggle |
70
+ | Road Infrastructure | `pmgsy_roads.geojson`, `toll_plazas.csv` | ~900 MB | PMGSY GeoSadak / NHAI |
71
+ | Hospital Directory | `hospital_directory.csv`, `nin_facilities.csv` | ~1.2 GB | NHP / NIN |
72
+ | Traffic Violations | `violations_seed.csv`, `state_overrides.csv` | ~5 MB | MVA 2019 |
73
+ | Road Damage Model | `road_damage_2025/` | ~800 MB | ONNX + Training Data |
74
+ | QA Pairs | `qa_pairs/` | ~50 MB | Custom RAG Training |
75
+
76
+ ---
77
+
78
+ ## πŸ”¬ Scripts β€” Reproducible Data Pipeline
79
+
80
+ The `scripts/` folder mirrors the main application's data acquisition pipeline.
81
+ All scripts here are **pure Python** β€” they run without any database or backend stack.
82
+
83
+ ### Structure
84
+
85
+ ```
86
+ scripts/
87
+ β”œβ”€β”€ scripts/data/ ← from SafeVisionAI/scripts/data/
88
+ β”‚ β”œβ”€β”€ _overpass_utils.py ← Core GIS utility (basic version)
89
+ β”‚ β”œβ”€β”€ fetch_hospitals.py ← Hospital data from OpenStreetMap
90
+ β”‚ β”œβ”€β”€ fetch_police.py ← Police station data
91
+ β”‚ β”œβ”€β”€ fetch_ambulance.py ← Ambulance service data
92
+ β”‚ β”œβ”€β”€ fetch_blood_banks.py ← Blood bank data
93
+ β”‚ β”œβ”€β”€ fetch_fire.py ← Fire station data
94
+ β”‚ β”œβ”€β”€ download_legal_pdfs.py ← MV Act PDF downloader
95
+ β”‚ β”œβ”€β”€ extract_morth2022_tables.py ← PDF β†’ CSV extractor
96
+ β”‚ β”œβ”€β”€ seed_blackspots.py ← Accident blackspot normalizer
97
+ β”‚ β”œβ”€β”€ bootstrap_local_data.py ← Master data orchestrator
98
+ β”‚ β”œβ”€β”€ verify_data.py ← Data integrity checker
99
+ β”‚ β”œβ”€β”€ inspect_zips.py ← Dataset zip validator
100
+ β”‚ β”œβ”€β”€ audit_env.py ← Environment configuration checker
101
+ β”‚ β”œβ”€β”€ check_all_scripts.py ← Script syntax validator
102
+ β”‚ └── setup_kaggle.ps1 ← Kaggle API auth setup
103
+ β”‚
104
+ β”œβ”€β”€ backend/data/ ← from SafeVisionAI/backend/scripts/data/
105
+ β”‚ β”œβ”€β”€ seed_violations.py ← Traffic fine normalizer (MVA 2019)
106
+ β”‚ β”œβ”€β”€ prepare_road_sources.py ← CSV/GeoJSON β†’ LineString converter
107
+ β”‚ β”œβ”€β”€ sample_pmgsy.py ← PMGSY 867K roads sampler
108
+ β”‚ β”œβ”€β”€ road_sources.example.json ← Manifest template
109
+ β”‚ └── road_sources.json ← Active road source manifest
110
+ β”‚
111
+ └── chatbot_service/data/ ← from SafeVisionAI/chatbot_service/scripts/data/
112
+ β”œβ”€β”€ _overpass_utils.py ← Pro GIS utility (with retries + backoff)
113
+ β”œβ”€β”€ fetch_hospitals.py ← Pro hospital fetcher
114
+ β”œβ”€β”€ fetch_police.py ← Pro police fetcher
115
+ β”œβ”€β”€ fetch_ambulance.py ← Pro ambulance fetcher
116
+ β”œβ”€β”€ fetch_blood_banks.py ← Pro blood bank fetcher
117
+ └── fetch_fire.py ← Pro fire station fetcher
118
+ ```
119
+
120
+ ### Running the Scripts
121
+
122
+ ```bash
123
+ # 1. Setup Kaggle auth (one-time)
124
+ pwsh scripts/scripts/data/setup_kaggle.ps1
125
+
126
+ # 2. Fetch all emergency service GIS data (Pro versions recommended)
127
+ python scripts/chatbot_service/data/fetch_hospitals.py
128
+ python scripts/chatbot_service/data/fetch_police.py
129
+ python scripts/chatbot_service/data/fetch_ambulance.py
130
+ python scripts/chatbot_service/data/fetch_blood_banks.py
131
+ python scripts/chatbot_service/data/fetch_fire.py
132
+
133
+ # 3. Download legal documents
134
+ python scripts/scripts/data/download_legal_pdfs.py
135
+
136
+ # 4. Extract MoRTH accident tables
137
+ python scripts/scripts/data/extract_morth2022_tables.py
138
+
139
+ # 5. Verify everything
140
+ python scripts/scripts/data/verify_data.py
141
+ ```
142
+
143
+ > **Note:** `chatbot_service/data/` versions of the fetchers are the **Pro versions** β€” they include retry logic, exponential backoff, and more precise Indian GIS selectors.
144
+
145
+ ---
146
+
147
+ ## πŸ““ Notebooks
148
+
149
+ See `notebooks/README.md` for the full Colab quickstart guide.
150
+
151
+ ---
152
+
153
+ ## πŸ“œ License
154
+
155
+ Apache 2.0 β€” See [LICENSE](LICENSE)
156
+
157
+ Data sourced from OpenStreetMap (ODbL), MoRTH (Government of India Open Data), Kaggle, PMGSY GeoSadak, and National Health Portal.