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.
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.
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
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:
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}