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
1from __future__ import annotations2 3import gzip4import sys5from pathlib import Path6 7 8def compress_geojson_files(directory: str, level: int = 9) -> None:9 data_dir = Path(directory)10 if not data_dir.is_dir():11 print(f"Directory not found: {data_dir}")12 return13 14 geojson_files = list(data_dir.glob("*.geojson")) + list(data_dir.glob("*.json"))15 if not geojson_files:16 print(f"No GeoJSON/JSON files found in {data_dir}")17 return18 19 total_orig = 020 total_comp = 021 22 for src in geojson_files:23 if src.suffix == ".gz":24 continue25 26 data = src.read_bytes()27 compressed = gzip.compress(data, compresslevel=level)28 29 dst = src.with_name(f"{src.name}.gz")30 dst.write_bytes(compressed)31 32 orig_kb = len(data) / 102433 comp_kb = len(compressed) / 102434 reduction = (1 - len(compressed) / max(len(data), 1)) * 10035 total_orig += len(data)36 total_comp += len(compressed)37 38 print(f"{src.name}: {orig_kb:.1f}KB -> {comp_kb:.1f}KB ({reduction:.0f}% reduction)")39 40 if total_orig:41 overall = (1 - total_comp / total_orig) * 10042 print(f"\nTotal: {total_orig/1024:.1f}KB -> {total_comp/1024:.1f}KB ({overall:.0f}% overall reduction)")43 44 45if __name__ == "__main__":46 target = sys.argv[1] if len(sys.argv) > 1 else "frontend/public/offline-data"47 compress_geojson_files(target)48 