SafeVixAI/SafeVixAI-Dataset-Hub
SafeVixAI Dataset Hub 🛡️ The Intelligence Layer for the SafeVixAI platform — IIT Madras Road Safety Hackathon 2026 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. Main Application Repo: SafeVixAI/SafeVixAI ⚡ Quickstart (Google Colab) # Clone the entire intelligence layer !git… See the full description on the dataset page: https://huggingface.co/datasets/SafeVixAI/SafeVixAI-Dataset-Hub.
1147
1{2 "cells": [3 {4 "cell_type": "markdown",5 "metadata": {},6 "source": [7 "# Roads & Toll Plaza Data Processing\n",8 "\n",9 "**Output:** `toll_plazas_lite.json` -> deployed to `backend/data/roads/`\n",10 "\n",11 "This notebook processes the **NHAI Toll Plaza dataset** to produce a lightweight JSON\n",12 "suitable for the SafeVixAI backend API and offline PWA map layer.\n",13 "\n",14 "---\n",15 "### Dataset\n",16 "- **Source:** NHAI Open Data / custom toll_plazas.csv\n",17 "- **Fields:** Name, NH Number, Latitude, Longitude\n",18 "- **Coverage:** All operational toll plazas on National Highways\n",19 "\n",20 "### Pipeline\n",21 "`toll_plazas.csv -> Select key columns -> Rename headers -> Export toll_plazas_lite.json`"22 ]23 },24 {25 "cell_type": "markdown",26 "metadata": {},27 "source": [28 "## Step 1 - Upload & Process Toll Plaza CSV\n",29 "\n",30 "Upload `toll_plazas.csv` from `backend/data/roads/toll_plazas.csv`\n",31 "\n",32 "The processing pipeline:\n",33 "1. Reads the CSV with `pandas`\n",34 "2. Selects only 4 essential columns: `name, id, lat, lon`\n",35 "3. Drops rows with missing coordinates\n",36 "4. Renames to human-readable headers\n",37 "5. Exports as `toll_plazas_lite.json`\n",38 "\n",39 "The resulting JSON is consumed by the backend `/api/roads/tolls` endpoint\n",40 "and the offline PWA map layer for toll overlay rendering."41 ]42 },43 {44 "cell_type": "code",45 "execution_count": null,46 "metadata": {47 "colab": {48 "base_uri": "https://localhost:8080/",49 "height": 9050 },51 "id": "RjBm7RAZO-O0",52 "outputId": "beacaaad-3b29-4737-8664-ee8c2d92a645"53 },54 "outputs": [],55 "source": [56 "# Cell 1 — Toll Plazas Lite\n",57 "import pandas as pd, json\n",58 "from google.colab import files\n",59 "\n",60 "print(\"▶ UPLOAD your toll_plazas.csv NOW:\")\n",61 "uploaded = files.upload()\n",62 "filename = list(uploaded.keys())[0]\n",63 "\n",64 "toll = pd.read_csv(filename)\n",65 "# The dataset headers are: name, id, lat, lon\n",66 "toll_summary = toll[['name', 'id', 'lat', 'lon']].dropna().rename(columns={\n",67 " 'name': 'Plaza Name',\n",68 " 'id': 'NH Number',\n",69 " 'lat': 'Latitude',\n",70 " 'lon': 'Longitude'\n",71 "}).to_dict(orient='records')\n",72 "\n",73 "with open('toll_plazas_lite.json', 'w') as f:\n",74 " json.dump(toll_summary, f, indent=2)\n",75 "files.download('toll_plazas_lite.json')\n"76 ]77 }78 ],79 "metadata": {80 "colab": {81 "provenance": []82 },83 "kernelspec": {84 "display_name": "Python 3",85 "name": "python3"86 },87 "language_info": {88 "name": "python"89 }90 },91 "nbformat": 4,92 "nbformat_minor": 093}94 