Skip to content

Latest commit

History

History

api

Folders and files

NameName
Last commit message
Last commit date

parent directory

..

Template for your Vision API using PyroVision

Installation

You will only need to install Git, Docker and poetry. The container environment will be self-sufficient and install the remaining dependencies on its own.

Usage

Starting your web server

You will need to clone the repository first:

git clone https://github.com/pyronear/pyro-vision.git

then from the repo root folder, you can start your container:

make lock
make run

Once completed, your FastAPI server should be running on port 8080.

Documentation and swagger

FastAPI comes with many advantages including speed and OpenAPI features. For instance, once your server is running, you can access the automatically built documentation and swagger in your browser at: http://localhost:8080/docs

Using the routes

You will find detailed instructions in the live documentation when your server is up, but here are some examples to use your available API routes:

Image classification

Using the following image:

with this snippet:

import requests
with open('/path/to/your/img.jpg', 'rb') as f:
    data = f.read()
print(requests.post("http://localhost:8080/classification", files={'file': data}).json())

should yield

{'value': 'Wildfire', 'confidence': 0.9981765747070312}