Custom Metadata in Tarantool

It is often necessary to assign additional metadata to the faces extracted from images uploaded to the record index and now stored in the feature vector database.

Customize Meta Fields of Face Objects

To assign custom meta fields to the face objects, do the following:

  1. Prepare the list of custom meta fields to assign.

  2. Open the /opt/findface-cibr/configs/findface-multi-legacy/findface-multi-legacy.py configuration file.

    sudo vi /opt/findface-cibr/configs/findface-multi-legacy/findface-multi-legacy.py
    
  3. In the FFSECURITY section, uncomment the CUSTOM_FIELDS -> face_object section and modify the exemplary content, considering the following:

    • field_name: field’s name;

    • type: data type;

    • default: field’s default value. If a default value exceeds 1e14 1, use a string data type to specify it, for example, "123123.." instead of 123123...

    FFSECURITY = {
    
    ...
    
        # -- Custom model fields --
        ...
        # Edit CUSTOM_FIELDS -> `face_object` section to customize face object fields.
        ...
        # 'CUSTOM_FIELDS': {
              ...
              'face_object': {
                  'items': [
                      {
                          "field_name": "tag_name_1",
                          "type": "string",
                          "default": "change_me"
                      },
                      {
                          "field_name": "tag_name_2",
                          "type": "uint",
                          "default": 123
                      },
                      {
                          "field_name": "tag_name_3",
                          "type": "bool",
                          "default": True
                      },
                  ]
              }
          },
    }
    
  4. Add the new meta fields to the feature vector database structure.

  5. Restart the findface-cibr-findface-multi-legacy-1 container.

    sudo docker container restart findface-cibr-findface-multi-legacy-1
    

    You can work with the new meta fields through HTTP API using the objects/faces/ methods.

See also

To create custom tabs, fields, and filters in records, refer to Custom Tabs, Fields, and Filters in Record Index.