|
| 1 | +# π Insurance Image/Video Analyzer β OCI GenAI |
| 2 | + |
| 3 | +A Streamlit-based multimodal application that analyzes **vehicle images or videos** for insurance claim triage using **Oracle Generative AI**. |
| 4 | + |
| 5 | +This tool allows insurance professionals and adjusters to upload accident images or a short video clip, and receive a concise, expert-style report summarizing vehicle condition, visible damages, and safety concerns β all generated through a single multimodal LLM call. |
| 6 | + |
| 7 | +**Author:** Ali Ottoman |
| 8 | +**Reviewed date:** 13.10.2025 |
| 9 | + |
| 10 | +--- |
| 11 | + |
| 12 | +## π§ Features |
| 13 | + |
| 14 | +### Unified Image & Video Analysis |
| 15 | +- Upload multiple **images**, a single **video**. |
| 16 | +- For videos: frames are extracted automatically (at a user-set interval) and analyzed **collectively** in one final pass (per 10 frames). |
| 17 | +- Generates one unified report summarizing all perspectives. |
| 18 | + |
| 19 | +### Insurance-Focused Vehicle Damage Report |
| 20 | +- Custom prompt tuned for **insurance adjuster** workflows. |
| 21 | +- Structured output covering: |
| 22 | + - Vehicle details (make, model, color, visible plates) |
| 23 | + - Damage assessment by section (front, rear, sides, roof, wheels) |
| 24 | + - Safety & driveability insights |
| 25 | + - ADAS & sensor recalibration notes |
| 26 | + - Prior damage indicators |
| 27 | + - Concise summary for claims review |
| 28 | + |
| 29 | +### Multimodal LLM (Llama 4 Maverick) |
| 30 | +- Performs reasoning across **all frames and views** to remove duplicates and highlight consistent damage regions. |
| 31 | +- Handles both still images and continuous video input. |
| 32 | +- Supports temperature control and token limit configuration. |
| 33 | + |
| 34 | +### Streamlit Front-End |
| 35 | +- Simple upload interface with thumbnail previews. |
| 36 | +- Real-time progress indicators and structured results display. |
| 37 | +- Sidebar controls for frame interval, max frames, and temperature. |
| 38 | + |
| 39 | +--- |
| 40 | + |
| 41 | +## π₯ Who Can Use This |
| 42 | + |
| 43 | +**Insurance Adjusters & Claims Teams** |
| 44 | +β Rapidly review visual evidence from claim submissions with a single summarized analysis. |
| 45 | + |
| 46 | +**Fleet Managers & Repair Centers** |
| 47 | +β Assess damage consistency across multiple images or dashcam videos. |
| 48 | + |
| 49 | +**Developers & AI Engineers** |
| 50 | +β Extend or integrate the workflow into enterprise insurance platforms on OCI. |
| 51 | + |
| 52 | +--- |
| 53 | + |
| 54 | +## ποΈ Files & Structure |
| 55 | + |
| 56 | +``` |
| 57 | +. |
| 58 | +βββ motor-insurance-chatbot.py # Main Streamlit app |
| 59 | +βββ config.py # OCI config & model IDs (user-provided) |
| 60 | +βββ requirements.txt # Python dependencies |
| 61 | +βββ README.md # You're reading it |
| 62 | +``` |
| 63 | + |
| 64 | +--- |
| 65 | + |
| 66 | +## βοΈ Setup & Installation |
| 67 | + |
| 68 | +### 1. Clone the Repository |
| 69 | +```bash |
| 70 | +git clone https://github.com/your-username/your-repo.git |
| 71 | +cd your-repo |
| 72 | +``` |
| 73 | + |
| 74 | +### 2. Configure OCI Credentials |
| 75 | +Edit your `config.py` file: |
| 76 | + |
| 77 | +```python |
| 78 | +# config.py |
| 79 | +COMPARTMENT_ID = "<your OCI Compartment OCID>" |
| 80 | +MODEL_ID = ["meta.llama-4-maverick-17b-128e-instruct-fp8"] |
| 81 | +``` |
| 82 | + |
| 83 | +Ensure your OCI credentials file (`~/.oci/config`) is correctly configured with API keys and region. |
| 84 | + |
| 85 | +### 3. Install Requirements |
| 86 | +```bash |
| 87 | +pip install -r requirements.txt |
| 88 | +``` |
| 89 | + |
| 90 | +--- |
| 91 | + |
| 92 | +## π Run the App |
| 93 | +```bash |
| 94 | +streamlit run motor-insurance-chatbot.py |
| 95 | +``` |
| 96 | + |
| 97 | +--- |
| 98 | + |
| 99 | +## π How to Use |
| 100 | + |
| 101 | +1. **Upload your files** |
| 102 | + β Images (`.jpg`, `.png`) or one video (`.mp4`, `.avi`, `.mov`) |
| 103 | + β PDFs are also supported (converted to images internally) |
| 104 | + |
| 105 | +2. **Set parameters** |
| 106 | + - Choose frame extraction interval (default = 12) |
| 107 | + - Limit total frames (default = 120) |
| 108 | + - Adjust temperature (default = 0 for deterministic outputs) |
| 109 | + |
| 110 | +3. **Ask your question** |
| 111 | + Example queries: |
| 112 | + - βDescribe the visible vehicle damages.β |
| 113 | + - βSummarize the safety concerns.β |
| 114 | + - βWhat parts likely need recalibration?β |
| 115 | + |
| 116 | +4. **View results** |
| 117 | + β The app displays: |
| 118 | + - Frame thumbnails |
| 119 | + - A single final LLM report combining all inputs |
| 120 | + - Structured markdown-formatted sections |
| 121 | + |
| 122 | +--- |
| 123 | + |
| 124 | +## π οΈ Customization |
| 125 | + |
| 126 | +- Modify `INSURANCE_PROMPT` to tailor report tone or add fields (e.g., **cost estimate**, **liability hints**, **repair recommendations**). |
| 127 | +- Adjust `MAX_VIDEO_FRAMES` and `MAX_TOKENS` for performance vs detail. |
| 128 | +- Add export features (CSV, PDF) via Streamlitβs `st.download_button`. |
| 129 | + |
| 130 | +--- |
| 131 | + |
| 132 | +## π§ Example Interaction |
| 133 | + |
| 134 | +**You:** *Describe visible damages and safety concerns.* |
| 135 | + |
| 136 | +**AI (Maverick):** |
| 137 | +> **Vehicle Details:** Red Toyota Corolla 2021, rear plate visible. |
| 138 | +> **Damage Assessment:** Moderate rear bumper impact with scratched paint; left taillight cracked; minor dent on rear quarter panel. |
| 139 | +> **Safety & Driveability:** Lights partially damaged but vehicle likely drivable; no airbag deployment visible. |
| 140 | +> **Summary:** Rear collision impact focused on left side; requires bumper and light replacement. |
| 141 | +
|
| 142 | +--- |
| 143 | + |
| 144 | +## π§ OCI Services Used |
| 145 | + |
| 146 | +1. **OCI Generative AI β Llama 4 Maverick** |
| 147 | + β Multimodal text + image/video reasoning |
| 148 | + ```python |
| 149 | + from langchain_community.chat_models.oci_generative_ai import ChatOCIGenAI |
| 150 | + ``` |
| 151 | + |
| 152 | +--- |
| 153 | + |
| 154 | +## π Docs & References |
| 155 | + |
| 156 | +π [OCI Generative AI Overview](https://docs.oracle.com/en-us/iaas/Content/generative-ai/home.htm) |
| 157 | + |
| 158 | +--- |
| 159 | + |
| 160 | +## π License |
| 161 | + |
| 162 | +Copyright (c) 2025 Oracle and/or its affiliates. |
| 163 | +**MIT License** β see `LICENSE` for details. |
0 commit comments