Food

The 'Food' model recognizes more than 1,000 food items in images down to the ingredient level. This model is great for anyone building a health and wellness related app.

GO TO DOCUMENTATION Updated May 23, 2017

Demo

Info

Info

MODEL NAME

Food

OWNER

Clarifai

MODEL ID

bd367be194cf45149e75f01d59f77ba7

UPDATED AT

May 23, 2017

CONCEPTS

Apple, Avocado, Bread, Ice Cream, Sandwich, Steak and more

Request

You can call the Predict API with the 'Food' model. Simply pass in an image input with a publicly accessible URL or by directly sending image bytes.

You can learn more about the Predict API in our API Guide.

POST
curl -X POST
    -H 'Authorization: Bearer {access_token}'
    -H "Content-Type: application/json"
    -d '
    {
      "inputs": [
        {
          "data": {
            "image": {
              "url": "https://samples.clarifai.com/food.jpg"
            }
          }
        }
      ]
    }'
    https://api.clarifai.com/v2/models/bd367be194cf45149e75f01d59f77ba7/outputs

Response

The Predict returns a list of concepts (such as specific food items and visible ingredients) with corresponding probability scores on the likelihood that these concepts are contained within the image.

Response
{
  "status": {
    "code": 10000,
    "description": "Ok"
  },
  "outputs": [
    {
      "id": "aa0e68b1964f4b0c81911816aabb6308",
      "status": {
        "code": 10000,
        "description": "Ok"
      },
      "created_at": "2016-11-22T17:27:59Z",
      "model": {
        "name": "food-items-v1.0",
        "id": "bd367be194cf45149e75f01d59f77ba7",
        "created_at": "2016-09-17T22:18:59Z",
        "app_id": null,
        "output_info": {
          "message": "Show output_info with: GET /models/{model_id}/output_info",
          "type": "concept"
        },
        "model_version": {
          "id": "dfebc169854e429086aceb8368662641",
          "created_at": "2016-09-17T22:18:59Z",
          "status": {
            "code": 21100,
            "description": "Model trained successfully"
          }
        }
      },
      "input": {
        "id": "aa0e68b1964f4b0c81911816aabb6308",
        "data": {
          "image": {
            "url": "https://samples.clarifai.com/food.jpg"
          }
        }
      },
      "data": {
        "concepts": [
          {
            "id": "ai_GC6FB0cQ",
            "name": "sauce",
            "app_id": null,
            "value": 0.99863684
          },
          {
            "id": "ai_fBH5DFMJ",
            "name": "pasta",
            "app_id": null,
            "value": 0.9962599
          },
          {
            "id": "ai_2KV5G1Fg",
            "name": "basil",
            "app_id": null,
            "value": 0.97945905
          },
          {
            "id": "ai_XN1QLhwp",
            "name": "penne",
            "app_id": null,
            "value": 0.97526324
          },
          {
            "id": "ai_KWmFf1fn",
            "name": "meat",
            "app_id": null,
            "value": 0.9743866
          },
          {
            "id": "ai_XVpwLB09",
            "name": "beef",
            "app_id": null,
            "value": 0.9702389
          },
          {
            "id": "ai_qmTM9wzt",
            "name": "spaghetti",
            "app_id": null,
            "value": 0.9645418
          },
          {
            "id": "ai_CB8hsS3T",
            "name": "tomato",
            "app_id": null,
            "value": 0.9477837
          },
          {
            "id": "ai_FnZCSVMH",
            "name": "cheese",
            "app_id": null,
            "value": 0.891973
          },
          {
            "id": "ai_CQT1pP96",
            "name": "macaroni",
            "app_id": null,
            "value": 0.8738347
          },
          {
            "id": "ai_NDbbpCv1",
            "name": "vegetable",
            "app_id": null,
            "value": 0.8726477
          },
          {
            "id": "ai_CSW3Njnd",
            "name": "meat sauce",
            "app_id": null,
            "value": 0.8595116
          },
          {
            "id": "ai_3fJXxTPQ",
            "name": "sausage",
            "app_id": null,
            "value": 0.6607301
          },
          {
            "id": "ai_ZBtC2kLC",
            "name": "spaghetti bolognese",
            "app_id": null,
            "value": 0.64385796
          },
          {
            "id": "ai_Bh2xGwKk",
            "name": "tomato sauce",
            "app_id": null,
            "value": 0.6094018
          },
          {
            "id": "ai_TRbv6FWL",
            "name": "pork",
            "app_id": null,
            "value": 0.5601148
          },
          {
            "id": "ai_cdw5bgmc",
            "name": "pasta sauce",
            "app_id": null,
            "value": 0.4660543
          },
          {
            "id": "ai_6s1vcbq9",
            "name": "garlic",
            "app_id": null,
            "value": 0.43789294
          },
          {
            "id": "ai_gNpKXVhq",
            "name": "tagliatelle",
            "app_id": null,
            "value": 0.42926073
          },
          {
            "id": "ai_xgC6XzhP",
            "name": "carbohydrate",
            "app_id": null,
            "value": 0.41837996
          }
        ]
      }
    }
  ]
}
SHOW FULL CODE
COMPONENTDESCRIPTION
modelThe model you are using to make predictions on your inputs with. Includes the id, name, created_at date, output info, and information on the model version.
inputThe image data that you passed through the model to make predictions. Includes id and the image data.
dataThe data sent back with the reponse; usually includes the detected concepts and corresponding probability values. (If the model's output type is not concepts, you'll see different output responses here.)

Info

MODEL NAME

Food

OWNER

Clarifai

MODEL ID

bd367be194cf45149e75f01d59f77ba7

UPDATED AT

May 23, 2017

CONCEPTS

Apple, Avocado, Bread, Ice Cream, Sandwich, Steak and more

Get Started for Free with Food Model

Start building amazing stuff — no credit card required.

Get Your Free API Key