Skip to main content

AI-powered fire detection system using Gemma 3N E4B vision model

Project description

FireSense

Python 3.11+ License: MIT

FireSense is an AI-powered fire detection system that uses the Gemma 3N E4B vision model to analyze video content for fire and smoke detection. It provides real-time analysis, comprehensive fire characteristics assessment, and emergency response recommendations.

Features

  • 🚀 Fast Development: Leverages uv for 10-100x faster dependency installation
  • 📦 Modern Packaging: PEP 621 compliant with pyproject.toml
  • 🔍 Type Safety: Full mypy strict mode support
  • Testing: Comprehensive pytest setup with coverage
  • 🎨 Code Quality: Pre-configured with ruff, black, and pre-commit
  • 📚 Documentation: Ready for MkDocs with Material theme
  • 🔄 CI/CD: GitHub Actions workflow included

Quick Start

Prerequisites

  • Python 3.11 or higher
  • uv package manager

Installation

From PyPI (Recommended)

pip install firesense

From Source

  1. Clone the repository:
git clone https://github.com/gregorymulla/firesense_ai.git
cd firesense_ai
  1. Install with pip:
pip install -e ".[dev]"

Using uv (Fastest)

  1. Install uv:
curl -LsSf https://astral.sh/uv/install.sh | sh
  1. Install firesense:
uv pip install firesense

Usage

Running the Application

# Analyze a video file
firesense analyze video.mp4

# Analyze with custom settings
firesense analyze video.mp4 --interval 1.0 --confidence 0.8

# Preview frame extraction
firesense preview video.mp4 --frames 10

# Launch demo UI
firesense demo wildfire_example_01

# Process multiple videos
firesense batch /path/to/videos --pattern "*.mp4"

Development Commands

# Run tests
make test

# Run linting
make lint

# Format code
make format

# Type check
make type-check

# Run all checks
make check

# Build documentation
make docs

# Clean build artifacts
make clean

Project Structure

firesense/
├── src/gemma_3n/       # Source code
│   └── fire_detection/ # Fire detection system
│       ├── models/     # Data models and AI interface
│       ├── processing/ # Video and frame processing
│       └── vision/     # Computer vision utilities
├── tests/              # Test suite
│   ├── unit/           # Unit tests
│   └── integration/    # Integration tests
├── docs/               # Documentation
├── scripts/            # Utility scripts
└── .github/            # GitHub Actions

Configuration

The application can be configured using environment variables with the GEMMA_ prefix:

export GEMMA_DEBUG=true
export GEMMA_API_PORT=9000
export GEMMA_LOG_LEVEL=DEBUG

Or using a .env file:

GEMMA_DEBUG=true
GEMMA_API_PORT=9000
GEMMA_LOG_LEVEL=DEBUG

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run tests and checks (make check)
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

firesense-0.1.0.tar.gz (9.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

firesense-0.1.0-py3-none-any.whl (37.4 kB view details)

Uploaded Python 3

File details

Details for the file firesense-0.1.0.tar.gz.

File metadata

  • Download URL: firesense-0.1.0.tar.gz
  • Upload date:
  • Size: 9.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.8

File hashes

Hashes for firesense-0.1.0.tar.gz
Algorithm Hash digest
SHA256 07d4004d7a2cdd1f22814c840950ec4d50058c64c5ce868c3c896303d86ecb0b
MD5 2121220ac7fc36a429fce4bd121be37d
BLAKE2b-256 cdebe121bba77a1d442e1e1360a604f42d52bab345749712429e3bf6711b33d4

See more details on using hashes here.

File details

Details for the file firesense-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: firesense-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 37.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.8

File hashes

Hashes for firesense-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aa5f2636ba7cedae06ea26d8b0fcffd4e10fb5be94cbad48f2efedfa5fc7c387
MD5 90b9b4f878402f947e36a3e5af30fccb
BLAKE2b-256 cfe3addf7d5e0d204ba689edf9fc3500cc55e7d50fa8421385a5d7c009db1b2c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page