fire-detection / README.md
cforge42's picture
Add 90% accuracy to Ember marketing site and README.
60e5c04
|
Raw
History Blame Contribute Delete
5.14 kB
---
title: Innomium Ember
emoji: 🔥
colorFrom: red
colorTo: yellow
sdk: static
app_file: index.html
pinned: false
license: apache-2.0
---
<div align="center">
<img src="innomium_icon.svg" width="88" alt="Innomium logo" />
# Innomium Ember
### Ultra-light YOLO fire, smoke, and extinguisher detection for safety monitoring and edge vision.
**90% accuracy · 3 classes · 9.8 MB ONNX · Runs in browser & on edge**
[![Live Demo](https://img.shields.io/badge/Live_Demo-Open_Space-1565FF?style=for-the-badge)](https://huggingface.co/spaces/innomium/fire-detection)
[![Model Size](https://img.shields.io/badge/Model-9.8_MB-001530?style=for-the-badge)](./weights.onnx)
[![Accuracy](https://img.shields.io/badge/Accuracy-90%25-1565FF?style=for-the-badge)](#performance)
</div>
---
## Overview
**Innomium Ember** is a cutting-edge YOLO-based fire hazard detector — very light, very strong, and built for real-world safety scenes.
Detect **fire**, **smoke**, and **fire extinguisher** with a compact **~9.8 MB ONNX** model that runs on CPU, edge hardware, or directly in the browser.
| | |
|---|---|
| **Classes** | fire · smoke · fire extinguisher |
| **Accuracy** | 90% |
| **Model format** | ONNX |
| **Model size** | ~9.8 MB |
| **Input size** | 640 × 640 |
| **Inference** | Browser (WASM) · Python · Edge CPU/GPU |
| **Post-processing** | Per-class NMS · Smoke merge · Color-prior filters |
---
## Performance
Ember classifies fire hazards in outdoor and industrial scenes with per-class bounding boxes and confidence scores.
<div align="center">
| Input | Ember Output |
|:---:|:---:|
| <img src="example_input.png" width="420" alt="Fire safety scene — input frame" /> | <img src="example_output.png" width="420" alt="Scene with all three hazard classes detected" /> |
| Raw camera frame | Class labels + confidence scores |
</div>
**What this demonstrates:**
- All three hazard classes in one scene: **fire**, **smoke**, and **fire extinguisher**
- Per-class NMS without cross-class suppression
- Flame detections up to 77% alongside smoke (36%) and extinguisher (31%)
- Suitable for outdoor events, safety drills, warehouses, and industrial sites
---
## Key Features
- **Multi-class YOLO** — Fire, smoke, and fire extinguisher with class ID remapping from the ONNX head.
- **Per-class NMS** — Hard NMS applied independently per class to preserve overlapping hazard types.
- **Smoke merge** — Fragmented smoke boxes merge into coherent plumes for cleaner alerts.
- **Color-prior filters** — Borderline fire and extinguisher detections are validated against expected pixel appearance.
- **Privacy-first demo** — The live Space runs inference entirely in your browser. No frames are uploaded.
---
## Use Cases
| Sector | Application |
|--------|-------------|
| **Industrial** | Warehouse and factory fire/smoke monitoring |
| **Commercial** | Kitchen, server room, and office hazard detection |
| **Outdoor** | Wildfire perimeter, campsite, and bonfire flame detection |
| **Safety** | Fire extinguisher location verification in camera views |
---
## Live Demo
Try Ember directly in your browser:
**[https://huggingface.co/spaces/innomium/fire-detection](https://huggingface.co/spaces/innomium/fire-detection)**
1. Open the Space
2. Upload an image or click **Load Example**
3. View detections with class labels and confidence scores
---
## Repository Structure
```
├── index.html # Marketing site + interactive demo
├── main.js / detector.js # Browser inference (ONNX Runtime Web)
├── weights.onnx # ONNX model weights (Git LFS)
├── app.py # Python FireDetector for batch / server use
├── example_input.png # Sample input frame
├── example_output.png # Sample detection output
└── innomium_icon.svg # Innomium logo
```
---
## Local Python Usage
```bash
pip install -r requirements.txt
```
```python
from pathlib import Path
import cv2
from app import FireDetector
detector = FireDetector(Path("."))
image = cv2.imread("example_input.png")
boxes = detector.predict_image(image)
for box in boxes:
print(detector.class_names[box.cls_id], box.conf)
```
### Batch inference
```python
results = detector.predict_batch([image], offset=0, n_keypoints=0)
for frame in results:
print(frame.frame_id, len(frame.boxes))
```
---
## Model Pipeline
1. **Letterbox preprocess** — Resize and pad to model input (640×640)
2. **ONNX inference** — YOLO multi-class fire hazard detection
3. **Class remap** — Map model head order to `[fire, smoke, fire extinguisher]`
4. **Per-class NMS** — Independent hard NMS per hazard class
5. **Smoke merge & fire suppress** — Merge fragmented smoke; suppress nested fire duplicates
6. **Color filters** — Validate borderline fire/extinguisher boxes against pixel appearance
---
## About Innomium
Innomium builds cutting-edge computer vision models for mission-critical environments — where accuracy, latency, and deployability all matter.
**Very light. Very strong. Built for safety.**
---
## License
Apache 2.0