This project is an automated AI pipeline designed to ingest complex inspection and thermal PDF reports and synthesize a professional, structured Detailed Diagnostic Report (DDR). Video Link: https://www.loom.com/share/fd7af0c5083e478ebb8da5c8e2b03f05
The workflow extracts text and images from multiple sources, processes them through a high-reasoning LLM (Google Gemini 2.5 Flash), and generates a client-ready PDF with:
- Professional Metadata: Site Address, Structure Type, Age, etc.
- Color-Coded Checklists: High-fidelity tabular assessments with status-based colors (Red/Yellow/Brown).
- Contextual Image Mapping: Photos are automatically placed alongside relevant observations.
- Summary Matrix: A final table mapping impacted areas to their probable root causes.
- Dimensional Filtering: Automatically discards tiny/noise PDF artifacts (<150x150 pixels) to ensure clean reports.
- Auto-Retries: Integrated with
tenacityfor exponential backoff retries against transient API 503 errors. - Strict Schema Enforcement: Uses Pydantic to guarantee 100% valid JSON responses from the AI.
- Intelligent Word Wrapping: Custom horizontal space boundary logic inside the FPDF engine to prevent rendering crashes.
app.py: FastAPI backend and API routes.frontend/: Web interface (HTML/CSS/JS).main.py: CLI orchestration script.pdf_processor.py: PDF extraction logic (text/images).llm_analyzer.py: Gemini 2.5 Flash integration.report_generator.py: PDF layout engine.Sample Report.pdf&Thermal Images.pdf: Input files.Main_DDR_Output.pdf: Final generated output.
- Prerequisites: Python 3.10+ and a Google Gemini API Key.
- Installation:
python -m venv venv .\venv\Scripts\activate pip install -r requirements.txt
- Environment: Create a
.envfile and add:GEMINI_API_KEY=your_key_here
- Run:
- Web Interface (Recommended):
Access at:
uvicorn app:app --reload
http://127.0.0.1:8000/ - CLI Mode:
python main.py
- Web Interface (Recommended):
- Loom Video Link: Watch Video
- GitHub Repository Link: jayeshpandey01/DDR-Reports
- Project Demo Link: http://127.0.0.1:8000/ (Local Dev)
Built within the 24-hour AI Workflow Challenge.