|
--- |
|
title: Wild Fire Tracker |
|
emoji: π₯ |
|
colorFrom: yellow |
|
colorTo: purple |
|
sdk: gradio |
|
sdk_version: 5.33.1 |
|
app_file: app.py |
|
pinned: false |
|
license: mit |
|
short_description: A wildfire monitor that alerts authorities in event of fire |
|
tag: mcp-server-track |
|
--- |
|
|
|
# π₯ Wild Fire Tracker |
|
|
|
Real-time fire and smoke detection system using computer vision and AI. Available as both a web application and MCP (Model Context Protocol) server. |
|
|
|
## Features |
|
|
|
- π₯ **Fire Detection**: AI-powered fire detection with confidence scores |
|
- π¨ **Smoke Detection**: Advanced smoke detection capabilities |
|
- πΉ **Multiple Sources**: Webcam, RTSP streams, and video file uploads |
|
- β±οΈ **Real-time Analysis**: Frame analysis every 10 seconds |
|
- π¨ **Visual Feedback**: Color-coded status overlays on video |
|
- π **Confidence Scores**: Shows detection confidence percentages |
|
|
|
## Installation |
|
|
|
```bash |
|
pip install gradio opencv-python-headless torch transformers pillow numpy |
|
``` |
|
|
|
## Usage |
|
|
|
### 1. Gradio Web Application |
|
|
|
Run the web interface: |
|
|
|
```bash |
|
python app.py |
|
``` |
|
|
|
Then open http://localhost:7860 in your browser. |
|
|
|
**Features:** |
|
- Upload video files (MP4, AVI, MOV) |
|
- Connect to webcam or RTSP streams |
|
- Real-time video display with status overlay |
|
- Detection status with timestamps |
|
|
|
### 2. Standalone MCP Server |
|
|
|
For integration with MCP clients: |
|
|
|
```bash |
|
# Install MCP dependency |
|
pip install mcp |
|
|
|
# Run MCP server |
|
python mcp_server_standalone.py |
|
``` |
|
|
|
**MCP Tools:** |
|
- `analyze_image`: Analyze base64 encoded images for fire/smoke |
|
|
|
**Example MCP Client Usage:** |
|
```python |
|
import base64 |
|
import json |
|
|
|
# Encode image to base64 |
|
with open("image.jpg", "rb") as f: |
|
image_b64 = base64.b64encode(f.read()).decode() |
|
|
|
# Call MCP tool |
|
result = await client.call_tool("analyze_image", { |
|
"image_base64": image_b64 |
|
}) |
|
``` |
|
|
|
## Sample Test Videos |
|
|
|
- [Fire Test Video](https://www.pexels.com/video/a-man-carrying-gear-walking-away-from-a-controlled-fire-8552246/) |
|
- [Smoke Test Video](https://www.pexels.com/video/aerial-view-of-controlled-forest-fire-in-spring-31361444/) |
|
|
|
## Status Legend |
|
|
|
- π’ **Green**: All clear (no fire/smoke detected) |
|
- π **Orange**: Fire detected |
|
- β« **Gray**: Smoke detected |
|
- π΄ **Red**: Error or both fire & smoke detected |
|
|
|
## License |
|
|
|
MIT License - see LICENSE file for details. |