API - pasqualedem/CrowdCounting-on-VisDrone2020 GitHub Wiki

Run the server locally without docker

Requirements

If you just want to run the api:

pip install -r requirements.txt

Run api

python src/api.py

Those commands will run the api, which will accept requests on port 8000.

The API is accessible at the following endpoints:

  • / which gives a welcome message
  • /docs which provides a documentation of the API
  • /predictions/images used to receive prediction for a given image
  • /predictions/videos used to receive prediction for a given video

Request of prediction

The request is made by passing:

  • the image or video to be processed
  • the parameters to select the output type

An example of request with curl:

curl -X 'POST' \
  'http://www.drone-crowdcounting.com/predictions/images?count=true&heatmap=true' \
  -H 'accept: application/json' \
  -H 'Content-Type: multipart/form-data' \
  -F 'file=@<filename.format>;type=image/jpeg'