PyroEngine provides a high-level interface to use Deep learning models in production while being connected to the alert API.
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(im)
Python 3.8 (or higher) and pip/conda are required to install PyroEngine.
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/.
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 alertsLAT
: the latitude of the deviceLON
: the longitude of the deviceCAM_USER
: the username to access the cameraCAM_PWD
: the password to access the camera
So your .env
file should look something like this:
API_URL=https://api.pyronear.org
LAT=48.88
LON=2.38
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 entrieslogin
&password
for their Alert API credentialsmodel.onnx
: optional, will override the model weights download from HuggingFace Hubconfig.json
: optional, will override the model config download from HuggingFace Hub
{
"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"
}
]
}
}
The full package documentation is available here for detailed specifications.
Please refer to CONTRIBUTING
if you wish to contribute to this project.
This project is developed and maintained by the repo owner and volunteers from Pyronear.
Distributed under the Apache 2 License. See LICENSE
for more information.