Skip to content

Sherin-SEF-AI/Incident-Lens-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Incident Lens AI πŸ”βš–οΈ

Professional Forensic Video Analysis & Accident Reconstruction Platform

https://youtu.be/QUVeahUrCTg?si=0KiQewMFjjllYqv4

Screenshot from 2025-12-27 19-38-23 Screenshot from 2025-12-27 19-38-25 Screenshot from 2025-12-27 19-38-28 Screenshot from 2025-12-27 19-38-30 Screenshot from 2025-12-27 19-38-34 Screenshot from 2025-12-27 19-38-36 Screenshot from 2025-12-27 19-38-41 Screenshot from 2025-12-27 19-38-45 Screenshot from 2025-12-27 19-38-48 Screenshot from 2025-12-27 19-38-54 Screenshot from 2025-12-27 19-39-00 Screenshot from 2025-12-27 19-39-06

Incident Lens AI is a production-grade application designed for insurance carriers, legal defense teams, and fleet safety managers. It leverages the multimodal capabilities of Google Gemini 3 Pro to transform unstructured video evidence (dashcam, CCTV, bodycam) into legally admissible forensic reconstructions.

Unlike standard video players, Incident Lens AI "reasons" about the footage in real-time, calculating vehicle speeds, inferring traffic signal states from indirect visual cues, and citing specific legal statutes for fault determination.

πŸš€ Key Features

🧠 Autonomous Reconstruction

  • Physics Engine: Automatically calculates vehicle speed ($v=d/t$) using photogrammetry and motion blur mechanics.
  • Signal Inference: Deduce the state of occluded traffic lights by analyzing cross-traffic flow and pedestrian behavior.
  • Debris Field Analysis: Reverse-engineer impact vectors based on glass shard trajectories and fluid spray patterns.

βš–οΈ Legal Admissibility

  • Search Grounding: Uses the Gemini googleSearch tool to cross-reference observed driving behaviors with real-time case law and vehicle code statutes.
  • Chain of Custody: Performs automated authenticity audits to detect video tampering, frame skipping, or deepfake manipulation.
  • Reasoning Trace: Displays a transparent, step-by-step logic log (Thinking Mode) before generating final conclusions to ensure explainability.

πŸ”Š Multimodal Synthesis

  • Audio-Visual Fusion: Correlates acoustic signatures (tire squeals, horns, impact thuds) with visual frames to determine reaction times precisely.
  • Deep Scan ROI: Users can crop specific regions of interest (license plates, signs) for high-resolution targeted forensic queries.

πŸ“Š Professional Reporting

  • Interactive Dashboard: comprehensive visualization including timelines, fault allocation charts (Pie), and driver risk profiles (Radar).
  • PDF Dossiers: Auto-generates specialized reports for different stakeholders:
    • Executive Summary (Claims Adjusters)
    • Technical Reconstruction (Engineers)
    • Legal Brief (Litigators)

πŸ’Ž Gemini 3 Integration

This project showcases the cutting-edge capabilities of the Gemini 3 Pro model via the @google/genai SDK:

  1. Native Multimodality: Ingests interleaved high-resolution video frames and raw audio waveforms (WAV) in a single context window to understand the complete scene.
  2. Streaming with Tool Use: implementing generateContentStream combined with googleSearch to provide real-time updates while simultaneously querying external legal databases.
  3. Structured JSON Generation: The model is prompted to output strictly typed JSON data structures that directly drive the React UI components (Charts, Timelines, Risk Meters).
  4. Spatial Understanding: Leverages the model's ability to estimate spatial dimensions (wheelbase length, lane width) for physics calibration without LiDAR data.

πŸ› οΈ Tech Stack

  • Frontend: React 19, TypeScript, Vite
  • Styling: Tailwind CSS (Dark Mode Professional UI)
  • AI: Google GenAI SDK (@google/genai)
  • Visualization: Recharts (Radar/Pie Charts), Canvas API (Annotations)
  • Media Processing: Native AudioContext API for waveform extraction
  • Reporting: jsPDF for client-side document generation
  • Icons: Lucide React

⚑ Getting Started

Prerequisites

  • Node.js v18+
  • A Google Cloud Project with the Gemini API enabled.
  • An API Key with access to gemini-3-pro-preview.

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/incident-lens-ai.git
    cd incident-lens-ai
  2. Install dependencies

    npm install
  3. Configure API Key

    • Create a .env file in the root directory (or set it in your deployment environment).
    • Security Note: This is a client-side demo. In production, proxy API calls through a backend.
    API_KEY=your_gemini_api_key_here
  4. Run Development Server

    npm run dev
  5. Build for Production

    npm run build

πŸ“– Usage Guide

  1. Upload Evidence: Drag & drop video files (MP4, MOV) or select a "Training Scenario" from the sidebar.
  2. Initialize Analysis: Click the "Initialize Analysis" button. The system will extract frames and audio.
  3. Monitor Reasoning: Watch the "Live Analysis Stream" to see Gemini's real-time forensic deduction process.
  4. Explore Dashboard:
    • Timeline: Scrub through critical events.
    • Liability: Review fault percentages and cited laws.
    • Physics: Adjust friction coefficients in the "Variable Sandbox" to test speed calculations.
    • Chat: Ask "What If" counterfactual questions (e.g., "What if the driver was going 35mph?").
  5. Export: Click "Export Case" to download a professional PDF dossier.

Author name: Sherin Joseph Roy

email: sherin.joseph2217@gmail.com

website: sherinjosephroy.link

πŸ›‘οΈ License

This project is licensed under the MIT License - see the LICENSE file for details.

Disclaimer: Incident Lens AI is a decision-support tool. All forensic conclusions should be verified by a certified human accident reconstructionist before use in legal proceedings.

About

Incident Lens AI is a professional-grade forensic video analysis suite. It transforms raw crash footage into a defensible legal case file in seconds.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors