CoolFace
Datasetpublic

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.

sourceHugging Faceapache-2.0updated 4mo agoView on Hugging Face
1likes147downloads
generate_pwa_assets.py83 linesDownload Raw Back to app
1from __future__ import annotations2 3from pathlib import Path4 5from PIL import Image, ImageDraw, ImageFont6 7 8ROOT = Path(__file__).resolve().parents[2]9PUBLIC = ROOT / "frontend" / "public"10ICONS = PUBLIC / "icons"11SCREENSHOTS = PUBLIC / "screenshots"12 13 14def load_font(name: str, size: int) -> ImageFont.FreeTypeFont | ImageFont.ImageFont:15    try:16        return ImageFont.truetype(name, size)17    except OSError:18        return ImageFont.load_default()19 20 21def generate_icons() -> None:22    source = Image.open(ICONS / "icon-512.png").convert("RGBA")23    for size in (72, 96, 128, 144, 152, 192, 384, 512):24        source.resize((size, size), Image.Resampling.LANCZOS).save(25            ICONS / f"icon-{size}.png",26            optimize=True,27        )28 29    source.resize((180, 180), Image.Resampling.LANCZOS).save(30        ICONS / "apple-touch-icon.png",31        optimize=True,32    )33    source.resize((48, 48), Image.Resampling.LANCZOS).save(34        ICONS / "favicon.png",35        optimize=True,36    )37 38 39def generate_dashboard_screenshot() -> None:40    SCREENSHOTS.mkdir(parents=True, exist_ok=True)41    canvas = Image.new("RGB", (1280, 720), "#0A0E14")42    draw = ImageDraw.Draw(canvas)43 44    font_big = load_font("arialbd.ttf", 60)45    font_med = load_font("arialbd.ttf", 30)46    font_small = load_font("arial.ttf", 24)47 48    for x in range(0, 1280, 40):49        draw.line((x, 0, x, 720), fill="#111827")50    for y in range(0, 720, 40):51        draw.line((0, y, 1280, y), fill="#111827")52 53    icon = Image.open(ICONS / "icon-192.png").convert("RGBA")54    canvas.paste(icon, (72, 74), icon)55    draw.text((300, 90), "SafeVixAI", fill="#F8FAFC", font=font_big)56    draw.text((304, 165), "AI-powered road safety command center", fill="#94A3B8", font=font_small)57 58    cards = [59        (80, 300, 350, 500, "#7F1D1D", "SOS", "Emergency dispatch"),60        (400, 300, 670, 500, "#064E3B", "Locator", "Hospitals nearby"),61        (720, 300, 990, 500, "#1E3A8A", "DriveLegal", "MV Act challans"),62        (1040, 300, 1200, 500, "#3B0764", "AI", "RAG assistant"),63    ]64    for x1, y1, x2, y2, color, title, subtitle in cards:65        draw.rounded_rectangle((x1, y1, x2, y2), radius=24, fill=color, outline="#334155", width=2)66        draw.text((x1 + 28, y1 + 45), title, fill="#FFFFFF", font=font_med)67        draw.text((x1 + 28, y1 + 105), subtitle, fill="#CBD5E1", font=font_small)68 69    draw.rounded_rectangle((80, 585, 1200, 650), radius=20, fill="#111827", outline="#1A5C38", width=2)70    draw.text(71        (115, 603),72        "Offline-ready PWA with SOS queue, share target, shortcuts, and first-aid cache",73        fill="#00C896",74        font=font_small,75    )76    canvas.save(SCREENSHOTS / "dashboard.png", optimize=True)77 78 79if __name__ == "__main__":80    generate_icons()81    generate_dashboard_screenshot()82    print("Generated PWA icons and dashboard screenshot.")83 
SafeVixAI/SafeVixAI-Dataset-Hub · CoolFace