Updated on 2024-06-12 GMT+08:00

AllParam

Function

This topic describes all parameter types involved in FRS.

Parameter

Table 1 Structure format description

Parameter

Type

Description

project_id

String

Project ID. For details about how to obtain the ID, see Obtaining the Project ID/Account Name/AK/SK.

image_url

String

Image URL. Currently, only the URL of an OBS bucket on Huawei Cloud is supported and FRS must have the permission to read data in the OBS bucket. For details about how to enable the read permission, see Service Authorization.

image_file

File

Local image file, whose size cannot exceed 8 MB. It is recommended that the image size be less than 1 MB. The request format is Multipart.

image_base64

String

Image data (Base64-encoded). Its requirements are as follows:
  • The image size after Base64 encoding cannot exceed 8 MB. It is recommended that the image size be less than 1 MB.
  • The image is in JPG, JPEG, BMP, or PNG format.

similarity

Double

Face similarity. The value ranges from 0 to 1. A larger value indicates a higher similarity degree. Generally, if the value is greater than 0.93, the faces in two images belong to one person.

face_set_name

String

Name of the facial image library. The value contains 1 to 64 characters, including letters, digits, hyphens (-), and underscores (_). Other special characters are not allowed.

face_set_capacity

Integer

Maximum capacity of a facial image library. The value is an integer multiple of 10000, for example, 30000. The default value is 100000, and the maximum value is 100000. You can create facial image libraries as you need.

face_id

String

Face ID returned by the system after a face is imported. The value consists of eight uppercase and lowercase letters that are randomly generated.

external_image_id

String

External image ID specified by the user. It is bound to the current image. If the user does not provide one, it is generated by the system. The ID contains 1 to 36 characters, including letters, digits, hyphens (-), and underscores (_). Other special characters are not allowed.

external_fields

JSON

Enters a value based on the customized data type. This field is defined when you create the facial image library. For details, see Customized Fields.

top_n

Integer

N faces returned that are most similar to the input one. The default value of N is 10. If the first five faces are returned, the value of variable N is 5.

Value range: 1–1000

threshold

Double

Face similarity threshold. If the similarity degree of a face is lower than the threshold, the face is not returned. The value ranges from 0 to 1. The recommended value is 0.93. The default value is 0.

offset

Integer

Start number of data records to be read. The default value is 0.

limit

Integer

Number of records to be read. The default value is 5.

video_url

String

Video URL. Currently, only the URL of an OBS bucket on Huawei Cloud is supported and FRS must have the permission to read data in the OBS bucket. For details about how to enable the read permission, see Service Authorization. The video requirements are as follows:
  • The video size after Base64 encoding cannot exceed 8 MB.
  • The video duration must be 1 to 15 seconds.
  • The recommended frame rate is 10 fps to 30 fps.
  • The encapsulation format can be MP4, AVI, FLV, WEBM, ASF, or MOV.
  • The video encoding format can be H.261, H.263, H.264, HEVC, VC-1, VP8, VP9, or WMV3.

video_file

File

Local video file. The request format is Multipart. The video requirements are as follows:
  • The size of a video file cannot exceed 8 MB. It is recommended that the video file be compressed to 200 KB to 2 MB on the client.
  • The video duration must be 1 to 15 seconds.
  • The recommended frame rate is 10 fps to 30 fps.
  • The encapsulation format can be MP4, AVI, FLV, WEBM, ASF, or MOV.
  • The video encoding format can be H.261, H.263, H.264, HEVC, VC-1, VP8, VP9, or WMV3.

video_base64

String

Video data (Base64-encoded). Its requirements are as follows:
  • The video size after Base64 encoding cannot exceed 8 MB. It is recommended that the video file be compressed to 200 KB to 2 MB on the client.
  • The video duration must be 1 to 15 seconds.
  • The recommended frame rate is 10 fps to 30 fps.
  • The encapsulation format can be MP4, AVI, FLV, WEBM, ASF, or MOV.
  • The video encoding format can be H.261, H.263, H.264, HEVC, VC-1, VP8, VP9, or WMV3.

actions

String

Action code sequence list. Actions are separated by commas (,). Currently, the following actions are supported:
  • 1: Shake the head to the left.
  • 2: Shake the head to the right.
  • 3: Nod the head.
  • 4: Mouth movement

action_time

String

String of the action time array. The length of the array is the same as the number of actions. Each item contains the start time and end time of the action in the corresponding sequence. The unit is the milliseconds from the video start time.

error_code

String

Error code returned after the API fails to be called.

error_msg

String

Error message returned after the API fails to be called.