The configuration of recognition lists and data is described in the RealtimeRecognizer.proto file.

The following 4 methods are used:

  1. ChangeLists.
  2. ChangeItems.
  3. GetLists.
  4. GetItems.

ChangeLists method

This method is used to add, edit and delete lists.

Input data

As an argument, the ChangeListsRequest structure is passed, in which 3 input data vectors are filled:

  1. added_lists − a vector of lists to add;
  2. changed_lists − a vector of lists to edit;
  3. removed_list_ids − a vector of list IDs to delete.

The lists themselves are a data structure with fields:

  1. id −a list id;
  2. name − a list name;
  3. description − comments to a list;
  4. score − minimum recognition level, the default is 0.85;
  5. item_ids − a list of image IDs, which are used for recognition;
  6. type − recognition type, ELT_Face for faces, ELT_LPRfor license plate numbers, ELT_Food for food (dishes).

Outputs

In response to the method, you will receive a summary of list IDs that could not be added, edited or deleted.

ChangeItems method

This method is used to add, edit and delete the source data for the recognizer.

Input data

As an argument, the ChangeItemsRequest structure is passed, in which 3 input data vectors are filled:

  1. added_items − a data vector to add;
  2. changed_items − a data vector to edit;
  3. removed_item_ids − a vector of data IDs to delete. 

The data are a data structure with fields:

  1. id − data id;
  2. name − data name;
  3. description − comments to data;
  4. type − data type, DT_ImageFace for faces, DT_Plate for license plate numbers, DT_ImagesFood − for food (dishes);
  5. data − the data themself, depending on the type. For faces it is a single image, for food it is an array of images, for license plate numbers it is a number in the form of text;
  6. data_vectors − vector of images (not specified).

The image has 2 fields: the id of the image and the image itself.

If you fill in only the id of the image during the editing, i.e. when the changed_items vector is formed, this will mean that the image with this id should be removed from the configuration.

Outputs

In response to the method, you will receive a summary of data IDs and image IDs that could not be added, edited or deleted.

GetLists method

This method displays the information about the lists in the configuration.

Input data

As an argument, the GetListsRequest structure is passed, in which 2 fields are filled:

  1. list_ids − an array of list IDs, which should be received;
  2. type − the type of lists: ELT_Face, ELT_LPR, ELT_Food.

These fields work as filters and can be passed together or separately.

Outputs

In response to the method, you will receive an array of lists.

GetItems method

This method displays the information about the data in the configuration.

Input data

As an argument, the GetItemsRequest structure is passed, in which 3 fields are filled:

  1. item_ids − an array of data IDs, which should be received;
  2. load_images − the flag indicating the need to display an image with the response;
  3. load_vectors − the flag indicating the need to display the images vector.

Outputs

In response to the method, you will receive an array of data.