UNPKG

tencentcloud-sdk-nodejs-intl-en

Version:
1,550 lines (1,316 loc) 174 kB
/* * Copyright (c) 2018 THL A29 Limited, a Tencent company. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ const AbstractModel = require("../../common/abstract_model"); /** * GetPersonGroupInfo response structure. * @class */ class GetPersonGroupInfoResponse extends AbstractModel { constructor(){ super(); /** * List of groups containing this person and their description fields * @type {Array.<PersonGroupInfo> || null} */ this.PersonGroupInfos = null; /** * Total number of groups Note: this field may return null, indicating that no valid values can be obtained. * @type {number || null} */ this.GroupNum = null; /** * Algorithm model version used by the Face Recognition service. Note: this field may return null, indicating that no valid values can be obtained. * @type {string || null} */ this.FaceModelVersion = null; /** * The unique request ID, which is returned for each request. RequestId is required for locating a problem. * @type {string || null} */ this.RequestId = null; } /** * @private */ deserialize(params) { if (!params) { return; } if (params.PersonGroupInfos) { this.PersonGroupInfos = new Array(); for (let z in params.PersonGroupInfos) { let obj = new PersonGroupInfo(); obj.deserialize(params.PersonGroupInfos[z]); this.PersonGroupInfos.push(obj); } } this.GroupNum = 'GroupNum' in params ? params.GroupNum : null; this.FaceModelVersion = 'FaceModelVersion' in params ? params.FaceModelVersion : null; this.RequestId = 'RequestId' in params ? params.RequestId : null; } } /** * Eye information * @class */ class Eye extends AbstractModel { constructor(){ super(); /** * Whether glasses are worn. The `Type` values of the `AttributeItem` include: 0: no glasses; 1: general glasses; 2: sunglasses. * @type {AttributeItem || null} */ this.Glass = null; /** * Whether the eyes are open. The `Type` values of the `AttributeItem` include: 0: open; 1: closed. * @type {AttributeItem || null} */ this.EyeOpen = null; /** * Whether the person has double eyelids. The `Type` values of the `AttributeItem` include: 0: no; 1: yes. * @type {AttributeItem || null} */ this.EyelidType = null; /** * Eye size. The `Type` values of the `AttributeItem` include: 0: small eyes; 1: general eyes; 2: big eyes. * @type {AttributeItem || null} */ this.EyeSize = null; } /** * @private */ deserialize(params) { if (!params) { return; } if (params.Glass) { let obj = new AttributeItem(); obj.deserialize(params.Glass) this.Glass = obj; } if (params.EyeOpen) { let obj = new AttributeItem(); obj.deserialize(params.EyeOpen) this.EyeOpen = obj; } if (params.EyelidType) { let obj = new AttributeItem(); obj.deserialize(params.EyelidType) this.EyelidType = obj; } if (params.EyeSize) { let obj = new AttributeItem(); obj.deserialize(params.EyeSize) this.EyeSize = obj; } } } /** * Most matching candidate recognized * @class */ class Candidate extends AbstractModel { constructor(){ super(); /** * Person ID * @type {string || null} */ this.PersonId = null; /** * Face ID, which is valid only when returned by the `SearchFaces` or `SearchFacesReturnsByGroup` API. User search APIs use facial feature fusion to search for users, for which this field is meaningless. * @type {string || null} */ this.FaceId = null; /** * Match score of candidate. In a face base library containing 10,000 faces, the 1%, 0.1%, and 0.01% FARs correspond to scores of 70, 80, and 90, respectively; In a face base library containing 100,000 faces, the 1%, 0.1%, and 0.01% FARs correspond to scores of 80, 90, and 100, respectively; In a face base library containing 300,000 faces, the 1% and 0.1% FARs correspond to scores of 85 and 95, respectively. Generally, the score of 80 is suitable for most scenarios. We recommend choosing an appropriate score based on the actual situation, preferably no more than 90. * @type {number || null} */ this.Score = null; /** * Person name Note: this field may return null, indicating that no valid values can be obtained. * @type {string || null} */ this.PersonName = null; /** * Person gender Note: this field may return null, indicating that no valid values can be obtained. * @type {number || null} */ this.Gender = null; /** * List of groups containing this person and their description fields Note: this field may return null, indicating that no valid values can be obtained. * @type {Array.<PersonGroupInfo> || null} */ this.PersonGroupInfos = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.PersonId = 'PersonId' in params ? params.PersonId : null; this.FaceId = 'FaceId' in params ? params.FaceId : null; this.Score = 'Score' in params ? params.Score : null; this.PersonName = 'PersonName' in params ? params.PersonName : null; this.Gender = 'Gender' in params ? params.Gender : null; if (params.PersonGroupInfos) { this.PersonGroupInfos = new Array(); for (let z in params.PersonGroupInfos) { let obj = new PersonGroupInfo(); obj.deserialize(params.PersonGroupInfos[z]); this.PersonGroupInfos.push(obj); } } } } /** * ModifyGroup response structure. * @class */ class ModifyGroupResponse extends AbstractModel { constructor(){ super(); /** * The unique request ID, which is returned for each request. RequestId is required for locating a problem. * @type {string || null} */ this.RequestId = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.RequestId = 'RequestId' in params ? params.RequestId : null; } } /** * GetGroupInfo response structure. * @class */ class GetGroupInfoResponse extends AbstractModel { constructor(){ super(); /** * Group name * @type {string || null} */ this.GroupName = null; /** * Group ID * @type {string || null} */ this.GroupId = null; /** * Custom group description field * @type {Array.<string> || null} */ this.GroupExDescriptions = null; /** * Group remarks * @type {string || null} */ this.Tag = null; /** * Algorithm model version used for face recognition. * @type {string || null} */ this.FaceModelVersion = null; /** * Group creation time and date (`CreationTimestamp`), whose value is the number of milliseconds between the UNIX epoch time and the group creation time. * @type {number || null} */ this.CreationTimestamp = null; /** * The unique request ID, which is returned for each request. RequestId is required for locating a problem. * @type {string || null} */ this.RequestId = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.GroupName = 'GroupName' in params ? params.GroupName : null; this.GroupId = 'GroupId' in params ? params.GroupId : null; this.GroupExDescriptions = 'GroupExDescriptions' in params ? params.GroupExDescriptions : null; this.Tag = 'Tag' in params ? params.Tag : null; this.FaceModelVersion = 'FaceModelVersion' in params ? params.FaceModelVersion : null; this.CreationTimestamp = 'CreationTimestamp' in params ? params.CreationTimestamp : null; this.RequestId = 'RequestId' in params ? params.RequestId : null; } } /** * DeletePerson request structure. * @class */ class DeletePersonRequest extends AbstractModel { constructor(){ super(); /** * Person ID, which is the `PersonId` in the `CreatePerson` API. * @type {string || null} */ this.PersonId = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.PersonId = 'PersonId' in params ? params.PersonId : null; } } /** * DetectLiveFace response structure. * @class */ class DetectLiveFaceResponse extends AbstractModel { constructor(){ super(); /** * Liveness score. Value range: [0,100]. The score is generally between 80 and 100, but 0 is also a common value. As a recommendation, when the score is greater than 87, it can be judged that the person in the image is alive. You can adjust the threshold according to your specific scenario. This field is meaningful only if `FaceModelVersion` is 2.0. * @type {number || null} */ this.Score = null; /** * Algorithm model version used for face recognition. * @type {string || null} */ this.FaceModelVersion = null; /** * Whether liveness detection is passed. This field is meaningful only if `FaceModelVersion` is 3.0. * @type {boolean || null} */ this.IsLiveness = null; /** * The unique request ID, which is returned for each request. RequestId is required for locating a problem. * @type {string || null} */ this.RequestId = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.Score = 'Score' in params ? params.Score : null; this.FaceModelVersion = 'FaceModelVersion' in params ? params.FaceModelVersion : null; this.IsLiveness = 'IsLiveness' in params ? params.IsLiveness : null; this.RequestId = 'RequestId' in params ? params.RequestId : null; } } /** * SearchPersonsReturnsByGroup response structure. * @class */ class SearchPersonsReturnsByGroupResponse extends AbstractModel { constructor(){ super(); /** * Number of the persons included in searched groups. If the quality of all faces in the input image does not meet the requirement, 0 will be returned. * @type {number || null} */ this.PersonNum = null; /** * Recognition result. * @type {Array.<ResultsReturnsByGroup> || null} */ this.ResultsReturnsByGroup = null; /** * Algorithm model version used for face recognition. * @type {string || null} */ this.FaceModelVersion = null; /** * The unique request ID, which is returned for each request. RequestId is required for locating a problem. * @type {string || null} */ this.RequestId = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.PersonNum = 'PersonNum' in params ? params.PersonNum : null; if (params.ResultsReturnsByGroup) { this.ResultsReturnsByGroup = new Array(); for (let z in params.ResultsReturnsByGroup) { let obj = new ResultsReturnsByGroup(); obj.deserialize(params.ResultsReturnsByGroup[z]); this.ResultsReturnsByGroup.push(obj); } } this.FaceModelVersion = 'FaceModelVersion' in params ? params.FaceModelVersion : null; this.RequestId = 'RequestId' in params ? params.RequestId : null; } } /** * DeleteFace request structure. * @class */ class DeleteFaceRequest extends AbstractModel { constructor(){ super(); /** * Person ID, which is the `PersonId` in the `CreatePerson` API. * @type {string || null} */ this.PersonId = null; /** * List of IDs of the faces to be deleted. The array element value is the `FaceId` returned by the `CreateFace` API. * @type {Array.<string> || null} */ this.FaceIds = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.PersonId = 'PersonId' in params ? params.PersonId : null; this.FaceIds = 'FaceIds' in params ? params.FaceIds : null; } } /** * Pose information. * @class */ class HeadPose extends AbstractModel { constructor(){ super(); /** * Pitch. Value range: [-30,30]. * @type {number || null} */ this.Pitch = null; /** * Yaw. Value range: [-30,30]. * @type {number || null} */ this.Yaw = null; /** * Roll. Value range: [-180,180]. * @type {number || null} */ this.Roll = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.Pitch = 'Pitch' in params ? params.Pitch : null; this.Yaw = 'Yaw' in params ? params.Yaw : null; this.Roll = 'Roll' in params ? params.Roll : null; } } /** * DetectFaceSimilarity response structure. * @class */ class DetectFaceSimilarityResponse extends AbstractModel { constructor(){ super(); /** * The value range is [0.00, 100.00]. It is recommended that when the similarity is greater than or equal to 70, the person can be judged to be the same person, and the threshold can be adjusted according to the specific scenario (the false pass rate for a threshold of 70 is one in 1,000, and the false pass rate for a threshold of 80 is one in 10,000). * @type {number || null} */ this.Score = null; /** * The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. * @type {string || null} */ this.RequestId = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.Score = 'Score' in params ? params.Score : null; this.RequestId = 'RequestId' in params ? params.RequestId : null; } } /** * ModifyPersonGroupInfo request structure. * @class */ class ModifyPersonGroupInfoRequest extends AbstractModel { constructor(){ super(); /** * Group ID, which is the `GroupId` in the `CreateGroup` API. * @type {string || null} */ this.GroupId = null; /** * Person ID, which is the `PersonId` in the `CreatePerson` API. * @type {string || null} */ this.PersonId = null; /** * Custom description field of the person to be modified, which is a `key-value` pair. * @type {Array.<PersonExDescriptionInfo> || null} */ this.PersonExDescriptionInfos = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.GroupId = 'GroupId' in params ? params.GroupId : null; this.PersonId = 'PersonId' in params ? params.PersonId : null; if (params.PersonExDescriptionInfos) { this.PersonExDescriptionInfos = new Array(); for (let z in params.PersonExDescriptionInfos) { let obj = new PersonExDescriptionInfo(); obj.deserialize(params.PersonExDescriptionInfos[z]); this.PersonExDescriptionInfos.push(obj); } } } } /** * GetGroupList response structure. * @class */ class GetGroupListResponse extends AbstractModel { constructor(){ super(); /** * Returned group information * @type {Array.<GroupInfo> || null} */ this.GroupInfos = null; /** * Total number of groups Note: this field may return null, indicating that no valid values can be obtained. * @type {number || null} */ this.GroupNum = null; /** * The unique request ID, which is returned for each request. RequestId is required for locating a problem. * @type {string || null} */ this.RequestId = null; } /** * @private */ deserialize(params) { if (!params) { return; } if (params.GroupInfos) { this.GroupInfos = new Array(); for (let z in params.GroupInfos) { let obj = new GroupInfo(); obj.deserialize(params.GroupInfos[z]); this.GroupInfos.push(obj); } } this.GroupNum = 'GroupNum' in params ? params.GroupNum : null; this.RequestId = 'RequestId' in params ? params.RequestId : null; } } /** * Returned group information * @class */ class GroupInfo extends AbstractModel { constructor(){ super(); /** * Group name * @type {string || null} */ this.GroupName = null; /** * Group ID * @type {string || null} */ this.GroupId = null; /** * Custom group description field Note: this field may return null, indicating that no valid values can be obtained. * @type {Array.<string> || null} */ this.GroupExDescriptions = null; /** * Group remarks Note: this field may return null, indicating that no valid values can be obtained. * @type {string || null} */ this.Tag = null; /** * Algorithm model version used for face recognition. Note: this field may return null, indicating that no valid values can be obtained. * @type {string || null} */ this.FaceModelVersion = null; /** * Group creation time and date (`CreationTimestamp`), whose value is the number of milliseconds between the UNIX epoch time and the group creation time. The UNIX epoch time is 00:00:00, Thursday, January 1, 1970, Coordinated Universal Time (UTC). For more information, please see the UNIX time document. Note: this field may return null, indicating that no valid values can be obtained. * @type {number || null} */ this.CreationTimestamp = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.GroupName = 'GroupName' in params ? params.GroupName : null; this.GroupId = 'GroupId' in params ? params.GroupId : null; this.GroupExDescriptions = 'GroupExDescriptions' in params ? params.GroupExDescriptions : null; this.Tag = 'Tag' in params ? params.Tag : null; this.FaceModelVersion = 'FaceModelVersion' in params ? params.FaceModelVersion : null; this.CreationTimestamp = 'CreationTimestamp' in params ? params.CreationTimestamp : null; } } /** * GetPersonList response structure. * @class */ class GetPersonListResponse extends AbstractModel { constructor(){ super(); /** * Returned person information * @type {Array.<PersonInfo> || null} */ this.PersonInfos = null; /** * Number of persons in the group Note: this field may return null, indicating that no valid values can be obtained. * @type {number || null} */ this.PersonNum = null; /** * Number of faces in the group Note: this field may return null, indicating that no valid values can be obtained. * @type {number || null} */ this.FaceNum = null; /** * Algorithm model version used for face recognition. Note: this field may return null, indicating that no valid values can be obtained. * @type {string || null} */ this.FaceModelVersion = null; /** * The unique request ID, which is returned for each request. RequestId is required for locating a problem. * @type {string || null} */ this.RequestId = null; } /** * @private */ deserialize(params) { if (!params) { return; } if (params.PersonInfos) { this.PersonInfos = new Array(); for (let z in params.PersonInfos) { let obj = new PersonInfo(); obj.deserialize(params.PersonInfos[z]); this.PersonInfos.push(obj); } } this.PersonNum = 'PersonNum' in params ? params.PersonNum : null; this.FaceNum = 'FaceNum' in params ? params.FaceNum : null; this.FaceModelVersion = 'FaceModelVersion' in params ? params.FaceModelVersion : null; this.RequestId = 'RequestId' in params ? params.RequestId : null; } } /** * Hat information * @class */ class Hat extends AbstractModel { constructor(){ super(); /** * Hat wearing status information. The `Type` values of the `AttributeItem` include: 0: no hat; 1: general hat; 2: helmet; 3: security guard hat. * @type {AttributeItem || null} */ this.Style = null; /** * Hat color. The `Type` values of the `AttributeItem` include: 0: no hat; 1: red; 2: yellow; 3: blue; 4: black; 5: gray; 6: mixed colors. * @type {AttributeItem || null} */ this.Color = null; } /** * @private */ deserialize(params) { if (!params) { return; } if (params.Style) { let obj = new AttributeItem(); obj.deserialize(params.Style) this.Style = obj; } if (params.Color) { let obj = new AttributeItem(); obj.deserialize(params.Color) this.Color = obj; } } } /** * Completeness of facial features, which assesses the completeness of the eyebrows, eyes, nose, cheeks, mouth, and chin. * @class */ class FaceQualityCompleteness extends AbstractModel { constructor(){ super(); /** * Eyebrow completeness. Value range: [0,100]. The higher the score, the higher the completeness. Reference range: [0,80], which means incomplete. Note: this field may return null, indicating that no valid values can be obtained. * @type {number || null} */ this.Eyebrow = null; /** * Eye completeness. Value range: [0,100]. The higher the score, the higher the completeness. Reference range: [0,80], which means incomplete. Note: this field may return null, indicating that no valid values can be obtained. * @type {number || null} */ this.Eye = null; /** * Nose completeness. Value range: [0,100]. The higher the score, the higher the completeness. Reference range: [0,60], which means incomplete. Note: this field may return null, indicating that no valid values can be obtained. * @type {number || null} */ this.Nose = null; /** * Cheek completeness. Value range: [0,100]. The higher the score, the higher the completeness. Reference range: [0,70], which means incomplete. Note: this field may return null, indicating that no valid values can be obtained. * @type {number || null} */ this.Cheek = null; /** * Mouth completeness. Value range: [0,100]. The higher the score, the higher the completeness. Reference range: [0,50], which means incomplete. Note: this field may return null, indicating that no valid values can be obtained. * @type {number || null} */ this.Mouth = null; /** * Chin completeness. Value range: [0,100]. The higher the score, the higher the completeness. Reference range: [0,70], which means incomplete. Note: this field may return null, indicating that no valid values can be obtained. * @type {number || null} */ this.Chin = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.Eyebrow = 'Eyebrow' in params ? params.Eyebrow : null; this.Eye = 'Eye' in params ? params.Eye : null; this.Nose = 'Nose' in params ? params.Nose : null; this.Cheek = 'Cheek' in params ? params.Cheek : null; this.Mouth = 'Mouth' in params ? params.Mouth : null; this.Chin = 'Chin' in params ? params.Chin : null; } } /** * Face attributes, including gender, age, expression, beauty, glass, mask, hair, and pose (pitch, roll, yaw). Valid information will be returned only if `NeedFaceAttributes` is set to 1. The face attribute information of up to 5 largest faces in the image will be returned, and `FaceAttributesInfo` of the 6th and rest faces is meaningless. * @class */ class FaceAttributesInfo extends AbstractModel { constructor(){ super(); /** * Gender. The gender is female for the value range [0,49] and male for the value range [50,100]. The closer the value to 0 or 100, the higher the confidence. If `NeedFaceAttributes` is not 1 or more than 5 faces are detected, this parameter will still be returned but meaningless. * @type {number || null} */ this.Gender = null; /** * Age. Value range: [0,100]. If `NeedFaceAttributes` is not 1 or more than 5 faces are detected, this parameter will still be returned but meaningless. * @type {number || null} */ this.Age = null; /** * Expression. Value range: [0 (normal)–50 (smile)–100 (laugh)]. If `NeedFaceAttributes` is not 1 or more than 5 faces are detected, this parameter will still be returned but meaningless. * @type {number || null} */ this.Expression = null; /** * Whether glasses are present. Valid values: true, false. If `NeedFaceAttributes` is not 1 or more than 5 faces are detected, this parameter will still be returned but meaningless. * @type {boolean || null} */ this.Glass = null; /** * Vertical offset in degrees. Value range: [-30,30]. If `NeedFaceAttributes` is not 1 or more than 5 faces are detected, this parameter will still be returned but meaningless. We recommend selecting images in the [-10,10] range for adding faces. * @type {number || null} */ this.Pitch = null; /** * Horizontal offset in degrees. Value range: [-30,30]. If `NeedFaceAttributes` is not 1 or more than 5 faces are detected, this parameter will still be returned but meaningless. We recommend selecting images in the [-10,10] range for adding faces. * @type {number || null} */ this.Yaw = null; /** * Horizontal rotation in degrees. Value range: [-180,180]. If `NeedFaceAttributes` is not 1 or more than 5 faces are detected, this parameter will still be returned but meaningless. We recommend selecting images in the [-20,20] range for adding faces. * @type {number || null} */ this.Roll = null; /** * Beauty. Value range: [0,100]. If `NeedFaceAttributes` is not 1 or more than 5 faces are detected, this parameter will still be returned but meaningless. * @type {number || null} */ this.Beauty = null; /** * Whether hat is present. Valid values: true, false. If `NeedFaceAttributes` is not 1 or more than 5 faces are detected, this parameter will still be returned but meaningless. Note: this field may return null, indicating that no valid values can be obtained. * @type {boolean || null} */ this.Hat = null; /** * Whether mask is present. Valid values: true, false. If `NeedFaceAttributes` is not 1 or more than 5 faces are detected, this parameter will still be returned but meaningless. Note: this field may return null, indicating that no valid values can be obtained. * @type {boolean || null} */ this.Mask = null; /** * Hair information, including length, bang, and color. If `NeedFaceAttributes` is not 1 or more than 5 faces are detected, this parameter will still be returned but meaningless. Note: this field may return null, indicating that no valid values can be obtained. * @type {FaceHairAttributesInfo || null} */ this.Hair = null; /** * Whether the eyes are open. Valid values: true, false. As long as there is more than one eye closed, `false` will be returned. If `NeedFaceAttributes` is not 1 or more than 5 faces are detected, this parameter will still be returned but meaningless. Note: this field may return null, indicating that no valid values can be obtained. * @type {boolean || null} */ this.EyeOpen = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.Gender = 'Gender' in params ? params.Gender : null; this.Age = 'Age' in params ? params.Age : null; this.Expression = 'Expression' in params ? params.Expression : null; this.Glass = 'Glass' in params ? params.Glass : null; this.Pitch = 'Pitch' in params ? params.Pitch : null; this.Yaw = 'Yaw' in params ? params.Yaw : null; this.Roll = 'Roll' in params ? params.Roll : null; this.Beauty = 'Beauty' in params ? params.Beauty : null; this.Hat = 'Hat' in params ? params.Hat : null; this.Mask = 'Mask' in params ? params.Mask : null; if (params.Hair) { let obj = new FaceHairAttributesInfo(); obj.deserialize(params.Hair) this.Hair = obj; } this.EyeOpen = 'EyeOpen' in params ? params.EyeOpen : null; } } /** * DetectFaceAttributes request structure. * @class */ class DetectFaceAttributesRequest extends AbstractModel { constructor(){ super(); /** * Maximum number of processable faces. Default value: 1 (i.e., detecting only the face with the largest size in the image). Maximum value: 120. This parameter is used to control the number of faces in the image to be detected. The smaller the value, the faster the processing. * @type {number || null} */ this.MaxFaceNum = null; /** * Base64-encoded image data, which cannot exceed 5 MB. The long side cannot exceed 4,000 px for images in JPG format or 2,000 px for images in other formats. PNG, JPG, JPEG, and BMP images are supported, while GIF images are not. * @type {string || null} */ this.Image = null; /** * Image URL. The image cannot exceed 5 MB in size after being Base64-encoded. The long side cannot exceed 4,000 px for images in JPG format or 2,000 px for images in other formats. Either `Url` or `Image` must be provided; if both are provided, only `Url` will be used. We recommend storing the image in Tencent Cloud, as a Tencent Cloud URL can guarantee higher download speed and stability. The download speed and stability of non-Tencent Cloud URLs may be low. PNG, JPG, JPEG, and BMP images are supported, while GIF images are not. * @type {string || null} */ this.Url = null; /** * Whether to return attributes such as age, gender, and emotion. Valid values (case-insensitive): None, Age, Beauty, Emotion, Eye, Eyebrow, Gender, Hair, Hat, Headpose, Mask, Mouth, Moustache, Nose, Shape, Skin, Smile. `None` indicates that no attributes need to be returned, which is the default value; that is, if the `FaceAttributesType` attribute is empty, the values of all attributes will be `0`. You need to combine the attributes into a string and separate them by comma. The sequence of the attributes is not limited. For more information on the attributes, see the output parameters as described below. The face attribute information of up to 5 largest faces in the image will be returned, and `AttributesInfo` of the 6th and rest faces is meaningless. * @type {string || null} */ this.FaceAttributesType = null; /** * Whether to enable the support for rotated image recognition. 0: no; 1: yes. Default value: 0. When the face in the image is rotated and the image has no EXIF information, if this parameter is not enabled, the face in the image cannot be correctly detected and recognized. If you are sure that the input image contains EXIF information or the face in the image is not rotated, do not enable this parameter, as the overall time consumption may increase by hundreds of milliseconds after it is enabled. * @type {number || null} */ this.NeedRotateDetection = null; /** * Algorithm model version used by the Face Recognition service. You can enter only `3.0` for this API. * @type {string || null} */ this.FaceModelVersion = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.MaxFaceNum = 'MaxFaceNum' in params ? params.MaxFaceNum : null; this.Image = 'Image' in params ? params.Image : null; this.Url = 'Url' in params ? params.Url : null; this.FaceAttributesType = 'FaceAttributesType' in params ? params.FaceAttributesType : null; this.NeedRotateDetection = 'NeedRotateDetection' in params ? params.NeedRotateDetection : null; this.FaceModelVersion = 'FaceModelVersion' in params ? params.FaceModelVersion : null; } } /** * ModifyGroup request structure. * @class */ class ModifyGroupRequest extends AbstractModel { constructor(){ super(); /** * Group ID, which is the `GroupId` in the `CreateGroup` API. * @type {string || null} */ this.GroupId = null; /** * Group name * @type {string || null} */ this.GroupName = null; /** * Custom description field of the group to be modified, which is a `key-value` pair. * @type {Array.<GroupExDescriptionInfo> || null} */ this.GroupExDescriptionInfos = null; /** * Group remarks * @type {string || null} */ this.Tag = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.GroupId = 'GroupId' in params ? params.GroupId : null; this.GroupName = 'GroupName' in params ? params.GroupName : null; if (params.GroupExDescriptionInfos) { this.GroupExDescriptionInfos = new Array(); for (let z in params.GroupExDescriptionInfos) { let obj = new GroupExDescriptionInfo(); obj.deserialize(params.GroupExDescriptionInfos[z]); this.GroupExDescriptionInfos.push(obj); } } this.Tag = 'Tag' in params ? params.Tag : null; } } /** * CreatePerson request structure. * @class */ class CreatePersonRequest extends AbstractModel { constructor(){ super(); /** * ID of the group to join, which is the `GroupId` in the `CreateGroup` API. * @type {string || null} */ this.GroupId = null; /** * Person name, which can contain 1 to 60 characters and is modifiable and repeatable. * @type {string || null} */ this.PersonName = null; /** * Person ID, which is unmodifiable, must be unique under a Tencent Cloud account, and can contain letters, digits, and special symbols (-%@#&_) of up to 64 B. * @type {string || null} */ this.PersonId = null; /** * 0: empty; 1: male; 2: female. * @type {number || null} */ this.Gender = null; /** * Content of person description field, which is a `key-value` pair, can contain 0 to 60 characters, and is modifiable and repeatable. * @type {Array.<PersonExDescriptionInfo> || null} */ this.PersonExDescriptionInfos = null; /** * Base64-encoded image data, which cannot exceed 5 MB. The long side cannot exceed 4,000 px for images in JPG format or 2,000 px for images in other formats. PNG, JPG, JPEG, and BMP images are supported, while GIF images are not. * @type {string || null} */ this.Image = null; /** * Image URL. The image cannot exceed 5 MB in size after being Base64-encoded. The long side cannot exceed 4,000 px for images in JPG format or 2,000 px for images in other formats. Either `Url` or `Image` must be provided; if both are provided, only `Url` will be used. We recommend storing the image in Tencent Cloud, as a Tencent Cloud URL can guarantee higher download speed and stability. The download speed and stability of non-Tencent Cloud URLs may be low. PNG, JPG, JPEG, and BMP images are supported, while GIF images are not. * @type {string || null} */ this.Url = null; /** * This parameter is used to control the judgment whether the face contained in the image in `Image` or `Url` corresponds to an existing person in the group. If it is judged that a duplicate person exists in the group, no new person will be created, and information of the suspected duplicate person will be returned. Otherwise, the new person will be created. 0: do not judge, i.e., the person will be created no matter whether a duplicate person exists in the group. 1: low duplicate person judgment requirement (1% FAR); 2: average duplicate person judgment requirement (0.1% FAR); 3: high duplicate person judgment requirement (0.01% FAR); 4: very high duplicate person judgment requirement (0.001% FAR). Default value: 0. Note: the higher the requirement, the lower the probability of duplicate person. The FARs corresponding to different requirements are for reference only and can be adjusted as needed. * @type {number || null} */ this.UniquePersonControl = null; /** * Image quality control. 0: no control. 1: low quality requirement. The image has one or more of the following problems: extreme blurriness, covered eyes, covered nose, and covered mouth. 2: average quality requirement. The image has at least three of the following problems: excessive brightness, excessive dimness, blurriness or average blurriness, covered eyebrows, covered cheeks, and covered chin. 3: high-quality requirement. The image has one to two of the following problems: excessive brightness, excessive dimness, average blurriness, covered eyebrows, covered cheeks, and covered chin. 4: very high-quality requirement. The image is optimal in all dimensions or only has a slight problem in one dimension. Default value: 0. If the image quality does not meet the requirement, the returned result will prompt that the detected image quality is unsatisfactory. * @type {number || null} */ this.QualityControl = null; /** * Whether to enable the support for rotated image recognition. 0: no; 1: yes. Default value: 0. When the face in the image is rotated and the image has no EXIF information, if this parameter is not enabled, the face in the image cannot be correctly detected and recognized. If you are sure that the input image contains EXIF information or the face in the image will not be rotated, do not enable this parameter, as the overall time consumption may increase by hundreds of milliseconds after it is enabled. * @type {number || null} */ this.NeedRotateDetection = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.GroupId = 'GroupId' in params ? params.GroupId : null; this.PersonName = 'PersonName' in params ? params.PersonName : null; this.PersonId = 'PersonId' in params ? params.PersonId : null; this.Gender = 'Gender' in params ? params.Gender : null; if (params.PersonExDescriptionInfos) { this.PersonExDescriptionInfos = new Array(); for (let z in params.PersonExDescriptionInfos) { let obj = new PersonExDescriptionInfo(); obj.deserialize(params.PersonExDescriptionInfos[z]); this.PersonExDescriptionInfos.push(obj); } } this.Image = 'Image' in params ? params.Image : null; this.Url = 'Url' in params ? params.Url : null; this.UniquePersonControl = 'UniquePersonControl' in params ? params.UniquePersonControl : null; this.QualityControl = 'QualityControl' in params ? params.QualityControl : null; this.NeedRotateDetection = 'NeedRotateDetection' in params ? params.NeedRotateDetection : null; } } /** * GetGroupList request structure. * @class */ class GetGroupListRequest extends AbstractModel { constructor(){ super(); /** * Starting number. Default value: 0. * @type {number || null} */ this.Offset = null; /** * Number of returned results. Default value: 10. Maximum value: 1000. * @type {number || null} */ this.Limit = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.Offset = 'Offset' in params ? params.Offset : null; this.Limit = 'Limit' in params ? params.Limit : null; } } /** * DeleteGroup request structure. * @class */ class DeleteGroupRequest extends AbstractModel { constructor(){ super(); /** * Group ID, which is the `GroupId` in the `CreateGroup` API. * @type {string || null} */ this.GroupId = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.GroupId = 'GroupId' in params ? params.GroupId : null; } } /** * CreateFace response structure. * @class */ class CreateFaceResponse extends AbstractModel { constructor(){ super(); /** * Number of successfully added faces * @type {number || null} */ this.SucFaceNum = null; /** * List of IDs of successfully added faces * @type {Array.<string> || null} */ this.SucFaceIds = null; /** * Adding result for each face image. -1101: no face detected; -1102: image decoding failed; -1601: the image quality control requirement is not met; -1604: the face similarity is not above `FaceMatchThreshold`. Other non-zero values: algorithm service exception. The order of `RetCode` values is the same as the order of `Images` or `Urls` in the input parameter. * @type {Array.<number> || null} */ this.RetCode = null; /** * Indexes of successfully added faces. The order of indexes is the same as the order of `Images` or `Urls` in the input parameter. For example, if there are 3 URLs in `Urls`, and the second URL fails, then the value of `SucIndexes` will be [0,2]. * @type {Array.<number> || null} */ this.SucIndexes = null; /** * Frame positions of successfully added faces. The order is the same as the order of `Images` or `Urls` in the input parameter. * @type {Array.<FaceRect> || null} */ this.SucFaceRects = null; /** * Algorithm model version used for face recognition. * @type {string || null} */ this.FaceModelVersion = null; /** * The unique request ID, which is returned for each request. RequestId is required for locating a problem. * @type {string || null} */ this.RequestId = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.SucFaceNum = 'SucFaceNum' in params ? params.SucFaceNum : null; this.SucFaceIds = 'SucFaceIds' in params ? params.SucFaceIds : null; this.RetCode = 'RetCode' in params ? params.RetCode : null; this.SucIndexes = 'SucIndexes' in params ? params.SucIndexes : null; if (params.SucFaceRects) { this.SucFaceRects = new Array(); for (let z in params.SucFaceRects) { let obj = new FaceRect(); obj.deserialize(params.SucFaceRects[z]); this.SucFaceRects.push(obj); } } this.FaceModelVersion = 'FaceModelVersion' in params ? params.FaceModelVersion : null; this.RequestId = 'RequestId' in params ? params.RequestId : null; } } /** * DetectFaceAttributes response structure. * @class */ class DetectFaceAttributesResponse extends AbstractModel { constructor(){ super(); /** * Width of requested image. * @type {number || null} */ this.ImageWidth = null; /** * Height of requested image. * @type {number || null} */ this.ImageHeight = null; /** * Face information list. * @type {Array.<FaceDetailInfo> || null} */ this.FaceDetailInfos = null; /** * Algorithm model version used for face recognition. * @type {string || null} */ this.FaceModelVersion = null; /** * The unique request ID, which is returned for each request. RequestId is required for locating a problem. * @type {string || null} */ this.RequestId = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.ImageWidth = 'ImageWidth' in params ? params.ImageWidth : null; this.ImageHeight = 'ImageHeight' in params ? params.ImageHeight : null; if (params.FaceDetailInfos) { this.FaceDetailInfos = new Array(); for (let z in params.FaceDetailInfos) { let obj = new FaceDetailInfo(); obj.deserialize(params.FaceDetailInfos[z]); this.FaceDetailInfos.push(obj); } } this.FaceModelVersion = 'FaceModelVersion' in params ? params.FaceModelVersion : null; this.RequestId = 'RequestId' in params ? params.RequestId : null; } } /** * DetectFaceSimilarity request structure. * @class */ class DetectFaceSimilarityRequest extends AbstractModel { constructor(){ super(); /** * A image base64 data. - The size after base64 encoding cannot exceed 5M. - The long side pixels of jpg format cannot exceed 4000, and the long side pixels of pictures in other formats cannot exceed 2000. The short side of images in all formats must be no less than 64 pixels. - If the picture contains multiple faces, only the face with the highest confidence is selected. - Supports PNG, JPG, JPEG, BMP, but does not support GIF images. * @type {string || null} */ this.ImageA = null; /** * B image base64 data. - The size after base64 encoding cannot exceed 5M. - The long side pixels of jpg format cannot exceed 4000, and the long side pixels of pictures in other formats cannot exceed 2000. The short side of images in all formats must be no less than 64 pixels. - If the picture contains multiple faces, only the face with the highest confidence is selected. - Supports PNG, JPG, JPEG, BMP, but does not support GIF images. * @type {string || null} */ this.ImageB = null; /** * A URL for the image. - The size of the corresponding image after base64 encoding cannot exceed 5M. - The long side pixels of jpg format cannot exceed 4000, and the long side pixels of pictures in other formats cannot exceed 2000. The short side of images in all formats must be no less than 64 pixels. - A The URL