AI-powered fire detection system using Gemma 3N E4B vision model
Project description
FireSense
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
- Clone the repository:
git clone https://github.com/gregorymulla/firesense_ai.git
cd firesense_ai
- Install with pip:
pip install -e ".[dev]"
Using uv (Fastest)
- Install uv:
curl -LsSf https://astral.sh/uv/install.sh | sh
- 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
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests and checks (
make check) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Releasing
To publish a new release to PyPI, simply push a commit to the main branch with a message starting with "new release" followed by the version number:
git commit -m "new release 0.3.0"
git push origin main
The GitHub Actions workflow will automatically:
- Extract the version from the commit message
- Update the version in
pyproject.tomland__init__.py - Build and publish the package to PyPI
- Create a git tag
- Create a GitHub release
Note: Make sure you have set up the PYPI_API_TOKEN secret in your GitHub repository settings.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file firesense-0.8.3.tar.gz.
File metadata
- Download URL: firesense-0.8.3.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a4d771d94f66dfad9159ba508cdb7370ee82fcbe98f4cdb7ba2954b296c5478
|
|
| MD5 |
05a6dfc97f82e2481b672efdb3f4bcd7
|
|
| BLAKE2b-256 |
8acc3042511fbf6158c927d2788e519ecfb9a480160f5816bd48529921977729
|
File details
Details for the file firesense-0.8.3-py3-none-any.whl.
File metadata
- Download URL: firesense-0.8.3-py3-none-any.whl
- Upload date:
- Size: 21.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81f3997b6f205ed2e9efd471234933f1c6b45e3826354742c341dcd520eff72f
|
|
| MD5 |
3fa4bc561420e449bcf479bf5f4564c3
|
|
| BLAKE2b-256 |
ddae929010b38f202ae538318bd54ddcf2773e31c857295bb85bd8c178b3bcfb
|