This model is used to classify different foods and contains over 500 labels. You classify an image against this model just as you would a custom model; but instead of using the modelId
of the custom model, you specify a modelId
of FoodImageClassifier
. For the list of classes this model contains, see Food Image Model Class List.
This cURL command makes a prediction against the food model.
curl -X POST -H "Authorization: Bearer <TOKEN>" -H "Cache-Control: no-cache" -H "Content-Type: multipart/form-data" -F "sampleLocation=https://einstein.ai/images/foodimage.jpg" -F "modelId=FoodImageClassifier" https://api.einstein.ai/v2/vision/predict
The model returns a result similar to the following for the pizza image referenced by http://einstein.ai/images/foodimage.jpg
.
{
"probabilities": [
{
"label": "pizza",
"probability": 0.4895147383213043
},
{
"label": "flatbread",
"probability": 0.30357491970062256
},
{
"label": "focaccia",
"probability": 0.10683325678110123
},
{
"label": "frittata",
"probability": 0.05281512811779976
},
{
"label": "pepperoni",
"probability": 0.029621008783578873
}
],
"object": "predictresponse"
}
Updated 3 months ago