šŸ”“ Confirm dish name after applying image recognition.

When using our recognition endpoints the most probable classes are returned concerning dish, drinks, sauces or ingredients (depending on the type).

Ā 

With this endpoint, the user has the option to confirm which one of the returned food classes is the correct one.

Ā 

By default, the source is set to 'logmeal' and an ID corresponding to an existent dish is expected. The 'source' can also take the value 'other' for specifying a free-text feedback for any dish that is not included in LogMeal's API. Do note that if you confirm a dish with a free-text feedback (source 'other') it won't be taken into consideration when doing any calculation that is based on the dish (e.g. generating ingredients or nutritional information).

Ā 

If a food segmentation endpoint has been used then you have to provide a food item identifier for each of the confirmed dishes. This implies adding the extra parameter 'food_item_position'. This parameter consists of a list of elements, one per each confirmed dish, and it must include an integer identifying the segmented region it corresponds to (see 'food_item_position' in returned json for /segmentation endpoints). If you desire to confirm a dish that does not belong to any of the detected regions then a string has to be provided that will act as an unique identifier for that extra confirmed dish.

Ā 

Important notes about dish IDs:

  • If the image is a default API intake, the dish IDs you can confirm must belong to LogMeal’s global dataset. You can check the full list of available dishes in the endpoint /dataset/dishes.
  • If the image is a kiosk/tray intake, then the dish IDs must match the dishes actually offered that day and shift in the restaurant. These valid dish IDs can be retrieved from the endpoint /kiosk/external/dishes.

Ā 

To know if an image is of type kiosk, you can check the endpoints [GET] /intake or /getIntakesList. If the field is_kiosk_image is true, then you must use the kiosk dish IDs instead of the global dataset.

Ā 

Example payload

Suppose an image has already detected dishes with IDs 2284, 2270, and 2290. If you want to confirm those three and also add a new dish with ID 2267, you need to send all the confirmed IDs and their positions, plus the new one:

{
  "imageId": 1982196,
  "confirmedClass": [ 2284, 2270, 2299, 2267 ],
  "source": [ "logmeal", "logmeal", "logmeal", "logmeal" ],
  "food_item_position": [ 1, 2, 3, 4 ]
}

Each list must include both the existing confirmed dishes and any new ones you are adding.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
enum
required

String containing the version of the recognition algorithm/model. If not provided, the endpoint will default to the first version listed in /version/activeModels

Allowed:
Query Params
string
enum

Desired language for the response. It must be a three-letter ISO 639-2/T code. Defaults to the APIUser's assigned language or english.

Body Params

Parameters sent in data, in json format

integer
required

ID of the image which will have it's dishes confirmed.

confirmedClass
array of integers
required

Classes to be confirmed for the provided imageId. This variable is a list of integers containing all the confirmed classes. Note that whenever the source is set to 'logmeal' an integer corresponding to an existent dish must be provided in the list. If the source is other than 'logmeal', than a string can be provided in the list along with the integer ids as the name of that particular confirmed class.

confirmedClass*
source
array of integers
required

Source of the 'confirmedClass' being confirmed. If a list of 'confirmedClass' are provided, the source provided can also be a list containing each source relative to the 'confirmedClass' list.

source*
food_item_position
array of integers

Integer identifiers pointing to one of the detected regions in /segmentation endpoints or string unique identifier if the confirmed dish does not correspond to any of the detected food regions/segments.

food_item_position
Responses

401

Unauthorized, invalid token

403

You are not allowed to this method.

404

The specified URL was not found or couldn’t be retrieved

Language
Credentials
Bearer
JWT
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json