The Smart FIR Generation System is an AI-powered web service designed to streamline the process of generating First Information Reports (FIRs). Leveraging computer vision, OCR, and deep learning, this system can extract text, detect objects, and identify faces from uploaded images to automatically generate an FIR.
- 📸 Image Processing – Extracts text, detects objects, and recognizes faces in crime scene images.
- 🤖 AI-powered FIR Generation – Uses advanced AI models to analyze image data and generate FIR content.
- 🔍 OCR (Optical Character Recognition) – Reads text from crime scene images.
- 🧑🤝🧑 Face Recognition – Identifies known individuals from a database.
- 📊 API-based System – Easily integrates with other applications via REST APIs.
- Backend: Django, Django REST Framework
- AI Models: YOLOv8 (for object detection), Tesseract OCR (for text extraction), Face Recognition
- Database: SQLite (for development), PostgreSQL (recommended for production)
- Storage: Media folder for uploaded images
- AI Agent: Gemini for FIR text generation
git clone https://github.com/jztchl/Smart-FIR-Generation-System.git
cd Smart-FIR-Generation-Systempython -m venv env
source env/bin/activate # On Windows use `env\Scripts\activate`
pip install -r requirements.txtpython manage.py migratepython manage.py runserverUse Postman or cURL to test the API:
curl -X POST -F "image=@crime_scene.jpg" -F "crime_scene=Bank Robbery" http://127.0.0.1:8000/generate-fir/| Method | Endpoint | Description |
|---|---|---|
| POST | /generate-fir/ |
Upload an image and generate an FIR |
| GET | /generate-fir/ |
Retrieve all generated FIRs |
Create a .env file and add:
GEMINI_API_KEY=your_api_key
- 🔒 Use environment variables instead of hardcoding credentials.
- 🚀 Deploy with Gunicorn & Nginx for production.
- 🏦 Use PostgreSQL instead of SQLite in production.
This project is licensed under the MIT License.
💡 Need Help? Feel free to open an issue on GitHub or reach out! 🚀