Skip to content

Latest commit

 

History

History
 
 

multi-model-classifier

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Multi-Model Classifier API

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.

Sample Prediction

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:

sports car

ResNet50 Classifier

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"}

Inception Classifier

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"}

Iris Classifier

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"}