Skip to content

The purpose of this repo is to contain the pyronear deployment part

License

Notifications You must be signed in to change notification settings

MateoLostanlen/pyro-engine

 
 

Repository files navigation

PyroNear Logo

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:

from pyroengine.core import Engine
from PIL import Image

engine = Engine()

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

prediction = engine.predict(image) 

Setup

Python 3.6 (or higher) and pip/conda are required to install PyroVision.

Stable release

You can install the last stable release of the package using pypi as follows:

pip install pyroengine

Developer installation

Alternatively, 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:

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

Full docker orchestration

In order to run the projet, you will need to specific 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
  • LAT: the latitude of the device
  • LON: the longitude of the device
  • CAM_USER: the user name to access camera
  • CAM_PWD: the password name to access camera
  • LOKI_URL: the loki URL where to export logs
  • PROMTAIL_DEVICE_SCOPE: the scope of the device (in order to filter devices logs with ease)
  • PROMTAIL_DEVICE_NAME: the name of the device (in order to filter devices logs with ease)

So your .env file should look like something similar to:

API_URL=http://my-api.myhost.com
LAT=48.88
LON=2.38
CAM_USER=my_dummy_login
CAM_PWD=my_dummy_pwd

LOKI_URL=http://my-loki-service.com
PROMTAIL_DEVICE_SCOPE=tower_scope
PROMTAIL_DEVICE_NAME=tower_name

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 overrides the model weights download from HuggingFace Hub
  • config.json: optional, will overrides the model config download from HuggingFace Hub

Documentation

The full package documentation is available here for detailed specifications.

Contributing

Please refer to CONTRIBUTING if you wish to contribute to this project.

Credits

This project is developed and maintained by the repo owner and volunteers from Pyronear.

License

Distributed under the Apache 2 License. See LICENSE for more information.

About

The purpose of this repo is to contain the pyronear deployment part

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 87.4%
  • Shell 8.6%
  • Dockerfile 2.0%
  • Makefile 2.0%