rohith083 commited on
Commit
92f96fe
·
verified ·
1 Parent(s): c36c41a

Update README.md: fix 11 languages, file counts, structure, and model/Space cross-links

Browse files
Files changed (1) hide show
  1. README.md +85 -96
README.md CHANGED
@@ -6,6 +6,15 @@ task_categories:
6
  language:
7
  - en
8
  - hi
 
 
 
 
 
 
 
 
 
9
  tags:
10
  - road-safety
11
  - india
@@ -13,159 +22,139 @@ tags:
13
  - traffic-law
14
  - geospatial
15
  - rag
 
 
 
 
 
16
  pretty_name: SafeVixAI Dataset Hub
17
  size_categories:
18
- - 1B<n<10B
19
  ---
20
 
21
- # SafeVixAI Dataset Hub 🛡️
22
 
23
  > The **Intelligence Layer** for the SafeVixAI 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 SafeVixAI application. It is designed to be cloned directly into Google Colab or any research environment.
26
 
27
- **Main Application Repo:** [SafeVixAI/SafeVixAI](https://github.com/SafeVixAI/SafeVixAI)
 
 
 
 
28
 
29
  ---
30
 
31
- ## ⚡ Quickstart (Google Colab)
32
 
33
  ```python
34
- # Clone the entire intelligence layer
35
  !git clone https://huggingface.co/datasets/SafeVixAI/SafeVixAI-Dataset-Hub /content/data
36
 
37
- # Symlink into the app structure
38
  import os
39
  os.makedirs("/content/SafeVixAI/chatbot_service", exist_ok=True)
40
  !ln -sfn /content/data/data/chatbot_service/data /content/SafeVixAI/chatbot_service/data
41
  ```
42
 
43
- ---
44
 
45
- ## 📦 Repository Structure
 
46
 
47
- ```
48
- SafeVixAI-Dataset-Hub/
49
- ├── data/ ← 4.2 GB of raw intelligence data (11,008 files)
50
- │ ├── backend/
51
- │ │ ├── data/ ← Civic intel (OSM data, toll plazas, ward boundaries)
52
- │ │ └── datasets/ ← Raw database assets (blackspots, violations CSVs)
53
- │ ├── chatbot_service/data/ ← Chatbot reference directories & built vector stores
54
- │ └── frontend/offline-data/ ← Regional translation matrices & offline PWA bundles
55
- │
56
- └── scripts/ ← Complete data acquisition & processing pipelines
57
- ├── backend/ ← Core backend and database migration scripts
58
- ├── chatbot_service/ ← Chatbot agent and QA validation scripts
59
- └── scripts/ ← Legacy scrapers, downloaders, and seeders
60
  ```
61
 
62
  ---
63
 
64
- ## 🗂️ Data Contents
65
 
66
- | Category | Files | Size | Source |
67
- |---|---|---|---|
68
- | Emergency Services GIS | `hospitals.csv`, `police_stations.csv`, `fire_stations.csv`, `ambulance.csv` | ~150 MB | OpenStreetMap Overpass API |
69
- | Legal Documents | `motor_vehicles_act_1988.pdf`, `mv_amendment_act_2019.pdf` | ~30 MB | MoRTH / Indian Kanoon |
70
- | Accident Statistics | `kaggle_india_accidents.csv`, `morth_2022/*.csv` | ~250 MB | MoRTH / Kaggle |
71
- | Road Infrastructure | `pmgsy_roads.geojson`, `toll_plazas.csv` | ~900 MB | PMGSY GeoSadak / NHAI |
72
- | Hospital Directory | `hospital_directory.csv`, `nin_facilities.csv` | ~1.2 GB | NHP / NIN |
73
- | Traffic Violations | `violations_seed.csv`, `state_overrides.csv` | ~5 MB | MVA 2019 |
74
- | PWA Translations | `translations/*.json` (11 regional Indian languages) | ~6.4 MB | Automated DeepL/Google Sync |
75
- | Road Damage Model | `road_damage_2025/` | ~800 MB | ONNX + Training Data |
76
- | QA Pairs | `qa_pairs/` | ~50 MB | Custom RAG Training |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
 
78
  ---
79
 
80
- ## 🔬 Scripts — Reproducible Data Pipeline
81
 
82
- The `scripts/` folder mirrors the main application's data acquisition pipeline.
83
- All scripts here are **pure Python** — they run without any database or backend stack.
 
 
 
 
 
 
 
84
 
85
- ### Structure
86
-
87
- ```
88
- scripts/
89
- ├── scripts/data/ ← from SafeVixAI/scripts/data/
90
- │ ├── _overpass_utils.py ← Core GIS utility (basic version)
91
- │ ├── fetch_hospitals.py ← Hospital data from OpenStreetMap
92
- │ ├── fetch_police.py ← Police station data
93
- │ ├── fetch_ambulance.py ← Ambulance service data
94
- │ ├── fetch_blood_banks.py ← Blood bank data
95
- │ ├── fetch_fire.py ← Fire station data
96
- │ ├── download_legal_pdfs.py ← MV Act PDF downloader
97
- │ ├── extract_morth2022_tables.py ← PDF → CSV extractor
98
- │ ├── seed_blackspots.py ← Accident blackspot normalizer
99
- │ ├── bootstrap_local_data.py ← Master data orchestrator
100
- │ ├── verify_data.py ← Data integrity checker
101
- │ ├── inspect_zips.py ← Dataset zip validator
102
- │ ├── audit_env.py ← Environment configuration checker
103
- │ ├── check_all_scripts.py ← Script syntax validator
104
- │ └── setup_kaggle.ps1 ← Kaggle API auth setup
105
- │
106
- ├── backend/data/ ← from SafeVixAI/backend/scripts/data/
107
- │ ├── seed_violations.py ← Traffic fine normalizer (MVA 2019)
108
- │ ├── prepare_road_sources.py ← CSV/GeoJSON → LineString converter
109
- │ ├── sample_pmgsy.py ← PMGSY 867K roads sampler
110
- │ ├── road_sources.example.json ← Manifest template
111
- │ └── road_sources.json ← Active road source manifest
112
- │
113
- └── chatbot_service/data/ ← from SafeVixAI/chatbot_service/scripts/data/
114
- ├── _overpass_utils.py ← Pro GIS utility (with retries + backoff)
115
- ├── fetch_hospitals.py ← Pro hospital fetcher
116
- ├── fetch_police.py ← Pro police fetcher
117
- ├── fetch_ambulance.py ← Pro ambulance fetcher
118
- ├── fetch_blood_banks.py ← Pro blood bank fetcher
119
- └── fetch_fire.py ← Pro fire station fetcher
120
- ```
121
 
122
- ### Running the Scripts
123
 
124
  ```bash
125
  # 1. Setup Kaggle auth (one-time)
126
  pwsh scripts/scripts/data/setup_kaggle.ps1
127
 
128
- # 2. Fetch all emergency service GIS data (Pro versions recommended)
129
  python scripts/chatbot_service/data/fetch_hospitals.py
130
  python scripts/chatbot_service/data/fetch_police.py
131
  python scripts/chatbot_service/data/fetch_ambulance.py
132
  python scripts/chatbot_service/data/fetch_blood_banks.py
133
  python scripts/chatbot_service/data/fetch_fire.py
134
 
135
- # 3. Download legal documents
136
  python scripts/scripts/data/download_legal_pdfs.py
137
-
138
- # 4. Extract MoRTH accident tables
139
  python scripts/scripts/data/extract_morth2022_tables.py
140
 
141
- # 5. Verify everything
142
  python scripts/scripts/data/verify_data.py
143
  ```
144
 
145
- > **Note:** `chatbot_service/data/` versions of the fetchers are the **Pro versions** — they include retry logic, exponential backoff, and more precise Indian GIS selectors.
146
-
147
  ---
148
 
149
- ## 📓 Research Notebooks — Open in Colab
150
 
151
- > We advise running all notebooks through **Google Colab** for the easiest setup. Colab gives you a free T4 GPU with 16 GB of VRAM. All notebooks were built and tested on Colab, so it is the most stable platform. Any other cloud provider should work too.
152
-
153
- | # | Notebook | What It Produces | Open in Colab |
154
- |---|---|---|---|
155
- | 1 | **YOLOv8 Pothole Detector Training** | ONNX road damage model | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1oe4Gk899lFB_vbRMUuOh4dqpsa3bbycI) |
156
- | 2 | **ChromaDB RAG Vectorstore Build** | ChromaDB index for legal RAG | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1AzPdN9xjcjW20ko0shTYn0mvbxTUw57Q) |
157
- | 3 | **Accident EDA & Hotspot Generator** | Blackspot seed CSV + heatmap | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1xh_lwv_B_jc0_83dvuNppWQRtVhqExTS) |
158
- | 4 | **Roads Data Processing** | Sampled PMGSY GeoJSON | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/10_WfTlbbxW9A7ceQBZGaKF5UkydlUDin#scrollTo=z4XxGZmx0ymX) |
159
- | 5 | **Risk Model ONNX Training** | Risk scoring ONNX model | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/16IH-rn3CedYtfIpJP4iLa_KUjvfy8hAY) |
160
 
161
  **Recommended run order:** `1 → 2 → 3 → 4 → 5`
162
 
163
- > Each notebook auto-clones this Hub at the start — no manual data setup needed.
164
-
165
  ---
166
 
167
- ## 📜 License
168
 
169
- Apache 2.0 — See [LICENSE](LICENSE)
170
 
171
- Data sourced from OpenStreetMap (ODbL), MoRTH (Government of India Open Data), Kaggle, PMGSY GeoSadak, and National Health Portal.
 
6
  language:
7
  - en
8
  - hi
9
+ - bn
10
+ - gu
11
+ - kn
12
+ - ml
13
+ - mr
14
+ - pa
15
+ - ta
16
+ - te
17
+ - ur
18
  tags:
19
  - road-safety
20
  - india
 
22
  - traffic-law
23
  - geospatial
24
  - rag
25
+ - yolov8
26
+ - onnx
27
+ - chromadb
28
+ - morth
29
+ - indian-roads
30
  pretty_name: SafeVixAI Dataset Hub
31
  size_categories:
32
+ - 10K<n<100K
33
  ---
34
 
35
+ # SafeVixAI Dataset Hub
36
 
37
  > The **Intelligence Layer** for the SafeVixAI platform — IIT Madras Road Safety Hackathon 2026
38
 
39
+ This repository hosts the curated datasets, pre-trained ONNX exports, reproducible data pipelines, and Google Colab notebooks powering SafeVixAI across **11,098 repository files** (~4.45 GB uncompressed).
40
 
41
+ - **Main Application Repo:** [SafeVixAI/SafeVixAI (GitHub)](https://github.com/SafeVixAI/SafeVixAI)
42
+ - **Standalone Model Cards:**
43
+ - [SafeVixAI/pothole-detector-yolov8n](https://huggingface.co/SafeVixAI/pothole-detector-yolov8n) (`pothole.pt` + `pothole.onnx` road damage detector)
44
+ - [SafeVixAI/road-risk-scorer-onnx](https://huggingface.co/SafeVixAI/road-risk-scorer-onnx) (`risk_model.onnx` segment risk scorer)
45
+ - **Interactive Demo Space:** [SafeVixAI/safevixai-road-safety-demo](https://huggingface.co/spaces/SafeVixAI/safevixai-road-safety-demo)
46
 
47
  ---
48
 
49
+ ## Quickstart (Google Colab / Python)
50
 
51
  ```python
52
+ # Clone the full dataset hub
53
  !git clone https://huggingface.co/datasets/SafeVixAI/SafeVixAI-Dataset-Hub /content/data
54
 
55
+ # Symlink chatbot knowledge assets into the app workspace
56
  import os
57
  os.makedirs("/content/SafeVixAI/chatbot_service", exist_ok=True)
58
  !ln -sfn /content/data/data/chatbot_service/data /content/SafeVixAI/chatbot_service/data
59
  ```
60
 
61
+ Or download individual files selectively via `huggingface_hub`:
62
 
63
+ ```python
64
+ from huggingface_hub import hf_hub_download
65
 
66
+ blackspots = hf_hub_download(
67
+ repo_id="SafeVixAI/SafeVixAI-Dataset-Hub",
68
+ filename="data/frontend/offline-data/blackspot_seed.csv",
69
+ repo_type="dataset",
70
+ )
 
 
 
 
 
 
 
 
71
  ```
72
 
73
  ---
74
 
75
+ ## Repository Structure (`11,098` Files · `4.45 GB`)
76
 
77
+ ```text
78
+ SafeVixAI-Dataset-Hub/
79
+ ├── README.md, LICENSE, requirements.txt
80
+ ├── notebooks/ ← 5 reproducible Colab training/processing notebooks + README.md
81
+ ├── data/ ← 11,000 intelligence & dataset files (~4.44 GB)
82
+ │ ├── backend/
83
+ │ │ ├── data/civic_intel/ ← Civic infrastructure, OSM road segments & boundary metadata
84
+ │ │ └── datasets/ ← AccidentsBig.csv, india_road_accident_coords.csv, city road CSVs
85
+ │ ├── chatbot_service/ ← 10,511 files: pothole_training, PMGSY roads, legal PDFs, ChromaDB, QA pairs
86
+ │ └── frontend/
87
+ │ ├── offline-data/ ← PWA bundles, blackspots & 11 Indian language translation JSONs
88
+ │ └── public/
89
+ │ ├── models/ ← Edge ONNX exports (pothole.onnx, risk_model.onnx)
90
+ │ └── offline-data/ ← Static PWA offline bundles
91
+ └── scripts/ ← 88 reproducible data, backend & QA validation scripts
92
+ ├── backend/
93
+ │ ├── app/ ← DB seeding, RLS audit, vectorstore & offline bundle scripts
94
+ │ └── data/ ← Road source manifests, PMGSY sampler & MVA 2019 violation seeders
95
+ ├── chatbot_service/
96
+ │ ├── app/ ← Emergency service seeding helpers
97
+ │ └── data/ ← Retrying Overpass GIS fetchers (hospitals, police, ambulance, fire)
98
+ └── scripts/
99
+ ├── app/, data/, docs/ ← Master data bootstrapper, MoRTH PDF extractors & verification scripts
100
+ └── chatbot_service/data/ ← Reference Motor Vehicles Act & WHO Trauma Care PDFs
101
+ ```
102
 
103
  ---
104
 
105
+ ## Data Contents
106
 
107
+ | Category | Key Paths | Scale | Primary Sources |
108
+ | --- | --- | --- | --- |
109
+ | Pothole Vision Training | `data/chatbot_service/pothole_training/` | 9,928 files (~1.65 GB) | Roboflow Pothole v3 + Kaggle RDD2022 |
110
+ | Road Infrastructure | `data/chatbot_service/data/roads/` (`pmgsy_roads.geojson`, `pmgsy-geosadak-master.zip`) | ~1.98 GB | PMGSY GeoSadak / NHAI |
111
+ | Legal & RAG Corpus | `data/chatbot_service/legal/`, `scripts/scripts/chatbot_service/data/legal/`, `qa_pairs/`, `chroma_db/` | ~483 MB | Motor Vehicles Act 1988 & Amendment 2019, MoRTH, WHO Trauma Care |
112
+ | Accident & Blackspots | `data/backend/datasets/`, `data/chatbot_service/accidents/`, `data/frontend/offline-data/` | ~256 MB | MoRTH / Kaggle India Road Accidents |
113
+ | Emergency Services GIS | `data/chatbot_service/hospitals/`, `emergency_services/`, `emergency/` | ~42 MB | OpenStreetMap Overpass API, NHP / NIN |
114
+ | PWA Multilingual Bundles | `data/frontend/offline-data/translations/*.json` (11 languages: `bn, en, gu, hi, kn, ml, mr, pa, ta, te, ur`) | ~26 MB | SafeVixAI PWA Localization |
115
+ | Edge ONNX Exports | `data/frontend/public/models/pothole.onnx`, `risk_model.onnx` | ~12.3 MB | Exported from SafeVixAI Colab pipelines |
116
 
117
+ ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
 
119
+ ## Reproducible Data Pipelines (`scripts/`)
120
 
121
  ```bash
122
  # 1. Setup Kaggle auth (one-time)
123
  pwsh scripts/scripts/data/setup_kaggle.ps1
124
 
125
+ # 2. Fetch emergency service GIS data (with retries + backoff)
126
  python scripts/chatbot_service/data/fetch_hospitals.py
127
  python scripts/chatbot_service/data/fetch_police.py
128
  python scripts/chatbot_service/data/fetch_ambulance.py
129
  python scripts/chatbot_service/data/fetch_blood_banks.py
130
  python scripts/chatbot_service/data/fetch_fire.py
131
 
132
+ # 3. Download legal PDFs & extract MoRTH tables
133
  python scripts/scripts/data/download_legal_pdfs.py
 
 
134
  python scripts/scripts/data/extract_morth2022_tables.py
135
 
136
+ # 4. Verify dataset integrity
137
  python scripts/scripts/data/verify_data.py
138
  ```
139
 
 
 
140
  ---
141
 
142
+ ## Research Notebooks (`notebooks/`)
143
 
144
+ | # | Notebook | Output | Open in Colab |
145
+ | --- | --- | --- | --- |
146
+ | 1 | **YOLOv8 Pothole Detector Training** | ONNX + PyTorch road damage detector | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1oe4Gk899lFB_vbRMUuOh4dqpsa3bbycI) |
147
+ | 2 | **ChromaDB RAG Vectorstore Build** | ChromaDB index for legal & first-aid RAG | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1AzPdN9xjcjW20ko0shTYn0mvbxTUw57Q) |
148
+ | 3 | **Accident EDA & Hotspot Generator** | Blackspot seed CSV + hotspot summaries | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1xh_lwv_B_jc0_83dvuNppWQRtVhqExTS) |
149
+ | 4 | **Roads Data Processing** | Sampled PMGSY road network GeoJSON | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/10_WfTlbbxW9A7ceQBZGaKF5UkydlUDin#scrollTo=z4XxGZmx0ymX) |
150
+ | 5 | **Risk Model ONNX Training** | GradientBoosting ONNX segment risk scorer | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/16IH-rn3CedYtfIpJP4iLa_KUjvfy8hAY) |
 
 
151
 
152
  **Recommended run order:** `1 → 2 → 3 → 4 → 5`
153
 
 
 
154
  ---
155
 
156
+ ## License & Attribution
157
 
158
+ Licensed under **Apache 2.0** — see [LICENSE](LICENSE).
159
 
160
+ Third-party upstream data incorporates OpenStreetMap (ODbL), MoRTH / Government of India Open Data, PMGSY GeoSadak, National Health Portal, WHO Trauma Care Guidelines, and Kaggle / Roboflow road damage benchmarks under their respective upstream terms.