This example deploys Iris, ResNet50 and Inception models in one API. Query parameters are used for selecting the model.
The example can be run on both CPU and on GPU hardware.
Deploy the model by running:
cortex deploy
And wait for it to become live by tracking its status with cortex get --watch
.
Once the API has been successfully deployed, export the APIs endpoint. You can get the API's endpoint by running cortex get multi-model-classifier
.
export ENDPOINT=your-api-endpoint
When making a prediction with sample-image.json, the following image will be used:
Make a request to the ResNet50 model:
curl "${ENDPOINT}?model=resnet50" -X POST -H "Content-Type: application/json" -d @sample-image.json
The expected response is:
{"label": "sports_car"}
Make a request to the Inception model:
curl "${ENDPOINT}?model=inception" -X POST -H "Content-Type: application/json" -d @sample-image.json
The expected response is:
{"label": "sports_car"}
Make a request to the Iris model:
curl "${ENDPOINT}?model=iris" -X POST -H "Content-Type: application/json" -d @sample-iris.json
The expected response is:
{"label": "setosa"}