Metadata-Version: 2.4
Name: firesense
Version: 0.10.2
Summary: AI-powered fire detection system using Gemma 3N E4B vision model
Project-URL: Homepage, https://github.com/gregorymulla/firesense_ai
Project-URL: Documentation, https://github.com/gregorymulla/firesense_ai#readme
Project-URL: Repository, https://github.com/gregorymulla/firesense_ai
Project-URL: Issues, https://github.com/gregorymulla/firesense_ai/issues
Author-email: Gregory Mulla <gregory.cr.mulla@gmail.com>
Maintainer-email: Gregory Mulla <gregory.cr.mulla@gmail.com>
License: MIT
License-File: LICENSE
Keywords: ai,computer-vision,fire-detection,gemma,safety,video-analysis,wildfire
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.11
Requires-Dist: accelerate>=0.25.0
Requires-Dist: aiofiles>=23.2.0
Requires-Dist: fastapi>=0.109.0
Requires-Dist: httpx>=0.25.0
Requires-Dist: huggingface-hub[cli]>=0.34.2
Requires-Dist: numpy>=1.24.0
Requires-Dist: opencv-python>=4.8.0
Requires-Dist: pillow>=10.0.0
Requires-Dist: protobuf>=6.31.1
Requires-Dist: pydantic-settings>=2.0.0
Requires-Dist: pydantic>=2.5.0
Requires-Dist: pyngrok>=7.2.12
Requires-Dist: rich>=13.7.0
Requires-Dist: sentencepiece>=0.1.99
Requires-Dist: timm>=0.9.0
Requires-Dist: torch>=2.1.0
Requires-Dist: torchvision>=0.16.0
Requires-Dist: tqdm>=4.66.0
Requires-Dist: transformers>=4.36.0
Requires-Dist: typer>=0.9.0
Requires-Dist: unsloth>=2024.1
Requires-Dist: uvicorn>=0.25.0
Requires-Dist: yt-dlp>=2024.1.0
Provides-Extra: dev
Requires-Dist: black>=23.12.0; extra == 'dev'
Requires-Dist: mypy>=1.7.0; extra == 'dev'
Requires-Dist: pre-commit>=3.5.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
Requires-Dist: pytest>=7.4.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mkdocs-material>=9.5.0; extra == 'docs'
Requires-Dist: mkdocs>=1.5.0; extra == 'docs'
Requires-Dist: mkdocstrings[python]>=0.24.0; extra == 'docs'
Provides-Extra: quantization
Requires-Dist: bitsandbytes>=0.41.0; (sys_platform != 'darwin') and extra == 'quantization'
Provides-Extra: youtube
Requires-Dist: yt-dlp>=2023.12.30; extra == 'youtube'
Description-Content-Type: text/markdown

# FireSense

[![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

FireSense is a video feed analyzer that detects fires, powered by the Gemma 3N vision model.

<a href="https://youtu.be/16kw5rZLims">
  <img src="images/presentation.png" alt="FireSense Demo" width="800px">
</a>

## Pipeline

<img src="images/pipeline.png" alt="FireSense Pipeline" style="max-width: 800px;">



## Quick Start

### Installation

```bash
# Install pypi package
pip install firesense

or

# Install from source code:
uv pip install -e .
```

### Command Line Usage

```bash
# Analyze a YouTube video
firesense analyze <youtube_video_id>

# Launch demo with local server
firesense demo <youtube_video_id> --local

```



https://github.com/user-attachments/assets/b8fdba5b-bd2d-44c6-be4e-8fb6499b62a8





Ngrok Integration
```bash
# setup ngrok
ngrok config add-authtoken <your_ngrok_auth_key>

# Launch demo with local server and ngrok tunnel
firesense demo <youtube_video_id> --local --ngrok

```

### Python Usage

```python
from firesense import setup_model, infer

# Setup model
model, tokenizer = setup_model()

# Run inference
inference_result = infer(model, tokenizer, system_prompt, user_prompt, image_path)
```

## 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 (uv run mypy src)
- ✅ **Testing**: Comprehensive pytest setup with coverage



## 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

## Testing

```bash
# Install the project with development dependencies using:
uv pip install -e ".[dev]"

# Run the tests with:
uv run pytest

```

## Type Safety

```bash
# Full mypy strict mode support 
uv run mypy src
```

## Releasing

New releases are manually pushed to pypi:

```bash

make publish
```

## License

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