An open API service indexing awesome lists of open source software.

https://github.com/pyronear/pyro-engine

Wildfire detection on edge devices
https://github.com/pyronear/pyro-engine

docker image-classification onnxruntime python raspberry-pi wildfire

Last synced: 3 months ago
JSON representation

Wildfire detection on edge devices

Awesome Lists containing this project

README

        

![PyroNear Logo](docs/source/_static/img/pyronear-logo-dark.png)



CI Status


Documentation Status


Test coverage percentage


black





PyPi Version


Anaconda Version


DockerHub version

pyversions
license

# PyroEngine: Wildfire detection on edge devices

PyroEngine provides a high-level interface to use Deep learning models in production while being connected to the alert API.

## Quick Tour

### Running your engine locally

You can use the library like any other python package to detect wildfires as follows:

```python
from pyroengine.core import Engine
from PIL import Image

engine = Engine()

im = Image.open("path/to/your/image.jpg").convert('RGB')

prediction = engine.predict(im)
```

## Setup

Python 3.9 (or higher) and [pip](https://pip.pypa.io/en/stable/)/[conda](https://docs.conda.io/en/latest/miniconda.html) are required to install PyroEngine.

### Developer installation

If you wish to use the latest features of the project that haven't made their way to a release yet, you can install the package from source:

```shell
git clone https://github.com/pyronear/pyro-engine.git
pip install -e pyro-engine/.
```

### Full docker orchestration

In order to run the project, you will need to specify some information, which can be done using a `.env` file.
This file will have to hold the following information:
- `API_URL`: the URL of the API where to send alerts
- `CAM_USER`: the username to access the camera
- `CAM_PWD`: the password to access the camera

So your `.env` file should look something like this:

```
API_URL=https://api.pyronear.org
CAM_USER=my_dummy_login
CAM_PWD=my_dummy_pwd
```

Additionally, you'll need a `./data` folder which contains:
- `credentials.json`: a dictionary with the IP address of your cameras as key, and dictionary with entries `login` & `password` for their Alert API credentials
- `model.onnx`: optional, will override the model weights download from HuggingFace Hub
- `config.json`: optional, will override the model config download from HuggingFace Hub

### Example of `credentials.json`:

```json
{
"169.254.40.1": {
"brand": "reolink",
"type": "ptz",
"credentials": [
{
"login": "dummy_login_1",
"password": "dummy_password_1",
"posid": 1
},
{
"login": "dummy_login_2",
"password": "dummy_password_2",
"posid": 2
},
{
"login": "dummy_login_3",
"password": "dummy_password_3",
"posid": 3
}
]
},
"169.254.40.3": {
"brand": "reolink",
"type": "static",
"credentials": [
{
"login": "dummy_login_4",
"password": "dummy_password_4"
}
]
}
}
```

## Documentation

The full package documentation is available [here](https://pyronear.org/pyro-engine/) for detailed specifications.

## Contributing

Please refer to [`CONTRIBUTING`](CONTRIBUTING.md) if you wish to contribute to this project.

## Credits

This project is developed and maintained by the repo owner and volunteers from [Pyronear](https://pyronear.org/).

## License

Distributed under the Apache 2 License. See [`LICENSE`](LICENSE) for more information.