Clone the repo and run:
git clone --recurse-submodules https://github.
com/egslava/test_banana_image_classifier.git
After cloning, run:
bash run_n_test_all.bash
It will:
- Create the model from the PyTorch model and the weights
- Convert it to onnx-format and the resulting high-level interface
- Test the high-level interface against provided examples
- Run the API (Banana) server
- Test the server against the provided examples
- Build the Docker image
- Test the Docker image with the provided examples.
curl --location --request POST 'https://api.banana.dev/start/v4/' \
--header 'Content-Type: application/json' \
--data-raw '{
"apiKey": "d3a8262d-25e2-4393-ac03-b8e888cf8d8e",
"modelKey": "5f5051db-1249-4530-be36-a2dc95b0746b",
"modelInputs" : {
"image": "UklGRiwAAABXRUJQVlA4ICAAAABQAQCdASoBAAEAAkA4JQBOgCgAAP76eV8CStWlVemeAA=="
}
}'
Where image is base64-encoded image file.
Example output:
{
"id": "a46d75e8-e9c9-474b-a939-3fd8e849ceec",
"message": "",
"created": 1679143667,
"apiVersion": "January 11, 2023",
"callID": "",
"finished": true,
"modelOutputs": [
{
"class": "111"
}
]
}
The API is fully working, you can check it manually, via Postman.