Updated on 2022-02-22 GMT+08:00

Encapsulated APIs

Encapsulated APIs are used for human figure and face detection, facial attribute recognition, license plate recognition, dog excretion detection, and Face Recognition in HUAWEI CLOUD EI services. These APIs are encapsulated to facilitate use. Contact Huawei HiLens personnel to enable the APIs for human figure and face detection, facial attribute recognition, license plate recognition, and dog excretion detection. Enable the API for the Face Recognition service on the Face Recognition console.

  • API calling

    Human figure and face detection:

    hilens.EIServices.HumanDetect(image_base64)

    Facial attribute recognition:

    hilens.EIServices.FaceAttribute(image_base64)

    License plate recognition:

    hilens.EIServices.LicensePlate(image_base64)

    Dog excretion detection:

    hilens.EIServices.DogShitDetect(image_base64)

    Face retrieval:

    hilens.EIServices.SearchFace(face_set_name, image_base64, top_n, threshold, filter)

    Adding a face to the face library:

    hilens.EIServices.AddFace(face_set_name, image_base64, external_image_id)

    Face detection:

    hilens.EIServices.FaceDetect(image_base64, attributes)

    Face verification:

    hilens.EIServices.FaceCompare(image1_base64, image2_base64)

  • Parameter description
    Table 1 Parameters

    Parameter

    Mandatory

    Type

    Description

    image_base64, image1_base64, image1_base64

    Yes

    Character string

    Base64 code of the image to be recognized.

    face_set_name, top_n, threshold, filter

    Yes

    Character string

    Face search parameters.

    face_set_name, external_image_id

    Yes

    Character string

    Face adding parameters.

    attributes

    Yes

    Character string

    Facial attributes. This parameter indicates whether to return the facial attribute list. Multiple attributes are separated by commas (,).

  • Return value
    EIResponse structure, including requestState and responseBody. For details, see Table 2.
    Table 2 Return value description

    Parameter

    Type

    Description

    EIResponse.requestState

    Boolean

    Request status. True indicates a success, and False indicates a failure.

    EIResponse.responseBody

    Character string

    Request response body.