1// Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved. 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15package v20180301 16 17import ( 18 "encoding/json" 19 "errors" 20 21 tchttp "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http" 22) 23 24type AnalyzeDenseLandmarksRequest struct { 25 *tchttp.BaseRequest 26 27 // 检测模式。0 为检测所有出现的人脸, 1 为检测面积最大的人脸。 28 // 默认为 0。 29 // 最多返回 5 张人脸的五官定位(人脸关键点)具体信息。 30 Mode *uint64 `json:"Mode,omitempty" name:"Mode"` 31 32 // 图片 base64 数据,base64 编码后大小不可超过5M。 33 // jpg格式长边像素不可超过4000,其他格式图片长边像素不可超2000。 34 // 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。 35 Image *string `json:"Image,omitempty" name:"Image"` 36 37 // 图片的 Url 。对应图片 base64 编码后大小不可超过5M。 38 // jpg格式长边像素不可超过4000,其他格式图片长边像素不可超2000。 39 // Url、Image必须提供一个,如果都提供,只使用 Url。 40 // 图片存储于腾讯云的Url可保障更高下载速度和稳定性,建议图片存储于腾讯云。 41 // 非腾讯云存储的Url速度和稳定性可能受一定影响。 42 // 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。 43 Url *string `json:"Url,omitempty" name:"Url"` 44 45 // 人脸识别服务所用的算法模型版本。本接口仅支持 “3.0“ 输入。 46 FaceModelVersion *string `json:"FaceModelVersion,omitempty" name:"FaceModelVersion"` 47 48 // 是否开启图片旋转识别支持。0为不开启,1为开启。默认为0。本参数的作用为,当图片中的人脸被旋转且图片没有exif信息时,如果不开启图片旋转识别支持则无法正确检测、识别图片中的人脸。若您确认图片包含exif信息或者您确认输入图中人脸不会出现被旋转情况,请不要开启本参数。开启后,整体耗时将可能增加数百毫秒。 49 NeedRotateDetection *int64 `json:"NeedRotateDetection,omitempty" name:"NeedRotateDetection"` 50} 51 52func (r *AnalyzeDenseLandmarksRequest) ToJsonString() string { 53 b, _ := json.Marshal(r) 54 return string(b) 55} 56 57// It is highly **NOT** recommended to use this function 58// because it has no param check, nor strict type check 59func (r *AnalyzeDenseLandmarksRequest) FromJsonString(s string) error { 60 f := make(map[string]interface{}) 61 if err := json.Unmarshal([]byte(s), &f); err != nil { 62 return err 63 } 64 delete(f, "Mode") 65 delete(f, "Image") 66 delete(f, "Url") 67 delete(f, "FaceModelVersion") 68 delete(f, "NeedRotateDetection") 69 if len(f) > 0 { 70 return errors.New("AnalyzeDenseLandmarksRequest has unknown keys!") 71 } 72 return json.Unmarshal([]byte(s), &r) 73} 74 75type AnalyzeDenseLandmarksResponse struct { 76 *tchttp.BaseResponse 77 Response *struct { 78 79 // 请求的图片宽度。 80 ImageWidth *int64 `json:"ImageWidth,omitempty" name:"ImageWidth"` 81 82 // 请求的图片高度。 83 ImageHeight *int64 `json:"ImageHeight,omitempty" name:"ImageHeight"` 84 85 // 稠密人脸关键点具体信息。 86 DenseFaceShapeSet []*DenseFaceShape `json:"DenseFaceShapeSet,omitempty" name:"DenseFaceShapeSet" list` 87 88 // 人脸识别服务所用的算法模型版本。本接口仅支持 “3.0“ 输入。 89 FaceModelVersion *string `json:"FaceModelVersion,omitempty" name:"FaceModelVersion"` 90 91 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 92 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 93 } `json:"Response"` 94} 95 96func (r *AnalyzeDenseLandmarksResponse) ToJsonString() string { 97 b, _ := json.Marshal(r) 98 return string(b) 99} 100 101// It is highly **NOT** recommended to use this function 102// because it has no param check, nor strict type check 103func (r *AnalyzeDenseLandmarksResponse) FromJsonString(s string) error { 104 return json.Unmarshal([]byte(s), &r) 105} 106 107type AnalyzeFaceRequest struct { 108 *tchttp.BaseRequest 109 110 // 检测模式。0 为检测所有出现的人脸, 1 为检测面积最大的人脸。默认为 0。最多返回 10 张人脸的五官定位(人脸关键点)具体信息。 111 Mode *uint64 `json:"Mode,omitempty" name:"Mode"` 112 113 // 图片 base64 数据,base64 编码后大小不可超过5M。 114 // 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。 115 Image *string `json:"Image,omitempty" name:"Image"` 116 117 // 图片的 Url 。对应图片 base64 编码后大小不可超过5M。 118 // Url、Image必须提供一个,如果都提供,只使用 Url。 119 // 图片存储于腾讯云的Url可保障更高下载速度和稳定性,建议图片存储于腾讯云。 120 // 非腾讯云存储的Url速度和稳定性可能受一定影响。 121 // 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。 122 Url *string `json:"Url,omitempty" name:"Url"` 123 124 // 人脸识别服务所用的算法模型版本。 125 // 126 // 目前入参支持 “2.0”和“3.0“ 两个输入。 127 // 128 // 2020年4月2日开始,默认为“3.0”,之前使用过本接口的账号若未填写本参数默认为“2.0”。 129 // 130 // 2020年11月26日后开通服务的账号仅支持输入“3.0”。 131 // 132 // 不同算法模型版本对应的人脸识别算法不同,新版本的整体效果会优于旧版本,建议使用“3.0”版本。 133 FaceModelVersion *string `json:"FaceModelVersion,omitempty" name:"FaceModelVersion"` 134 135 // 是否开启图片旋转识别支持。0为不开启,1为开启。默认为0。本参数的作用为,当图片中的人脸被旋转且图片没有exif信息时,如果不开启图片旋转识别支持则无法正确检测、识别图片中的人脸。若您确认图片包含exif信息或者您确认输入图中人脸不会出现被旋转情况,请不要开启本参数。开启后,整体耗时将可能增加数百毫秒。 136 NeedRotateDetection *uint64 `json:"NeedRotateDetection,omitempty" name:"NeedRotateDetection"` 137} 138 139func (r *AnalyzeFaceRequest) ToJsonString() string { 140 b, _ := json.Marshal(r) 141 return string(b) 142} 143 144// It is highly **NOT** recommended to use this function 145// because it has no param check, nor strict type check 146func (r *AnalyzeFaceRequest) FromJsonString(s string) error { 147 f := make(map[string]interface{}) 148 if err := json.Unmarshal([]byte(s), &f); err != nil { 149 return err 150 } 151 delete(f, "Mode") 152 delete(f, "Image") 153 delete(f, "Url") 154 delete(f, "FaceModelVersion") 155 delete(f, "NeedRotateDetection") 156 if len(f) > 0 { 157 return errors.New("AnalyzeFaceRequest has unknown keys!") 158 } 159 return json.Unmarshal([]byte(s), &r) 160} 161 162type AnalyzeFaceResponse struct { 163 *tchttp.BaseResponse 164 Response *struct { 165 166 // 请求的图片宽度。 167 ImageWidth *uint64 `json:"ImageWidth,omitempty" name:"ImageWidth"` 168 169 // 请求的图片高度。 170 ImageHeight *uint64 `json:"ImageHeight,omitempty" name:"ImageHeight"` 171 172 // 五官定位(人脸关键点)具体信息。 173 FaceShapeSet []*FaceShape `json:"FaceShapeSet,omitempty" name:"FaceShapeSet" list` 174 175 // 人脸识别所用的算法模型版本。 176 FaceModelVersion *string `json:"FaceModelVersion,omitempty" name:"FaceModelVersion"` 177 178 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 179 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 180 } `json:"Response"` 181} 182 183func (r *AnalyzeFaceResponse) ToJsonString() string { 184 b, _ := json.Marshal(r) 185 return string(b) 186} 187 188// It is highly **NOT** recommended to use this function 189// because it has no param check, nor strict type check 190func (r *AnalyzeFaceResponse) FromJsonString(s string) error { 191 return json.Unmarshal([]byte(s), &r) 192} 193 194type AttributeItem struct { 195 196 // 属性值 197 Type *int64 `json:"Type,omitempty" name:"Type"` 198 199 // Type识别概率值,【0,1】,代表判断正确的概率。 200 Probability *float64 `json:"Probability,omitempty" name:"Probability"` 201} 202 203type Candidate struct { 204 205 // 人员ID 206 PersonId *string `json:"PersonId,omitempty" name:"PersonId"` 207 208 // 人脸ID 209 FaceId *string `json:"FaceId,omitempty" name:"FaceId"` 210 211 // 候选者的匹配得分。 212 // 213 // 1万大小人脸底库下,误识率百分之一对应分数为70分,误识率千分之一对应分数为80分,误识率万分之一对应分数为90分; 214 // 10万大小人脸底库下,误识率百分之一对应分数为80分,误识率千分之一对应分数为90分,误识率万分之一对应分数为100分; 215 // 30万大小人脸底库下,误识率百分之一对应分数为85分,误识率千分之一对应分数为95分。 216 // 217 // 一般80分左右可适用大部分场景,建议分数不要超过90分。您可以根据实际情况选择合适的分数。 218 Score *float64 `json:"Score,omitempty" name:"Score"` 219 220 // 人员名称 221 // 注意:此字段可能返回 null,表示取不到有效值。 222 PersonName *string `json:"PersonName,omitempty" name:"PersonName"` 223 224 // 人员性别 225 // 注意:此字段可能返回 null,表示取不到有效值。 226 Gender *int64 `json:"Gender,omitempty" name:"Gender"` 227 228 // 包含此人员的人员库及描述字段内容列表 229 // 注意:此字段可能返回 null,表示取不到有效值。 230 PersonGroupInfos []*PersonGroupInfo `json:"PersonGroupInfos,omitempty" name:"PersonGroupInfos" list` 231} 232 233type CheckSimilarPersonRequest struct { 234 *tchttp.BaseRequest 235 236 // 待整理的人员库列表。 237 // 人员库总人数不可超过200万,人员库个数不可超过10个。 238 GroupIds []*string `json:"GroupIds,omitempty" name:"GroupIds" list` 239 240 // 人员查重整理力度的控制。 241 // 1:力度较高的档案整理,能够消除更多的重复身份,对应稍高的非重复身份误清除率; 242 // 2:力度较低的档案整理,非重复身份的误清除率较低,对应稍低的重复身份消除率。 243 UniquePersonControl *int64 `json:"UniquePersonControl,omitempty" name:"UniquePersonControl"` 244} 245 246func (r *CheckSimilarPersonRequest) ToJsonString() string { 247 b, _ := json.Marshal(r) 248 return string(b) 249} 250 251// It is highly **NOT** recommended to use this function 252// because it has no param check, nor strict type check 253func (r *CheckSimilarPersonRequest) FromJsonString(s string) error { 254 f := make(map[string]interface{}) 255 if err := json.Unmarshal([]byte(s), &f); err != nil { 256 return err 257 } 258 delete(f, "GroupIds") 259 delete(f, "UniquePersonControl") 260 if len(f) > 0 { 261 return errors.New("CheckSimilarPersonRequest has unknown keys!") 262 } 263 return json.Unmarshal([]byte(s), &r) 264} 265 266type CheckSimilarPersonResponse struct { 267 *tchttp.BaseResponse 268 Response *struct { 269 270 // 查重任务ID,用于查询、获取查重的进度和结果。 271 JobId *string `json:"JobId,omitempty" name:"JobId"` 272 273 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 274 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 275 } `json:"Response"` 276} 277 278func (r *CheckSimilarPersonResponse) ToJsonString() string { 279 b, _ := json.Marshal(r) 280 return string(b) 281} 282 283// It is highly **NOT** recommended to use this function 284// because it has no param check, nor strict type check 285func (r *CheckSimilarPersonResponse) FromJsonString(s string) error { 286 return json.Unmarshal([]byte(s), &r) 287} 288 289type CompareFaceRequest struct { 290 *tchttp.BaseRequest 291 292 // A 图片 base64 数据,base64 编码后大小不可超过5M。 293 // 若图片中包含多张人脸,只选取其中人脸面积最大的人脸。 294 // 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。 295 ImageA *string `json:"ImageA,omitempty" name:"ImageA"` 296 297 // B 图片 base64 数据,base64 编码后大小不可超过5M。 298 // 若图片中包含多张人脸,只选取其中人脸面积最大的人脸。 299 // 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。 300 ImageB *string `json:"ImageB,omitempty" name:"ImageB"` 301 302 // A 图片的 Url ,对应图片 base64 编码后大小不可超过5M。 303 // A 图片的 Url、Image必须提供一个,如果都提供,只使用 Url。 304 // 图片存储于腾讯云的Url可保障更高下载速度和稳定性,建议图片存储于腾讯云。 305 // 非腾讯云存储的Url速度和稳定性可能受一定影响。 306 // 若图片中包含多张人脸,只选取其中人脸面积最大的人脸。 307 // 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。 308 UrlA *string `json:"UrlA,omitempty" name:"UrlA"` 309 310 // B 图片的 Url ,对应图片 base64 编码后大小不可超过5M。 311 // B 图片的 Url、Image必须提供一个,如果都提供,只使用 Url。 312 // 图片存储于腾讯云的Url可保障更高下载速度和稳定性,建议图片存储于腾讯云。 313 // 非腾讯云存储的Url速度和稳定性可能受一定影响。 314 // 若图片中包含多张人脸,只选取其中人脸面积最大的人脸。 315 // 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。 316 UrlB *string `json:"UrlB,omitempty" name:"UrlB"` 317 318 // 人脸识别服务所用的算法模型版本。 319 // 320 // 目前入参支持 “2.0”和“3.0“ 两个输入。 321 // 322 // 2020年4月2日开始,默认为“3.0”,之前使用过本接口的账号若未填写本参数默认为“2.0”。 323 // 324 // 2020年11月26日后开通服务的账号仅支持输入“3.0”。 325 // 326 // 不同算法模型版本对应的人脸识别算法不同,新版本的整体效果会优于旧版本,建议使用“3.0”版本。 327 FaceModelVersion *string `json:"FaceModelVersion,omitempty" name:"FaceModelVersion"` 328 329 // 图片质量控制。 330 // 0: 不进行控制; 331 // 1:较低的质量要求,图像存在非常模糊,眼睛鼻子嘴巴遮挡至少其中一种或多种的情况; 332 // 2: 一般的质量要求,图像存在偏亮,偏暗,模糊或一般模糊,眉毛遮挡,脸颊遮挡,下巴遮挡,至少其中三种的情况; 333 // 3: 较高的质量要求,图像存在偏亮,偏暗,一般模糊,眉毛遮挡,脸颊遮挡,下巴遮挡,其中一到两种的情况; 334 // 4: 很高的质量要求,各个维度均为最好或最多在某一维度上存在轻微问题; 335 // 默认 0。 336 // 若图片质量不满足要求,则返回结果中会提示图片质量检测不符要求。 337 QualityControl *uint64 `json:"QualityControl,omitempty" name:"QualityControl"` 338 339 // 是否开启图片旋转识别支持。0为不开启,1为开启。默认为0。本参数的作用为,当图片中的人脸被旋转且图片没有exif信息时,如果不开启图片旋转识别支持则无法正确检测、识别图片中的人脸。若您确认图片包含exif信息或者您确认输入图中人脸不会出现被旋转情况,请不要开启本参数。开启后,整体耗时将可能增加数百毫秒。 340 NeedRotateDetection *uint64 `json:"NeedRotateDetection,omitempty" name:"NeedRotateDetection"` 341} 342 343func (r *CompareFaceRequest) ToJsonString() string { 344 b, _ := json.Marshal(r) 345 return string(b) 346} 347 348// It is highly **NOT** recommended to use this function 349// because it has no param check, nor strict type check 350func (r *CompareFaceRequest) FromJsonString(s string) error { 351 f := make(map[string]interface{}) 352 if err := json.Unmarshal([]byte(s), &f); err != nil { 353 return err 354 } 355 delete(f, "ImageA") 356 delete(f, "ImageB") 357 delete(f, "UrlA") 358 delete(f, "UrlB") 359 delete(f, "FaceModelVersion") 360 delete(f, "QualityControl") 361 delete(f, "NeedRotateDetection") 362 if len(f) > 0 { 363 return errors.New("CompareFaceRequest has unknown keys!") 364 } 365 return json.Unmarshal([]byte(s), &r) 366} 367 368type CompareFaceResponse struct { 369 *tchttp.BaseResponse 370 Response *struct { 371 372 // 两张图片中人脸的相似度分数。 373 // 不同算法版本返回的相似度分数不同。 374 // 若需要验证两张图片中人脸是否为同一人,3.0版本误识率千分之一对应分数为40分,误识率万分之一对应分数为50分,误识率十万分之一对应分数为60分。 一般超过50分则可认定为同一人。 375 // 2.0版本误识率千分之一对应分数为70分,误识率万分之一对应分数为80分,误识率十万分之一对应分数为90分。 一般超过80分则可认定为同一人。 376 // 若需要验证两张图片中的人脸是否为同一人,建议使用人脸验证接口。 377 Score *float64 `json:"Score,omitempty" name:"Score"` 378 379 // 人脸识别所用的算法模型版本。 380 FaceModelVersion *string `json:"FaceModelVersion,omitempty" name:"FaceModelVersion"` 381 382 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 383 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 384 } `json:"Response"` 385} 386 387func (r *CompareFaceResponse) ToJsonString() string { 388 b, _ := json.Marshal(r) 389 return string(b) 390} 391 392// It is highly **NOT** recommended to use this function 393// because it has no param check, nor strict type check 394func (r *CompareFaceResponse) FromJsonString(s string) error { 395 return json.Unmarshal([]byte(s), &r) 396} 397 398type CopyPersonRequest struct { 399 *tchttp.BaseRequest 400 401 // 人员ID 402 PersonId *string `json:"PersonId,omitempty" name:"PersonId"` 403 404 // 待加入的人员库列表 405 GroupIds []*string `json:"GroupIds,omitempty" name:"GroupIds" list` 406} 407 408func (r *CopyPersonRequest) ToJsonString() string { 409 b, _ := json.Marshal(r) 410 return string(b) 411} 412 413// It is highly **NOT** recommended to use this function 414// because it has no param check, nor strict type check 415func (r *CopyPersonRequest) FromJsonString(s string) error { 416 f := make(map[string]interface{}) 417 if err := json.Unmarshal([]byte(s), &f); err != nil { 418 return err 419 } 420 delete(f, "PersonId") 421 delete(f, "GroupIds") 422 if len(f) > 0 { 423 return errors.New("CopyPersonRequest has unknown keys!") 424 } 425 return json.Unmarshal([]byte(s), &r) 426} 427 428type CopyPersonResponse struct { 429 *tchttp.BaseResponse 430 Response *struct { 431 432 // 成功加入的人员库数量 433 SucGroupNum *uint64 `json:"SucGroupNum,omitempty" name:"SucGroupNum"` 434 435 // 成功加入的人员库列表 436 SucGroupIds []*string `json:"SucGroupIds,omitempty" name:"SucGroupIds" list` 437 438 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 439 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 440 } `json:"Response"` 441} 442 443func (r *CopyPersonResponse) ToJsonString() string { 444 b, _ := json.Marshal(r) 445 return string(b) 446} 447 448// It is highly **NOT** recommended to use this function 449// because it has no param check, nor strict type check 450func (r *CopyPersonResponse) FromJsonString(s string) error { 451 return json.Unmarshal([]byte(s), &r) 452} 453 454type CreateFaceRequest struct { 455 *tchttp.BaseRequest 456 457 // 人员ID。 458 PersonId *string `json:"PersonId,omitempty" name:"PersonId"` 459 460 // 图片 base64 数据,base64 编码后大小不可超过5M。 461 // 人员人脸总数量不可超过5张。 462 // 若图片中包含多张人脸,只选取其中人脸面积最大的人脸。 463 // 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。 464 Images []*string `json:"Images,omitempty" name:"Images" list` 465 466 // 图片的 Url 。对应图片 base64 编码后大小不可超过5M。 467 // Url、Image必须提供一个,如果都提供,只使用 Url。 468 // 图片存储于腾讯云的Url可保障更高下载速度和稳定性,建议图片存储于腾讯云。 469 // 非腾讯云存储的Url速度和稳定性可能受一定影响。 470 // 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。 471 // 人员人脸总数量不可超过5张。 472 // 若图片中包含多张人脸,只选取其中人脸面积最大的人脸。 473 Urls []*string `json:"Urls,omitempty" name:"Urls" list` 474 475 // 只有和该人员已有的人脸相似度超过FaceMatchThreshold值的人脸,才能增加人脸成功。 476 // 默认值60分。取值范围[0,100] 。 477 FaceMatchThreshold *float64 `json:"FaceMatchThreshold,omitempty" name:"FaceMatchThreshold"` 478 479 // 图片质量控制。 480 // 0: 不进行控制; 481 // 1:较低的质量要求,图像存在非常模糊,眼睛鼻子嘴巴遮挡至少其中一种或多种的情况; 482 // 2: 一般的质量要求,图像存在偏亮,偏暗,模糊或一般模糊,眉毛遮挡,脸颊遮挡,下巴遮挡,至少其中三种的情况; 483 // 3: 较高的质量要求,图像存在偏亮,偏暗,一般模糊,眉毛遮挡,脸颊遮挡,下巴遮挡,其中一到两种的情况; 484 // 4: 很高的质量要求,各个维度均为最好或最多在某一维度上存在轻微问题; 485 // 默认 0。 486 // 若图片质量不满足要求,则返回结果中会提示图片质量检测不符要求。 487 QualityControl *uint64 `json:"QualityControl,omitempty" name:"QualityControl"` 488 489 // 是否开启图片旋转识别支持。0为不开启,1为开启。默认为0。本参数的作用为,当图片中的人脸被旋转且图片没有exif信息时,如果不开启图片旋转识别支持则无法正确检测、识别图片中的人脸。若您确认图片包含exif信息或者您确认输入图中人脸不会出现被旋转情况,请不要开启本参数。开启后,整体耗时将可能增加数百毫秒。 490 NeedRotateDetection *uint64 `json:"NeedRotateDetection,omitempty" name:"NeedRotateDetection"` 491} 492 493func (r *CreateFaceRequest) ToJsonString() string { 494 b, _ := json.Marshal(r) 495 return string(b) 496} 497 498// It is highly **NOT** recommended to use this function 499// because it has no param check, nor strict type check 500func (r *CreateFaceRequest) FromJsonString(s string) error { 501 f := make(map[string]interface{}) 502 if err := json.Unmarshal([]byte(s), &f); err != nil { 503 return err 504 } 505 delete(f, "PersonId") 506 delete(f, "Images") 507 delete(f, "Urls") 508 delete(f, "FaceMatchThreshold") 509 delete(f, "QualityControl") 510 delete(f, "NeedRotateDetection") 511 if len(f) > 0 { 512 return errors.New("CreateFaceRequest has unknown keys!") 513 } 514 return json.Unmarshal([]byte(s), &r) 515} 516 517type CreateFaceResponse struct { 518 *tchttp.BaseResponse 519 Response *struct { 520 521 // 加入成功的人脸数量 522 SucFaceNum *uint64 `json:"SucFaceNum,omitempty" name:"SucFaceNum"` 523 524 // 加入成功的人脸ID列表 525 SucFaceIds []*string `json:"SucFaceIds,omitempty" name:"SucFaceIds" list` 526 527 // 每张人脸图片添加结果,-1101 代表未检测到人脸,-1102 代表图片解码失败, 528 // -1601代表不符合图片质量控制要求, -1604 代表人脸相似度没有超过FaceMatchThreshold。 529 // 其他非 0 值代表算法服务异常。 530 // RetCode的顺序和入参中 Images 或 Urls 的顺序一致。 531 RetCode []*int64 `json:"RetCode,omitempty" name:"RetCode" list` 532 533 // 加入成功的人脸索引。索引顺序和入参中 Images 或 Urls 的顺序一致。 534 // 例, Urls 中 有 3 个 url,第二个 url 失败,则 SucIndexes 值为 [0,2] 。 535 SucIndexes []*uint64 `json:"SucIndexes,omitempty" name:"SucIndexes" list` 536 537 // 加入成功的人脸框位置。顺序和入参中 Images 或 Urls 的顺序一致。 538 SucFaceRects []*FaceRect `json:"SucFaceRects,omitempty" name:"SucFaceRects" list` 539 540 // 人脸识别所用的算法模型版本。 541 FaceModelVersion *string `json:"FaceModelVersion,omitempty" name:"FaceModelVersion"` 542 543 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 544 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 545 } `json:"Response"` 546} 547 548func (r *CreateFaceResponse) ToJsonString() string { 549 b, _ := json.Marshal(r) 550 return string(b) 551} 552 553// It is highly **NOT** recommended to use this function 554// because it has no param check, nor strict type check 555func (r *CreateFaceResponse) FromJsonString(s string) error { 556 return json.Unmarshal([]byte(s), &r) 557} 558 559type CreateGroupRequest struct { 560 *tchttp.BaseRequest 561 562 // 人员库名称,[1,60]个字符,可修改,不可重复。 563 GroupName *string `json:"GroupName,omitempty" name:"GroupName"` 564 565 // 人员库 ID,不可修改,不可重复。支持英文、数字、-%@#&_,长度限制64B。 566 GroupId *string `json:"GroupId,omitempty" name:"GroupId"` 567 568 // 人员库自定义描述字段,用于描述人员库中人员属性,该人员库下所有人员将拥有此描述字段。 569 // 最多可以创建5个。 570 // 每个自定义描述字段支持[1,30]个字符。 571 // 在同一人员库中自定义描述字段不可重复。 572 // 例: 设置某人员库“自定义描述字段”为["学号","工号","手机号"], 573 // 则该人员库下所有人员将拥有名为“学号”、“工号”、“手机号”的描述字段, 574 // 可在对应人员描述字段中填写内容,登记该人员的学号、工号、手机号等信息。 575 GroupExDescriptions []*string `json:"GroupExDescriptions,omitempty" name:"GroupExDescriptions" list` 576 577 // 人员库信息备注,[0,40]个字符。 578 Tag *string `json:"Tag,omitempty" name:"Tag"` 579 580 // 人脸识别服务所用的算法模型版本。 581 // 582 // 目前入参支持 “2.0”和“3.0“ 两个输入。 583 // 584 // 2020年4月2日开始,默认为“3.0”,之前使用过本接口的账号若未填写本参数默认为“2.0”。 585 // 586 // 2020年11月26日后开通服务的账号仅支持输入“3.0”。 587 // 588 // 不同算法模型版本对应的人脸识别算法不同,新版本的整体效果会优于旧版本,建议使用“3.0”版本。 589 FaceModelVersion *string `json:"FaceModelVersion,omitempty" name:"FaceModelVersion"` 590} 591 592func (r *CreateGroupRequest) ToJsonString() string { 593 b, _ := json.Marshal(r) 594 return string(b) 595} 596 597// It is highly **NOT** recommended to use this function 598// because it has no param check, nor strict type check 599func (r *CreateGroupRequest) FromJsonString(s string) error { 600 f := make(map[string]interface{}) 601 if err := json.Unmarshal([]byte(s), &f); err != nil { 602 return err 603 } 604 delete(f, "GroupName") 605 delete(f, "GroupId") 606 delete(f, "GroupExDescriptions") 607 delete(f, "Tag") 608 delete(f, "FaceModelVersion") 609 if len(f) > 0 { 610 return errors.New("CreateGroupRequest has unknown keys!") 611 } 612 return json.Unmarshal([]byte(s), &r) 613} 614 615type CreateGroupResponse struct { 616 *tchttp.BaseResponse 617 Response *struct { 618 619 // 人脸识别所用的算法模型版本。 620 FaceModelVersion *string `json:"FaceModelVersion,omitempty" name:"FaceModelVersion"` 621 622 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 623 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 624 } `json:"Response"` 625} 626 627func (r *CreateGroupResponse) ToJsonString() string { 628 b, _ := json.Marshal(r) 629 return string(b) 630} 631 632// It is highly **NOT** recommended to use this function 633// because it has no param check, nor strict type check 634func (r *CreateGroupResponse) FromJsonString(s string) error { 635 return json.Unmarshal([]byte(s), &r) 636} 637 638type CreatePersonRequest struct { 639 *tchttp.BaseRequest 640 641 // 待加入的人员库ID。 642 GroupId *string `json:"GroupId,omitempty" name:"GroupId"` 643 644 // 人员名称。[1,60]个字符,可修改,可重复。 645 PersonName *string `json:"PersonName,omitempty" name:"PersonName"` 646 647 // 人员ID,单个腾讯云账号下不可修改,不可重复。支持英文、数字、-%@#&_,长度限制64B。 648 PersonId *string `json:"PersonId,omitempty" name:"PersonId"` 649 650 // 0代表未填写,1代表男性,2代表女性。 651 Gender *int64 `json:"Gender,omitempty" name:"Gender"` 652 653 // 人员描述字段内容,key-value。[0,60]个字符,可修改,可重复。 654 PersonExDescriptionInfos []*PersonExDescriptionInfo `json:"PersonExDescriptionInfos,omitempty" name:"PersonExDescriptionInfos" list` 655 656 // 图片 base64 数据,base64 编码后大小不可超过5M。 657 // 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。 658 Image *string `json:"Image,omitempty" name:"Image"` 659 660 // 图片的 Url 。对应图片 base64 编码后大小不可超过5M。 661 // Url、Image必须提供一个,如果都提供,只使用 Url。 662 // 图片存储于腾讯云的Url可保障更高下载速度和稳定性,建议图片存储于腾讯云。 663 // 非腾讯云存储的Url速度和稳定性可能受一定影响。 664 // 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。 665 Url *string `json:"Url,omitempty" name:"Url"` 666 667 // 此参数用于控制判断 Image 或 Url 中图片包含的人脸,是否在人员库中已有疑似的同一人。 668 // 如果判断为已有相同人在人员库中,则不会创建新的人员,返回疑似同一人的人员信息。 669 // 如果判断没有,则完成创建人员。 670 // 0: 不进行判断,无论是否有疑似同一人在库中均完成入库; 671 // 1:较低的同一人判断要求(百一误识别率); 672 // 2: 一般的同一人判断要求(千一误识别率); 673 // 3: 较高的同一人判断要求(万一误识别率); 674 // 4: 很高的同一人判断要求(十万一误识别率)。 675 // 默认 0。 676 // 注: 要求越高,则疑似同一人的概率越小。不同要求对应的误识别率仅为参考值,您可以根据实际情况调整。 677 UniquePersonControl *uint64 `json:"UniquePersonControl,omitempty" name:"UniquePersonControl"` 678 679 // 图片质量控制。 680 // 0: 不进行控制; 681 // 1:较低的质量要求,图像存在非常模糊,眼睛鼻子嘴巴遮挡至少其中一种或多种的情况; 682 // 2: 一般的质量要求,图像存在偏亮,偏暗,模糊或一般模糊,眉毛遮挡,脸颊遮挡,下巴遮挡,至少其中三种的情况; 683 // 3: 较高的质量要求,图像存在偏亮,偏暗,一般模糊,眉毛遮挡,脸颊遮挡,下巴遮挡,其中一到两种的情况; 684 // 4: 很高的质量要求,各个维度均为最好或最多在某一维度上存在轻微问题; 685 // 默认 0。 686 // 若图片质量不满足要求,则返回结果中会提示图片质量检测不符要求。 687 QualityControl *uint64 `json:"QualityControl,omitempty" name:"QualityControl"` 688 689 // 是否开启图片旋转识别支持。0为不开启,1为开启。默认为0。本参数的作用为,当图片中的人脸被旋转且图片没有exif信息时,如果不开启图片旋转识别支持则无法正确检测、识别图片中的人脸。若您确认图片包含exif信息或者您确认输入图中人脸不会出现被旋转情况,请不要开启本参数。开启后,整体耗时将可能增加数百毫秒。 690 NeedRotateDetection *uint64 `json:"NeedRotateDetection,omitempty" name:"NeedRotateDetection"` 691} 692 693func (r *CreatePersonRequest) ToJsonString() string { 694 b, _ := json.Marshal(r) 695 return string(b) 696} 697 698// It is highly **NOT** recommended to use this function 699// because it has no param check, nor strict type check 700func (r *CreatePersonRequest) FromJsonString(s string) error { 701 f := make(map[string]interface{}) 702 if err := json.Unmarshal([]byte(s), &f); err != nil { 703 return err 704 } 705 delete(f, "GroupId") 706 delete(f, "PersonName") 707 delete(f, "PersonId") 708 delete(f, "Gender") 709 delete(f, "PersonExDescriptionInfos") 710 delete(f, "Image") 711 delete(f, "Url") 712 delete(f, "UniquePersonControl") 713 delete(f, "QualityControl") 714 delete(f, "NeedRotateDetection") 715 if len(f) > 0 { 716 return errors.New("CreatePersonRequest has unknown keys!") 717 } 718 return json.Unmarshal([]byte(s), &r) 719} 720 721type CreatePersonResponse struct { 722 *tchttp.BaseResponse 723 Response *struct { 724 725 // 人脸图片唯一标识。 726 FaceId *string `json:"FaceId,omitempty" name:"FaceId"` 727 728 // 检测出的人脸框的位置。 729 // 注意:此字段可能返回 null,表示取不到有效值。 730 FaceRect *FaceRect `json:"FaceRect,omitempty" name:"FaceRect"` 731 732 // 疑似同一人的PersonId。 733 // 当 UniquePersonControl 参数不为0且人员库中有疑似的同一人,此参数才有意义。 734 SimilarPersonId *string `json:"SimilarPersonId,omitempty" name:"SimilarPersonId"` 735 736 // 人脸识别所用的算法模型版本。 737 FaceModelVersion *string `json:"FaceModelVersion,omitempty" name:"FaceModelVersion"` 738 739 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 740 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 741 } `json:"Response"` 742} 743 744func (r *CreatePersonResponse) ToJsonString() string { 745 b, _ := json.Marshal(r) 746 return string(b) 747} 748 749// It is highly **NOT** recommended to use this function 750// because it has no param check, nor strict type check 751func (r *CreatePersonResponse) FromJsonString(s string) error { 752 return json.Unmarshal([]byte(s), &r) 753} 754 755type DeleteFaceRequest struct { 756 *tchttp.BaseRequest 757 758 // 人员ID 759 PersonId *string `json:"PersonId,omitempty" name:"PersonId"` 760 761 // 待删除的人脸ID列表 762 FaceIds []*string `json:"FaceIds,omitempty" name:"FaceIds" list` 763} 764 765func (r *DeleteFaceRequest) ToJsonString() string { 766 b, _ := json.Marshal(r) 767 return string(b) 768} 769 770// It is highly **NOT** recommended to use this function 771// because it has no param check, nor strict type check 772func (r *DeleteFaceRequest) FromJsonString(s string) error { 773 f := make(map[string]interface{}) 774 if err := json.Unmarshal([]byte(s), &f); err != nil { 775 return err 776 } 777 delete(f, "PersonId") 778 delete(f, "FaceIds") 779 if len(f) > 0 { 780 return errors.New("DeleteFaceRequest has unknown keys!") 781 } 782 return json.Unmarshal([]byte(s), &r) 783} 784 785type DeleteFaceResponse struct { 786 *tchttp.BaseResponse 787 Response *struct { 788 789 // 删除成功的人脸数量 790 SucDeletedNum *uint64 `json:"SucDeletedNum,omitempty" name:"SucDeletedNum"` 791 792 // 删除成功的人脸ID列表 793 SucFaceIds []*string `json:"SucFaceIds,omitempty" name:"SucFaceIds" list` 794 795 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 796 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 797 } `json:"Response"` 798} 799 800func (r *DeleteFaceResponse) ToJsonString() string { 801 b, _ := json.Marshal(r) 802 return string(b) 803} 804 805// It is highly **NOT** recommended to use this function 806// because it has no param check, nor strict type check 807func (r *DeleteFaceResponse) FromJsonString(s string) error { 808 return json.Unmarshal([]byte(s), &r) 809} 810 811type DeleteGroupRequest struct { 812 *tchttp.BaseRequest 813 814 // 人员库ID。 815 GroupId *string `json:"GroupId,omitempty" name:"GroupId"` 816} 817 818func (r *DeleteGroupRequest) ToJsonString() string { 819 b, _ := json.Marshal(r) 820 return string(b) 821} 822 823// It is highly **NOT** recommended to use this function 824// because it has no param check, nor strict type check 825func (r *DeleteGroupRequest) FromJsonString(s string) error { 826 f := make(map[string]interface{}) 827 if err := json.Unmarshal([]byte(s), &f); err != nil { 828 return err 829 } 830 delete(f, "GroupId") 831 if len(f) > 0 { 832 return errors.New("DeleteGroupRequest has unknown keys!") 833 } 834 return json.Unmarshal([]byte(s), &r) 835} 836 837type DeleteGroupResponse struct { 838 *tchttp.BaseResponse 839 Response *struct { 840 841 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 842 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 843 } `json:"Response"` 844} 845 846func (r *DeleteGroupResponse) ToJsonString() string { 847 b, _ := json.Marshal(r) 848 return string(b) 849} 850 851// It is highly **NOT** recommended to use this function 852// because it has no param check, nor strict type check 853func (r *DeleteGroupResponse) FromJsonString(s string) error { 854 return json.Unmarshal([]byte(s), &r) 855} 856 857type DeletePersonFromGroupRequest struct { 858 *tchttp.BaseRequest 859 860 // 人员ID 861 PersonId *string `json:"PersonId,omitempty" name:"PersonId"` 862 863 // 人员库ID 864 GroupId *string `json:"GroupId,omitempty" name:"GroupId"` 865} 866 867func (r *DeletePersonFromGroupRequest) ToJsonString() string { 868 b, _ := json.Marshal(r) 869 return string(b) 870} 871 872// It is highly **NOT** recommended to use this function 873// because it has no param check, nor strict type check 874func (r *DeletePersonFromGroupRequest) FromJsonString(s string) error { 875 f := make(map[string]interface{}) 876 if err := json.Unmarshal([]byte(s), &f); err != nil { 877 return err 878 } 879 delete(f, "PersonId") 880 delete(f, "GroupId") 881 if len(f) > 0 { 882 return errors.New("DeletePersonFromGroupRequest has unknown keys!") 883 } 884 return json.Unmarshal([]byte(s), &r) 885} 886 887type DeletePersonFromGroupResponse struct { 888 *tchttp.BaseResponse 889 Response *struct { 890 891 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 892 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 893 } `json:"Response"` 894} 895 896func (r *DeletePersonFromGroupResponse) ToJsonString() string { 897 b, _ := json.Marshal(r) 898 return string(b) 899} 900 901// It is highly **NOT** recommended to use this function 902// because it has no param check, nor strict type check 903func (r *DeletePersonFromGroupResponse) FromJsonString(s string) error { 904 return json.Unmarshal([]byte(s), &r) 905} 906 907type DeletePersonRequest struct { 908 *tchttp.BaseRequest 909 910 // 人员ID 911 PersonId *string `json:"PersonId,omitempty" name:"PersonId"` 912} 913 914func (r *DeletePersonRequest) ToJsonString() string { 915 b, _ := json.Marshal(r) 916 return string(b) 917} 918 919// It is highly **NOT** recommended to use this function 920// because it has no param check, nor strict type check 921func (r *DeletePersonRequest) FromJsonString(s string) error { 922 f := make(map[string]interface{}) 923 if err := json.Unmarshal([]byte(s), &f); err != nil { 924 return err 925 } 926 delete(f, "PersonId") 927 if len(f) > 0 { 928 return errors.New("DeletePersonRequest has unknown keys!") 929 } 930 return json.Unmarshal([]byte(s), &r) 931} 932 933type DeletePersonResponse struct { 934 *tchttp.BaseResponse 935 Response *struct { 936 937 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 938 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 939 } `json:"Response"` 940} 941 942func (r *DeletePersonResponse) ToJsonString() string { 943 b, _ := json.Marshal(r) 944 return string(b) 945} 946 947// It is highly **NOT** recommended to use this function 948// because it has no param check, nor strict type check 949func (r *DeletePersonResponse) FromJsonString(s string) error { 950 return json.Unmarshal([]byte(s), &r) 951} 952 953type DenseFaceShape struct { 954 955 // 人脸框左上角横坐标。 956 X *int64 `json:"X,omitempty" name:"X"` 957 958 // 人脸框左上角纵坐标。 959 Y *int64 `json:"Y,omitempty" name:"Y"` 960 961 // 人脸框宽度。 962 Width *int64 `json:"Width,omitempty" name:"Width"` 963 964 // 人脸框高度。 965 Height *int64 `json:"Height,omitempty" name:"Height"` 966 967 // 描述左侧眼睛轮廓的 XX 点。 968 LeftEye []*Point `json:"LeftEye,omitempty" name:"LeftEye" list` 969 970 // 描述右侧眼睛轮廓的 XX 点。 971 RightEye []*Point `json:"RightEye,omitempty" name:"RightEye" list` 972 973 // 描述左侧眉毛轮廓的 XX 点。 974 LeftEyeBrow []*Point `json:"LeftEyeBrow,omitempty" name:"LeftEyeBrow" list` 975 976 // 描述右侧眉毛轮廓的 XX 点。 977 RightEyeBrow []*Point `json:"RightEyeBrow,omitempty" name:"RightEyeBrow" list` 978 979 // 描述外嘴巴轮廓的 XX 点, 从左侧开始逆时针返回。 980 MouthOutside []*Point `json:"MouthOutside,omitempty" name:"MouthOutside" list` 981 982 // 描述内嘴巴轮廓的 XX 点,从左侧开始逆时针返回。 983 MouthInside []*Point `json:"MouthInside,omitempty" name:"MouthInside" list` 984 985 // 描述鼻子轮廓的 XX 点。 986 Nose []*Point `json:"Nose,omitempty" name:"Nose" list` 987 988 // 左瞳孔轮廓的 XX 个点。 989 LeftPupil []*Point `json:"LeftPupil,omitempty" name:"LeftPupil" list` 990 991 // 右瞳孔轮廓的 XX 个点。 992 RightPupil []*Point `json:"RightPupil,omitempty" name:"RightPupil" list` 993 994 // 中轴线轮廓的 XX 个点。 995 CentralAxis []*Point `json:"CentralAxis,omitempty" name:"CentralAxis" list` 996 997 // 下巴轮廓的 XX 个点。 998 Chin []*Point `json:"Chin,omitempty" name:"Chin" list` 999 1000 // 左眼袋的 XX 个点。 1001 LeftEyeBags []*Point `json:"LeftEyeBags,omitempty" name:"LeftEyeBags" list` 1002 1003 // 右眼袋的 XX 个点。 1004 RightEyeBags []*Point `json:"RightEyeBags,omitempty" name:"RightEyeBags" list` 1005 1006 // 额头的 XX 个点。 1007 Forehead []*Point `json:"Forehead,omitempty" name:"Forehead" list` 1008} 1009 1010type DetectFaceAttributesRequest struct { 1011 *tchttp.BaseRequest 1012 1013 // 最多处理的人脸数目。 1014 // 默认值为1(仅检测图片中面积最大的那张人脸),最大值为120。 1015 // 此参数用于控制处理待检测图片中的人脸个数,值越小,处理速度越快。 1016 MaxFaceNum *uint64 `json:"MaxFaceNum,omitempty" name:"MaxFaceNum"` 1017 1018 // 图片 base64 数据,base64 编码后大小不可超过5M。 1019 // jpg格式长边像素不可超过4000,其他格式图片长边像素不可超2000。 1020 // 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。 1021 Image *string `json:"Image,omitempty" name:"Image"` 1022 1023 // 图片的 Url 。 1024 // 对应图片 base64 编码后大小不可超过5M。 1025 // jpg格式长边像素不可超过4000,其他格式图片长边像素不可超2000。 1026 // Url、Image必须提供一个,如果都提供,只使用 Url。 1027 // 图片存储于腾讯云的Url可保障更高下载速度和稳定性,建议图片存储于腾讯云。 1028 // 非腾讯云存储的Url速度和稳定性可能受一定影响。 1029 // 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。 1030 Url *string `json:"Url,omitempty" name:"Url"` 1031 1032 // 是否返回年龄、性别、情绪等属性。 1033 // 合法值为(大小写不敏感):None、Age、Beauty、Emotion、Eye、Eyebrow 1034 // Gender、Hair、Hat、Headpose、Mask、Mouth、Moustache、Nose、Shape、Skin、Smile。 1035 // None为不需要返回。默认为 None。 1036 // 需要将属性组成一个用逗号分隔的字符串,属性之间的顺序没有要求。 1037 // 关于各属性的详细描述,参见下文出参。 1038 // 最多返回面积最大的 5 张人脸属性信息,超过 5 张人脸(第 6 张及以后的人脸)的 AttributesInfo 不具备参考意义。 1039 FaceAttributesType *string `json:"FaceAttributesType,omitempty" name:"FaceAttributesType"` 1040 1041 // 是否开启图片旋转识别支持。0为不开启,1为开启。默认为0。本参数的作用为,当图片中的人脸被旋转且图片没有exif信息时,如果不开启图片旋转识别支持则无法正确检测、识别图片中的人脸。若您确认图片包含exif信息或者您确认输入图中人脸不会出现被旋转情况,请不要开启本参数。开启后,整体耗时将可能增加数百毫秒。 1042 NeedRotateDetection *uint64 `json:"NeedRotateDetection,omitempty" name:"NeedRotateDetection"` 1043 1044 // 人脸识别服务所用的算法模型版本。本接口仅支持“3.0”输入 1045 FaceModelVersion *string `json:"FaceModelVersion,omitempty" name:"FaceModelVersion"` 1046} 1047 1048func (r *DetectFaceAttributesRequest) ToJsonString() string { 1049 b, _ := json.Marshal(r) 1050 return string(b) 1051} 1052 1053// It is highly **NOT** recommended to use this function 1054// because it has no param check, nor strict type check 1055func (r *DetectFaceAttributesRequest) FromJsonString(s string) error { 1056 f := make(map[string]interface{}) 1057 if err := json.Unmarshal([]byte(s), &f); err != nil { 1058 return err 1059 } 1060 delete(f, "MaxFaceNum") 1061 delete(f, "Image") 1062 delete(f, "Url") 1063 delete(f, "FaceAttributesType") 1064 delete(f, "NeedRotateDetection") 1065 delete(f, "FaceModelVersion") 1066 if len(f) > 0 { 1067 return errors.New("DetectFaceAttributesRequest has unknown keys!") 1068 } 1069 return json.Unmarshal([]byte(s), &r) 1070} 1071 1072type DetectFaceAttributesResponse struct { 1073 *tchttp.BaseResponse 1074 Response *struct { 1075 1076 // 请求的图片宽度。 1077 ImageWidth *uint64 `json:"ImageWidth,omitempty" name:"ImageWidth"` 1078 1079 // 请求的图片高度。 1080 ImageHeight *uint64 `json:"ImageHeight,omitempty" name:"ImageHeight"` 1081 1082 // 人脸信息列表。 1083 FaceDetailInfos []*FaceDetailInfo `json:"FaceDetailInfos,omitempty" name:"FaceDetailInfos" list` 1084 1085 // 人脸识别所用的算法模型版本。 1086 FaceModelVersion *string `json:"FaceModelVersion,omitempty" name:"FaceModelVersion"` 1087 1088 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 1089 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 1090 } `json:"Response"` 1091} 1092 1093func (r *DetectFaceAttributesResponse) ToJsonString() string { 1094 b, _ := json.Marshal(r) 1095 return string(b) 1096} 1097 1098// It is highly **NOT** recommended to use this function 1099// because it has no param check, nor strict type check 1100func (r *DetectFaceAttributesResponse) FromJsonString(s string) error { 1101 return json.Unmarshal([]byte(s), &r) 1102} 1103 1104type DetectFaceRequest struct { 1105 *tchttp.BaseRequest 1106 1107 // 最多处理的人脸数目。默认值为1(仅检测图片中面积最大的那张人脸),最大值为120。 1108 // 此参数用于控制处理待检测图片中的人脸个数,值越小,处理速度越快。 1109 MaxFaceNum *uint64 `json:"MaxFaceNum,omitempty" name:"MaxFaceNum"` 1110 1111 // 人脸长和宽的最小尺寸,单位为像素。 1112 // 默认为34。建议不低于34。 1113 // 低于MinFaceSize值的人脸不会被检测。 1114 MinFaceSize *uint64 `json:"MinFaceSize,omitempty" name:"MinFaceSize"` 1115 1116 // 图片 base64 数据,base64 编码后大小不可超过5M。 1117 // 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。 1118 Image *string `json:"Image,omitempty" name:"Image"` 1119 1120 // 图片的 Url 。对应图片 base64 编码后大小不可超过5M。 1121 // Url、Image必须提供一个,如果都提供,只使用 Url。 1122 // 图片存储于腾讯云的Url可保障更高下载速度和稳定性,建议图片存储于腾讯云。 1123 // 非腾讯云存储的Url速度和稳定性可能受一定影响。 1124 // 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。 1125 Url *string `json:"Url,omitempty" name:"Url"` 1126 1127 // 是否需要返回人脸属性信息(FaceAttributesInfo)。0 为不需要返回,1 为需要返回。默认为 0。 1128 // 非 1 值均视为不需要返回,此时 FaceAttributesInfo 不具备参考意义。 1129 // 最多返回面积最大的 5 张人脸属性信息,超过 5 张人脸(第 6 张及以后的人脸)的 FaceAttributesInfo 不具备参考意义。 1130 // 提取人脸属性信息较为耗时,如不需要人脸属性信息,建议关闭此项功能,加快人脸检测速度。 1131 NeedFaceAttributes *uint64 `json:"NeedFaceAttributes,omitempty" name:"NeedFaceAttributes"` 1132 1133 // 是否开启质量检测。0 为关闭,1 为开启。默认为 0。 1134 // 非 1 值均视为不进行质量检测。 1135 // 最多返回面积最大的 30 张人脸质量分信息,超过 30 张人脸(第 31 张及以后的人脸)的 FaceQualityInfo不具备参考意义。 1136 // 建议:人脸入库操作建议开启此功能。 1137 NeedQualityDetection *uint64 `json:"NeedQualityDetection,omitempty" name:"NeedQualityDetection"` 1138 1139 // 人脸识别服务所用的算法模型版本。目前入参支持 “2.0”和“3.0“ 两个输入。 1140 // 2020年4月2日开始,默认为“3.0”,之前使用过本接口的账号若未填写本参数默认为“2.0”。 1141 // 不同算法模型版本对应的人脸识别算法不同,新版本的整体效果会优于旧版本,建议使用“3.0”版本。 1142 FaceModelVersion *string `json:"FaceModelVersion,omitempty" name:"FaceModelVersion"` 1143 1144 // 是否开启图片旋转识别支持。0为不开启,1为开启。默认为0。本参数的作用为,当图片中的人脸被旋转且图片没有exif信息时,如果不开启图片旋转识别支持则无法正确检测、识别图片中的人脸。若您确认图片包含exif信息或者您确认输入图中人脸不会出现被旋转情况,请不要开启本参数。开启后,整体耗时将可能增加数百毫秒。 1145 NeedRotateDetection *uint64 `json:"NeedRotateDetection,omitempty" name:"NeedRotateDetection"` 1146} 1147 1148func (r *DetectFaceRequest) ToJsonString() string { 1149 b, _ := json.Marshal(r) 1150 return string(b) 1151} 1152 1153// It is highly **NOT** recommended to use this function 1154// because it has no param check, nor strict type check 1155func (r *DetectFaceRequest) FromJsonString(s string) error { 1156 f := make(map[string]interface{}) 1157 if err := json.Unmarshal([]byte(s), &f); err != nil { 1158 return err 1159 } 1160 delete(f, "MaxFaceNum") 1161 delete(f, "MinFaceSize") 1162 delete(f, "Image") 1163 delete(f, "Url") 1164 delete(f, "NeedFaceAttributes") 1165 delete(f, "NeedQualityDetection") 1166 delete(f, "FaceModelVersion") 1167 delete(f, "NeedRotateDetection") 1168 if len(f) > 0 { 1169 return errors.New("DetectFaceRequest has unknown keys!") 1170 } 1171 return json.Unmarshal([]byte(s), &r) 1172} 1173 1174type DetectFaceResponse struct { 1175 *tchttp.BaseResponse 1176 Response *struct { 1177 1178 // 请求的图片宽度。 1179 ImageWidth *int64 `json:"ImageWidth,omitempty" name:"ImageWidth"` 1180 1181 // 请求的图片高度。 1182 ImageHeight *int64 `json:"ImageHeight,omitempty" name:"ImageHeight"` 1183 1184 // 人脸信息列表。包含人脸坐标信息、属性信息(若需要)、质量分信息(若需要)。 1185 FaceInfos []*FaceInfo `json:"FaceInfos,omitempty" name:"FaceInfos" list` 1186 1187 // 人脸识别服务所用的算法模型版本。 1188 // 1189 // 目前入参支持 “2.0”和“3.0“ 两个输入。 1190 // 1191 // 2020年4月2日开始,默认为“3.0”,之前使用过本接口的账号若未填写本参数默认为“2.0”。 1192 // 1193 // 2020年11月26日后开通服务的账号仅支持输入“3.0”。 1194 // 1195 // 不同算法模型版本对应的人脸识别算法不同,新版本的整体效果会优于旧版本,建议使用“3.0”版本。 1196 FaceModelVersion *string `json:"FaceModelVersion,omitempty" name:"FaceModelVersion"` 1197 1198 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 1199 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 1200 } `json:"Response"` 1201} 1202 1203func (r *DetectFaceResponse) ToJsonString() string { 1204 b, _ := json.Marshal(r) 1205 return string(b) 1206} 1207 1208// It is highly **NOT** recommended to use this function 1209// because it has no param check, nor strict type check 1210func (r *DetectFaceResponse) FromJsonString(s string) error { 1211 return json.Unmarshal([]byte(s), &r) 1212} 1213 1214type DetectLiveFaceRequest struct { 1215 *tchttp.BaseRequest 1216 1217 // 图片 base64 数据,base64 编码后大小不可超过5M(图片的宽高比请接近3:4,不符合宽高比的图片返回的分值不具备参考意义)。 1218 // 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。 1219 Image *string `json:"Image,omitempty" name:"Image"` 1220 1221 // 图片的 Url 。对应图片 base64 编码后大小不可超过5M。 1222 // Url、Image必须提供一个,如果都提供,只使用 Url。 1223 // (图片的宽高比请接近 3:4,不符合宽高比的图片返回的分值不具备参考意义) 1224 // 图片存储于腾讯云的Url可保障更高下载速度和稳定性,建议图片存储于腾讯云。 1225 // 非腾讯云存储的Url速度和稳定性可能受一定影响。 1226 // 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。 1227 Url *string `json:"Url,omitempty" name:"Url"` 1228 1229 // 人脸识别服务所用的算法模型版本。 1230 // 1231 // 目前入参支持 “2.0”和“3.0“ 两个输入。 1232 // 1233 // 2020年4月2日开始,默认为“3.0”,之前使用过本接口的账号若未填写本参数默认为“2.0”。 1234 // 1235 // 2020年11月26日后开通服务的账号仅支持输入“3.0”。 1236 // 1237 // 不同算法模型版本对应的人脸识别算法不同,新版本的整体效果会优于旧版本,建议使用“3.0”版本。 1238 FaceModelVersion *string `json:"FaceModelVersion,omitempty" name:"FaceModelVersion"` 1239} 1240 1241func (r *DetectLiveFaceRequest) ToJsonString() string { 1242 b, _ := json.Marshal(r) 1243 return string(b) 1244} 1245 1246// It is highly **NOT** recommended to use this function 1247// because it has no param check, nor strict type check 1248func (r *DetectLiveFaceRequest) FromJsonString(s string) error { 1249 f := make(map[string]interface{}) 1250 if err := json.Unmarshal([]byte(s), &f); err != nil { 1251 return err 1252 } 1253 delete(f, "Image") 1254 delete(f, "Url") 1255 delete(f, "FaceModelVersion") 1256 if len(f) > 0 { 1257 return errors.New("DetectLiveFaceRequest has unknown keys!") 1258 } 1259 return json.Unmarshal([]byte(s), &r) 1260} 1261 1262type DetectLiveFaceResponse struct { 1263 *tchttp.BaseResponse 1264 Response *struct { 1265 1266 // 活体打分,取值范围 [0,100],分数一般落于[80, 100]区间内,0分也为常见值。推荐相大于 87 时可判断为活体。可根据具体场景自行调整阈值。 1267 // 本字段当且仅当FaceModelVersion为2.0时才具备参考意义。 1268 Score *float64 `json:"Score,omitempty" name:"Score"` 1269 1270 // 人脸识别所用的算法模型版本。 1271 FaceModelVersion *string `json:"FaceModelVersion,omitempty" name:"FaceModelVersion"` 1272 1273 // 活体检测是否通过。 1274 // 本字段只有FaceModelVersion为3.0时才具备参考意义。 1275 IsLiveness *bool `json:"IsLiveness,omitempty" name:"IsLiveness"` 1276 1277 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 1278 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 1279 } `json:"Response"` 1280} 1281 1282func (r *DetectLiveFaceResponse) ToJsonString() string { 1283 b, _ := json.Marshal(r) 1284 return string(b) 1285} 1286 1287// It is highly **NOT** recommended to use this function 1288// because it has no param check, nor strict type check 1289func (r *DetectLiveFaceResponse) FromJsonString(s string) error { 1290 return json.Unmarshal([]byte(s), &r) 1291} 1292 1293type EstimateCheckSimilarPersonCostTimeRequest struct { 1294 *tchttp.BaseRequest 1295 1296 // 待整理的人员库列表。 1297 // 人员库总人数不可超过200万,人员库个数不可超过10个。 1298 GroupIds []*string `json:"GroupIds,omitempty" name:"GroupIds" list` 1299} 1300 1301func (r *EstimateCheckSimilarPersonCostTimeRequest) ToJsonString() string { 1302 b, _ := json.Marshal(r) 1303 return string(b) 1304} 1305 1306// It is highly **NOT** recommended to use this function 1307// because it has no param check, nor strict type check 1308func (r *EstimateCheckSimilarPersonCostTimeRequest) FromJsonString(s string) error { 1309 f := make(map[string]interface{}) 1310 if err := json.Unmarshal([]byte(s), &f); err != nil { 1311 return err 1312 } 1313 delete(f, "GroupIds") 1314 if len(f) > 0 { 1315 return errors.New("EstimateCheckSimilarPersonCostTimeRequest has unknown keys!") 1316 } 1317 return json.Unmarshal([]byte(s), &r) 1318} 1319 1320type EstimateCheckSimilarPersonCostTimeResponse struct { 1321 *tchttp.BaseResponse 1322 Response *struct { 1323 1324 // 人员查重任务预估需要耗费时间。 单位为分钟。 1325 EstimatedTimeCost *uint64 `json:"EstimatedTimeCost,omitempty" name:"EstimatedTimeCost"` 1326 1327 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 1328 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 1329 } `json:"Response"` 1330} 1331 1332func (r *EstimateCheckSimilarPersonCostTimeResponse) ToJsonString() string { 1333 b, _ := json.Marshal(r) 1334 return string(b) 1335} 1336 1337// It is highly **NOT** recommended to use this function 1338// because it has no param check, nor strict type check 1339func (r *EstimateCheckSimilarPersonCostTimeResponse) FromJsonString(s string) error { 1340 return json.Unmarshal([]byte(s), &r) 1341} 1342 1343type Eye struct { 1344 1345 // 识别是否佩戴眼镜。 1346 // AttributeItem对应的Type为 —— 0:无眼镜,1:普通眼镜,2:墨镜 1347 Glass *AttributeItem `json:"Glass,omitempty" name:"Glass"` 1348 1349 // 识别眼睛的睁开、闭合状态。 1350 // AttributeItem对应的Type为 —— 0:睁开,1:闭眼 1351 EyeOpen *AttributeItem `json:"EyeOpen,omitempty" name:"EyeOpen"` 1352 1353 // 识别是否双眼皮。 1354 // AttributeItem对应的Type为 —— 0:无,1:有。 1355 EyelidType *AttributeItem `json:"EyelidType,omitempty" name:"EyelidType"` 1356 1357 // 眼睛大小。 1358 // AttributeItem对应的Type为 —— 0:小眼睛,1:普通眼睛,2:大眼睛。 1359 EyeSize *AttributeItem `json:"EyeSize,omitempty" name:"EyeSize"` 1360} 1361 1362type Eyebrow struct { 1363 1364 // 眉毛浓密。 1365 // AttributeItem对应的Type为 —— 0:淡眉,1:浓眉。 1366 EyebrowDensity *AttributeItem `json:"EyebrowDensity,omitempty" name:"EyebrowDensity"` 1367 1368 // 眉毛弯曲。 1369 // AttributeItem对应的Type为 —— 0:不弯,1:弯眉。 1370 EyebrowCurve *AttributeItem `json:"EyebrowCurve,omitempty" name:"EyebrowCurve"` 1371 1372 // 眉毛长短。 1373 // AttributeItem对应的Type为 —— 0:短眉毛,1:长眉毛。 1374 EyebrowLength *AttributeItem `json:"EyebrowLength,omitempty" name:"EyebrowLength"` 1375} 1376 1377type FaceAttributesInfo struct { 1378 1379 // 性别[0~49]为女性,[50,100]为男性,越接近0和100表示置信度越高。NeedFaceAttributes 不为 1 或检测超过 5 张人脸时,此参数仍返回,但不具备参考意义。 1380 Gender *int64 `json:"Gender,omitempty" name:"Gender"` 1381 1382 // 年龄 [0~100]。NeedFaceAttributes 不为1 或检测超过 5 张人脸时,此参数仍返回,但不具备参考意义。 1383 Age *int64 `json:"Age,omitempty" name:"Age"` 1384 1385 // 微笑[0(normal,正常)~50(smile,微笑)~100(laugh,大笑)]。NeedFaceAttributes 不为1 或检测超过 5 张人脸时,此参数仍返回,但不具备参考意义。 1386 Expression *int64 `json:"Expression,omitempty" name:"Expression"` 1387 1388 // 是否有眼镜 [true,false]。NeedFaceAttributes 不为1 或检测超过 5 张人脸时,此参数仍返回,但不具备参考意义。 1389 Glass *bool `json:"Glass,omitempty" name:"Glass"` 1390 1391 // 上下偏移[-30,30],单位角度。NeedFaceAttributes 不为1 或检测超过 5 张人脸时,此参数仍返回,但不具备参考意义。 1392 // 建议:人脸入库选择[-10,10]的图片。 1393 Pitch *int64 `json:"Pitch,omitempty" name:"Pitch"` 1394 1395 // 左右偏移[-30,30],单位角度。 NeedFaceAttributes 不为1 或检测超过 5 张人脸时,此参数仍返回,但不具备参考意义。 1396 // 建议:人脸入库选择[-10,10]的图片。 1397 Yaw *int64 `json:"Yaw,omitempty" name:"Yaw"` 1398 1399 // 平面旋转[-180,180],单位角度。 NeedFaceAttributes 不为1 或检测超过 5 张人脸时,此参数仍返回,但不具备参考意义。 1400 // 建议:人脸入库选择[-20,20]的图片。 1401 Roll *int64 `json:"Roll,omitempty" name:"Roll"` 1402 1403 // 魅力[0~100]。NeedFaceAttributes 不为1 或检测超过 5 张人脸时,此参数仍返回,但不具备参考意义。 1404 Beauty *int64 `json:"Beauty,omitempty" name:"Beauty"` 1405 1406 // 是否有帽子 [true,false]。NeedFaceAttributes 不为1 或检测超过 5 张人脸时,此参数仍返回,但不具备参考意义。 1407 // 注意:此字段可能返回 null,表示取不到有效值。 1408 Hat *bool `json:"Hat,omitempty" name:"Hat"` 1409 1410 // 是否有口罩 [true,false]。NeedFaceAttributes 不为1 或检测超过 5 张人脸时,此参数仍返回,但不具备参考意义。 1411 // 注意:此字段可能返回 null,表示取不到有效值。 1412 Mask *bool `json:"Mask,omitempty" name:"Mask"` 1413 1414 // 头发信息,包含头发长度(length)、有无刘海(bang)、头发颜色(color)。NeedFaceAttributes 不为1 或检测超过 5 张人脸时,此参数仍返回,但不具备参考意义。 1415 // 注意:此字段可能返回 null,表示取不到有效值。 1416 Hair *FaceHairAttributesInfo `json:"Hair,omitempty" name:"Hair"` 1417 1418 // 双眼是否睁开 [true,false]。只要有超过一只眼睛闭眼,就返回false。 NeedFaceAttributes 不为1 或检测超过 5 张人脸时,此参数仍返回,但不具备参考意义。 1419 // 注意:此字段可能返回 null,表示取不到有效值。 1420 EyeOpen *bool `json:"EyeOpen,omitempty" name:"EyeOpen"` 1421} 1422 1423type FaceDetailAttributesInfo struct { 1424 1425 // 年龄 [0,65],其中65代表“65岁及以上”。 1426 // FaceAttributesType 不为含Age 或检测超过 5 张人脸时,此参数仍返回,但不具备参考意义。 1427 Age *int64 `json:"Age,omitempty" name:"Age"` 1428 1429 // 美丑打分[0,100]。 1430 // FaceAttributesType 不含 Beauty 或检测超过 5 张人脸时,此参数仍返回,但不具备参考意义。 1431 Beauty *int64 `json:"Beauty,omitempty" name:"Beauty"` 1432 1433 // 情绪,可识别自然、高兴、惊讶、生气、悲伤、厌恶、害怕。 1434 // AttributeItem对应的Type为 —— 0:自然,1:高兴,2:惊讶,3:生气,4:悲伤,5:厌恶,6:害怕 1435 // FaceAttributesType 不含Emotion 或检测超过 5 张人脸时,此参数仍返回,但不具备参考意义。 1436 Emotion *AttributeItem `json:"Emotion,omitempty" name:"Emotion"` 1437 1438 // 眼睛相关信息,可识别是否戴眼镜、是否闭眼、是否双眼皮和眼睛大小。 1439 // FaceAttributesType 不含Eye 或检测超过 5 张人脸时,此参数仍返回,但不具备参考意义。 1440 Eye *Eye `json:"Eye,omitempty" name:"Eye"` 1441 1442 // 眉毛相关信息,可识别眉毛浓密、弯曲、长短信息。 1443 // FaceAttributesType 不含Eyebrow 或检测超过 5 张人脸时,此参数仍返回,但不具备参考意义。 1444 Eyebrow *Eyebrow `json:"Eyebrow,omitempty" name:"Eyebrow"` 1445 1446 // 性别信息。 1447 // AttributeItem对应的Type为 —— 0:男性,1:女性。 1448 // FaceAttributesType 不含Gender 或检测超过 5 张人脸时,此参数仍返回,但不具备参考意义。 1449 Gender *AttributeItem `json:"Gender,omitempty" name:"Gender"` 1450 1451 // 头发信息,包含头发长度、有无刘海、头发颜色。 1452 // FaceAttributesType 不含Hair 或检测超过 5 张人脸时,此参数仍返回,但不具备参考意义。 1453 Hair *Hair `json:"Hair,omitempty" name:"Hair"` 1454 1455 // 帽子信息,可识别是否佩戴帽子、帽子款式、帽子颜色。 1456 // FaceAttributesType 不含Hat 或检测超过 5 张人脸时,此参数仍返回,但不具备参考意义。 1457 Hat *Hat `json:"Hat,omitempty" name:"Hat"` 1458 1459 // 姿态信息,包含人脸的上下偏移、左右偏移、平面旋转信息。 1460 // FaceAttributesType 不含Headpose 或检测超过 5 张人脸时,此参数仍返回,但不具备参考意义。 1461 HeadPose *HeadPose `json:"HeadPose,omitempty" name:"HeadPose"` 1462 1463 // 口罩佩戴信息。 1464 // AttributeItem对应的Type为 —— 0: 无口罩, 1: 有口罩不遮脸,2: 有口罩遮下巴,3: 有口罩遮嘴,4: 正确佩戴口罩。 1465 // FaceAttributesType 不含Mask 或检测超过 5 张人脸时,此参数仍返回,但不具备参考意义。 1466 Mask *AttributeItem `json:"Mask,omitempty" name:"Mask"` 1467 1468 // 嘴巴信息,可识别是否张嘴、嘴唇厚度。 1469 // FaceAttributesType 不含 Mouth 或检测超过 5 张人脸时,此参数仍返回,但不具备参考意义。 1470 Mouth *Mouth `json:"Mouth,omitempty" name:"Mouth"` 1471 1472 // 胡子信息。 1473 // AttributeItem对应的Type为 —— 0:无胡子,1:有胡子。 1474 // FaceAttributesType 不含 Moustache 或检测超过 5 张人脸时,此参数仍返回,但不具备参考意义。 1475 Moustache *AttributeItem `json:"Moustache,omitempty" name:"Moustache"` 1476 1477 // 鼻子信息。 1478 // AttributeItem对应的Type为 —— 0:朝天鼻,1:鹰钩鼻,2:普通,3:圆鼻头 1479 // FaceAttributesType 不含 Nose 或检测超过 5 张人脸时,此参数仍返回,但不具备参考意义。 1480 Nose *AttributeItem `json:"Nose,omitempty" name:"Nose"` 1481 1482 // 脸型信息。 1483 // AttributeItem对应的Type为 —— 0:方脸,1:三角脸,2:鹅蛋脸,3:心形脸,4:圆脸。 1484 // FaceAttributesType 不含 Shape 或检测超过 5 张人脸时,此参数仍返回,但不具备参考意义。 1485 Shape *AttributeItem `json:"Shape,omitempty" name:"Shape"` 1486 1487 // 肤色信息。 1488 // AttributeItem对应的Type为 —— 0:黄色皮肤,1:棕色皮肤,2:黑色皮肤,3:白色皮肤。 1489 // FaceAttributesType 不含 Skin 或检测超过 5 张人脸时,此参数仍返回,但不具备参考意义。 1490 Skin *AttributeItem `json:"Skin,omitempty" name:"Skin"` 1491 1492 // 微笑程度,[0,100]。 1493 // FaceAttributesType 不含 Smile 或检测超过 5 张人脸时,此参数仍返回,但不具备参考意义。 1494 Smile *int64 `json:"Smile,omitempty" name:"Smile"` 1495} 1496 1497type FaceDetailInfo struct { 1498 1499 // 检测出的人脸框位置。 1500 FaceRect *FaceRect `json:"FaceRect,omitempty" name:"FaceRect"` 1501 1502 // 人脸属性信息,根据 FaceAttributesType 输入的类型,返回年龄(Age)、颜值(Beauty) 1503 // 情绪(Emotion)、眼睛信息(Eye)、眉毛(Eyebrow)、性别(Gender) 1504 // 头发(Hair)、帽子(Hat)、姿态(Headpose)、口罩(Mask)、嘴巴(Mouse)、胡子(Moustache) 1505 // 鼻子(Nose)、脸型(Shape)、肤色(Skin)、微笑(Smile)等人脸属性信息。 1506 // 若 FaceAttributesType 没有输入相关类型,则FaceDetaiAttributesInfo返回的细项不具备参考意义。 1507 FaceDetailAttributesInfo *FaceDetailAttributesInfo `json:"FaceDetailAttributesInfo,omitempty" name:"FaceDetailAttributesInfo"` 1508} 1509 1510type FaceHairAttributesInfo struct { 1511 1512 // 0:光头,1:短发,2:中发,3:长发,4:绑发 1513 // 注意:此字段可能返回 null,表示取不到有效值。 1514 Length *int64 `json:"Length,omitempty" name:"Length"` 1515 1516 // 0:有刘海,1:无刘海 1517 // 注意:此字段可能返回 null,表示取不到有效值。 1518 Bang *int64 `json:"Bang,omitempty" name:"Bang"` 1519 1520 // 0:黑色,1:金色,2:棕色,3:灰白色 1521 // 注意:此字段可能返回 null,表示取不到有效值。 1522 Color *int64 `json:"Color,omitempty" name:"Color"` 1523} 1524 1525type FaceInfo struct { 1526 1527 // 人脸框左上角横坐标。 1528 // 人脸框包含人脸五官位置并在此基础上进行一定的扩展,若人脸框超出图片范围,会导致坐标负值。 1529 // 若需截取完整人脸,可以在完整分completess满足需求的情况下,将负值坐标取0。 1530 X *int64 `json:"X,omitempty" name:"X"` 1531 1532 // 人脸框左上角纵坐标。 1533 // 人脸框包含人脸五官位置并在此基础上进行一定的扩展,若人脸框超出图片范围,会导致坐标负值。 1534 // 若需截取完整人脸,可以在完整分completess满足需求的情况下,将负值坐标取0。 1535 Y *int64 `json:"Y,omitempty" name:"Y"` 1536 1537 // 人脸框宽度。 1538 Width *int64 `json:"Width,omitempty" name:"Width"` 1539 1540 // 人脸框高度。 1541 Height *int64 `json:"Height,omitempty" name:"Height"` 1542 1543 // 人脸属性信息,包含性别( gender )、年龄( age )、表情( expression )、 1544 // 魅力( beauty )、眼镜( glass )、口罩(mask)、头发(hair)和姿态 (pitch,roll,yaw )。只有当 NeedFaceAttributes 设为 1 时才返回有效信息。 1545 FaceAttributesInfo *FaceAttributesInfo `json:"FaceAttributesInfo,omitempty" name:"FaceAttributesInfo"` 1546 1547 // 人脸质量信息,包含质量分(score)、模糊分(sharpness)、光照分(brightness)、遮挡分(completeness)。只有当NeedFaceDetection设为1时才返回有效信息。 1548 // 注意:此字段可能返回 null,表示取不到有效值。 1549 FaceQualityInfo *FaceQualityInfo `json:"FaceQualityInfo,omitempty" name:"FaceQualityInfo"` 1550} 1551 1552type FaceQualityCompleteness struct { 1553 1554 // 眉毛的遮挡分数[0,100],分数越高遮挡越少。 1555 // 参考范围:[0,80]表示发生遮挡。 1556 // 注意:此字段可能返回 null,表示取不到有效值。 1557 Eyebrow *int64 `json:"Eyebrow,omitempty" name:"Eyebrow"` 1558 1559 // 眼睛的遮挡分数[0,100],分数越高遮挡越少。 1560 // 参考范围:[0,80]表示发生遮挡。 1561 // 注意:此字段可能返回 null,表示取不到有效值。 1562 Eye *int64 `json:"Eye,omitempty" name:"Eye"` 1563 1564 // 鼻子的遮挡分数[0,100],分数越高遮挡越少。 1565 // 参考范围:[0,60]表示发生遮挡。 1566 // 注意:此字段可能返回 null,表示取不到有效值。 1567 Nose *int64 `json:"Nose,omitempty" name:"Nose"` 1568 1569 // 脸颊的遮挡分数[0,100],分数越高遮挡越少。 1570 // 参考范围:[0,70]表示发生遮挡。 1571 // 注意:此字段可能返回 null,表示取不到有效值。 1572 Cheek *int64 `json:"Cheek,omitempty" name:"Cheek"` 1573 1574 // 嘴巴的遮挡分数[0,100],分数越高遮挡越少。 1575 // 参考范围:[0,50]表示发生遮挡。 1576 // 注意:此字段可能返回 null,表示取不到有效值。 1577 Mouth *int64 `json:"Mouth,omitempty" name:"Mouth"` 1578 1579 // 下巴的遮挡分数[0,100],分数越高遮挡越少。 1580 // 参考范围:[0,70]表示发生遮挡。 1581 // 注意:此字段可能返回 null,表示取不到有效值。 1582 Chin *int64 `json:"Chin,omitempty" name:"Chin"` 1583} 1584 1585type FaceQualityInfo struct { 1586 1587 // 质量分: [0,100],综合评价图像质量是否适合人脸识别,分数越高质量越好。 1588 // 正常情况,只需要使用Score作为质量分总体的判断标准即可。Sharpness、Brightness、Completeness等细项分仅供参考。 1589 // 参考范围:[0,40]较差,[40,60] 一般,[60,80]较好,[80,100]很好。 1590 // 建议:人脸入库选取70以上的图片。 1591 // 注意:此字段可能返回 null,表示取不到有效值。 1592 Score *int64 `json:"Score,omitempty" name:"Score"` 1593 1594 // 清晰分:[0,100],评价图片清晰程度,分数越高越清晰。 1595 // 参考范围:[0,40]特别模糊,[40,60]模糊,[60,80]一般,[80,100]清晰。 1596 // 建议:人脸入库选取80以上的图片。 1597 // 注意:此字段可能返回 null,表示取不到有效值。 1598 Sharpness *int64 `json:"Sharpness,omitempty" name:"Sharpness"` 1599 1600 // 光照分:[0,100],评价图片光照程度,分数越高越亮。 1601 // 参考范围: [0,30]偏暗,[30,70]光照正常,[70,100]偏亮。 1602 // 建议:人脸入库选取[30,70]的图片。 1603 // 注意:此字段可能返回 null,表示取不到有效值。 1604 Brightness *int64 `json:"Brightness,omitempty" name:"Brightness"` 1605 1606 // 五官遮挡分,评价眉毛(Eyebrow)、眼睛(Eye)、鼻子(Nose)、脸颊(Cheek)、嘴巴(Mouth)、下巴(Chin)的被遮挡程度。 1607 // 注意:此字段可能返回 null,表示取不到有效值。 1608 Completeness *FaceQualityCompleteness `json:"Completeness,omitempty" name:"Completeness"` 1609} 1610 1611type FaceRect struct { 1612 1613 // 人脸框左上角横坐标。 1614 // 人脸框包含人脸五官位置并在此基础上进行一定的扩展,若人脸框超出图片范围,会导致坐标负值。 1615 // 若需截取完整人脸,可以在完整分completess满足需求的情况下,将负值坐标取0。 1616 X *int64 `json:"X,omitempty" name:"X"` 1617 1618 // 人脸框左上角纵坐标。 1619 // 人脸框包含人脸五官位置并在此基础上进行一定的扩展,若人脸框超出图片范围,会导致坐标负值。 1620 // 若需截取完整人脸,可以在完整分completess满足需求的情况下,将负值坐标取0。 1621 Y *int64 `json:"Y,omitempty" name:"Y"` 1622 1623 // 人脸宽度 1624 Width *uint64 `json:"Width,omitempty" name:"Width"` 1625 1626 // 人脸高度 1627 Height *uint64 `json:"Height,omitempty" name:"Height"` 1628} 1629 1630type FaceShape struct { 1631 1632 // 描述脸型轮廓的 21 点。 1633 FaceProfile []*Point `json:"FaceProfile,omitempty" name:"FaceProfile" list` 1634 1635 // 描述左侧眼睛轮廓的 8 点。 1636 LeftEye []*Point `json:"LeftEye,omitempty" name:"LeftEye" list` 1637 1638 // 描述右侧眼睛轮廓的 8 点。 1639 RightEye []*Point `json:"RightEye,omitempty" name:"RightEye" list` 1640 1641 // 描述左侧眉毛轮廓的 8 点。 1642 LeftEyeBrow []*Point `json:"LeftEyeBrow,omitempty" name:"LeftEyeBrow" list` 1643 1644 // 描述右侧眉毛轮廓的 8 点。 1645 RightEyeBrow []*Point `json:"RightEyeBrow,omitempty" name:"RightEyeBrow" list` 1646 1647 // 描述嘴巴轮廓的 22 点。 1648 Mouth []*Point `json:"Mouth,omitempty" name:"Mouth" list` 1649 1650 // 描述鼻子轮廓的 13 点。 1651 Nose []*Point `json:"Nose,omitempty" name:"Nose" list` 1652 1653 // 左瞳孔轮廓的 1 个点。 1654 LeftPupil []*Point `json:"LeftPupil,omitempty" name:"LeftPupil" list` 1655 1656 // 右瞳孔轮廓的 1 个点。 1657 RightPupil []*Point `json:"RightPupil,omitempty" name:"RightPupil" list` 1658} 1659 1660type GetCheckSimilarPersonJobIdListRequest struct { 1661 *tchttp.BaseRequest 1662 1663 // 起始序号,默认值为0。 1664 Offset *uint64 `json:"Offset,omitempty" name:"Offset"` 1665 1666 // 返回数量,默认值为10,最大值为1000。 1667 Limit *uint64 `json:"Limit,omitempty" name:"Limit"` 1668} 1669 1670func (r *GetCheckSimilarPersonJobIdListRequest) ToJsonString() string { 1671 b, _ := json.Marshal(r) 1672 return string(b) 1673} 1674 1675// It is highly **NOT** recommended to use this function 1676// because it has no param check, nor strict type check 1677func (r *GetCheckSimilarPersonJobIdListRequest) FromJsonString(s string) error { 1678 f := make(map[string]interface{}) 1679 if err := json.Unmarshal([]byte(s), &f); err != nil { 1680 return err 1681 } 1682 delete(f, "Offset") 1683 delete(f, "Limit") 1684 if len(f) > 0 { 1685 return errors.New("GetCheckSimilarPersonJobIdListRequest has unknown keys!") 1686 } 1687 return json.Unmarshal([]byte(s), &r) 1688} 1689 1690type GetCheckSimilarPersonJobIdListResponse struct { 1691 *tchttp.BaseResponse 1692 Response *struct { 1693 1694 // 人员查重任务信息列表。 1695 JobIdInfos []*JobIdInfo `json:"JobIdInfos,omitempty" name:"JobIdInfos" list` 1696 1697 // 查重任务总数量。 1698 JobIdNum *uint64 `json:"JobIdNum,omitempty" name:"JobIdNum"` 1699 1700 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 1701 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 1702 } `json:"Response"` 1703} 1704 1705func (r *GetCheckSimilarPersonJobIdListResponse) ToJsonString() string { 1706 b, _ := json.Marshal(r) 1707 return string(b) 1708} 1709 1710// It is highly **NOT** recommended to use this function 1711// because it has no param check, nor strict type check 1712func (r *GetCheckSimilarPersonJobIdListResponse) FromJsonString(s string) error { 1713 return json.Unmarshal([]byte(s), &r) 1714} 1715 1716type GetGroupInfoRequest struct { 1717 *tchttp.BaseRequest 1718 1719 // 人员库 ID。 1720 GroupId *string `json:"GroupId,omitempty" name:"GroupId"` 1721} 1722 1723func (r *GetGroupInfoRequest) ToJsonString() string { 1724 b, _ := json.Marshal(r) 1725 return string(b) 1726} 1727 1728// It is highly **NOT** recommended to use this function 1729// because it has no param check, nor strict type check 1730func (r *GetGroupInfoRequest) FromJsonString(s string) error { 1731 f := make(map[string]interface{}) 1732 if err := json.Unmarshal([]byte(s), &f); err != nil { 1733 return err 1734 } 1735 delete(f, "GroupId") 1736 if len(f) > 0 { 1737 return errors.New("GetGroupInfoRequest has unknown keys!") 1738 } 1739 return json.Unmarshal([]byte(s), &r) 1740} 1741 1742type GetGroupInfoResponse struct { 1743 *tchttp.BaseResponse 1744 Response *struct { 1745 1746 // 人员库名称 1747 GroupName *string `json:"GroupName,omitempty" name:"GroupName"` 1748 1749 // 人员库ID 1750 GroupId *string `json:"GroupId,omitempty" name:"GroupId"` 1751 1752 // 人员库自定义描述字段 1753 GroupExDescriptions []*string `json:"GroupExDescriptions,omitempty" name:"GroupExDescriptions" list` 1754 1755 // 人员库信息备注 1756 Tag *string `json:"Tag,omitempty" name:"Tag"` 1757 1758 // 人脸识别所用的算法模型版本。 1759 FaceModelVersion *string `json:"FaceModelVersion,omitempty" name:"FaceModelVersion"` 1760 1761 // Group的创建时间和日期 CreationTimestamp。CreationTimestamp 的值是自 Unix 纪元时间到Group创建时间的毫秒数。 1762 CreationTimestamp *uint64 `json:"CreationTimestamp,omitempty" name:"CreationTimestamp"` 1763 1764 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 1765 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 1766 } `json:"Response"` 1767} 1768 1769func (r *GetGroupInfoResponse) ToJsonString() string { 1770 b, _ := json.Marshal(r) 1771 return string(b) 1772} 1773 1774// It is highly **NOT** recommended to use this function 1775// because it has no param check, nor strict type check 1776func (r *GetGroupInfoResponse) FromJsonString(s string) error { 1777 return json.Unmarshal([]byte(s), &r) 1778} 1779 1780type GetGroupListRequest struct { 1781 *tchttp.BaseRequest 1782 1783 // 起始序号,默认值为0 1784 Offset *uint64 `json:"Offset,omitempty" name:"Offset"` 1785 1786 // 返回数量,默认值为10,最大值为1000 1787 Limit *uint64 `json:"Limit,omitempty" name:"Limit"` 1788} 1789 1790func (r *GetGroupListRequest) ToJsonString() string { 1791 b, _ := json.Marshal(r) 1792 return string(b) 1793} 1794 1795// It is highly **NOT** recommended to use this function 1796// because it has no param check, nor strict type check 1797func (r *GetGroupListRequest) FromJsonString(s string) error { 1798 f := make(map[string]interface{}) 1799 if err := json.Unmarshal([]byte(s), &f); err != nil { 1800 return err 1801 } 1802 delete(f, "Offset") 1803 delete(f, "Limit") 1804 if len(f) > 0 { 1805 return errors.New("GetGroupListRequest has unknown keys!") 1806 } 1807 return json.Unmarshal([]byte(s), &r) 1808} 1809 1810type GetGroupListResponse struct { 1811 *tchttp.BaseResponse 1812 Response *struct { 1813 1814 // 返回的人员库信息 1815 GroupInfos []*GroupInfo `json:"GroupInfos,omitempty" name:"GroupInfos" list` 1816 1817 // 人员库总数量 1818 // 注意:此字段可能返回 null,表示取不到有效值。 1819 GroupNum *uint64 `json:"GroupNum,omitempty" name:"GroupNum"` 1820 1821 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 1822 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 1823 } `json:"Response"` 1824} 1825 1826func (r *GetGroupListResponse) ToJsonString() string { 1827 b, _ := json.Marshal(r) 1828 return string(b) 1829} 1830 1831// It is highly **NOT** recommended to use this function 1832// because it has no param check, nor strict type check 1833func (r *GetGroupListResponse) FromJsonString(s string) error { 1834 return json.Unmarshal([]byte(s), &r) 1835} 1836 1837type GetPersonBaseInfoRequest struct { 1838 *tchttp.BaseRequest 1839 1840 // 人员ID 1841 PersonId *string `json:"PersonId,omitempty" name:"PersonId"` 1842} 1843 1844func (r *GetPersonBaseInfoRequest) ToJsonString() string { 1845 b, _ := json.Marshal(r) 1846 return string(b) 1847} 1848 1849// It is highly **NOT** recommended to use this function 1850// because it has no param check, nor strict type check 1851func (r *GetPersonBaseInfoRequest) FromJsonString(s string) error { 1852 f := make(map[string]interface{}) 1853 if err := json.Unmarshal([]byte(s), &f); err != nil { 1854 return err 1855 } 1856 delete(f, "PersonId") 1857 if len(f) > 0 { 1858 return errors.New("GetPersonBaseInfoRequest has unknown keys!") 1859 } 1860 return json.Unmarshal([]byte(s), &r) 1861} 1862 1863type GetPersonBaseInfoResponse struct { 1864 *tchttp.BaseResponse 1865 Response *struct { 1866 1867 // 人员名称 1868 PersonName *string `json:"PersonName,omitempty" name:"PersonName"` 1869 1870 // 人员性别 1871 Gender *int64 `json:"Gender,omitempty" name:"Gender"` 1872 1873 // 包含的人脸 ID 列表 1874 FaceIds []*string `json:"FaceIds,omitempty" name:"FaceIds" list` 1875 1876 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 1877 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 1878 } `json:"Response"` 1879} 1880 1881func (r *GetPersonBaseInfoResponse) ToJsonString() string { 1882 b, _ := json.Marshal(r) 1883 return string(b) 1884} 1885 1886// It is highly **NOT** recommended to use this function 1887// because it has no param check, nor strict type check 1888func (r *GetPersonBaseInfoResponse) FromJsonString(s string) error { 1889 return json.Unmarshal([]byte(s), &r) 1890} 1891 1892type GetPersonGroupInfoRequest struct { 1893 *tchttp.BaseRequest 1894 1895 // 人员ID 1896 PersonId *string `json:"PersonId,omitempty" name:"PersonId"` 1897 1898 // 起始序号,默认值为0 1899 Offset *uint64 `json:"Offset,omitempty" name:"Offset"` 1900 1901 // 返回数量,默认值为10,最大值为100 1902 Limit *uint64 `json:"Limit,omitempty" name:"Limit"` 1903} 1904 1905func (r *GetPersonGroupInfoRequest) ToJsonString() string { 1906 b, _ := json.Marshal(r) 1907 return string(b) 1908} 1909 1910// It is highly **NOT** recommended to use this function 1911// because it has no param check, nor strict type check 1912func (r *GetPersonGroupInfoRequest) FromJsonString(s string) error { 1913 f := make(map[string]interface{}) 1914 if err := json.Unmarshal([]byte(s), &f); err != nil { 1915 return err 1916 } 1917 delete(f, "PersonId") 1918 delete(f, "Offset") 1919 delete(f, "Limit") 1920 if len(f) > 0 { 1921 return errors.New("GetPersonGroupInfoRequest has unknown keys!") 1922 } 1923 return json.Unmarshal([]byte(s), &r) 1924} 1925 1926type GetPersonGroupInfoResponse struct { 1927 *tchttp.BaseResponse 1928 Response *struct { 1929 1930 // 包含此人员的人员库及描述字段内容列表 1931 PersonGroupInfos []*PersonGroupInfo `json:"PersonGroupInfos,omitempty" name:"PersonGroupInfos" list` 1932 1933 // 人员库总数量 1934 // 注意:此字段可能返回 null,表示取不到有效值。 1935 GroupNum *uint64 `json:"GroupNum,omitempty" name:"GroupNum"` 1936 1937 // 人脸识别服务所用的算法模型版本。 1938 // 注意:此字段可能返回 null,表示取不到有效值。 1939 FaceModelVersion *string `json:"FaceModelVersion,omitempty" name:"FaceModelVersion"` 1940 1941 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 1942 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 1943 } `json:"Response"` 1944} 1945 1946func (r *GetPersonGroupInfoResponse) ToJsonString() string { 1947 b, _ := json.Marshal(r) 1948 return string(b) 1949} 1950 1951// It is highly **NOT** recommended to use this function 1952// because it has no param check, nor strict type check 1953func (r *GetPersonGroupInfoResponse) FromJsonString(s string) error { 1954 return json.Unmarshal([]byte(s), &r) 1955} 1956 1957type GetPersonListNumRequest struct { 1958 *tchttp.BaseRequest 1959 1960 // 人员库ID 1961 GroupId *string `json:"GroupId,omitempty" name:"GroupId"` 1962} 1963 1964func (r *GetPersonListNumRequest) ToJsonString() string { 1965 b, _ := json.Marshal(r) 1966 return string(b) 1967} 1968 1969// It is highly **NOT** recommended to use this function 1970// because it has no param check, nor strict type check 1971func (r *GetPersonListNumRequest) FromJsonString(s string) error { 1972 f := make(map[string]interface{}) 1973 if err := json.Unmarshal([]byte(s), &f); err != nil { 1974 return err 1975 } 1976 delete(f, "GroupId") 1977 if len(f) > 0 { 1978 return errors.New("GetPersonListNumRequest has unknown keys!") 1979 } 1980 return json.Unmarshal([]byte(s), &r) 1981} 1982 1983type GetPersonListNumResponse struct { 1984 *tchttp.BaseResponse 1985 Response *struct { 1986 1987 // 人员数量 1988 PersonNum *uint64 `json:"PersonNum,omitempty" name:"PersonNum"` 1989 1990 // 人脸数量 1991 FaceNum *uint64 `json:"FaceNum,omitempty" name:"FaceNum"` 1992 1993 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 1994 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 1995 } `json:"Response"` 1996} 1997 1998func (r *GetPersonListNumResponse) ToJsonString() string { 1999 b, _ := json.Marshal(r) 2000 return string(b) 2001} 2002 2003// It is highly **NOT** recommended to use this function 2004// because it has no param check, nor strict type check 2005func (r *GetPersonListNumResponse) FromJsonString(s string) error { 2006 return json.Unmarshal([]byte(s), &r) 2007} 2008 2009type GetPersonListRequest struct { 2010 *tchttp.BaseRequest 2011 2012 // 人员库ID 2013 GroupId *string `json:"GroupId,omitempty" name:"GroupId"` 2014 2015 // 起始序号,默认值为0 2016 Offset *uint64 `json:"Offset,omitempty" name:"Offset"` 2017 2018 // 返回数量,默认值为10,最大值为1000 2019 Limit *uint64 `json:"Limit,omitempty" name:"Limit"` 2020} 2021 2022func (r *GetPersonListRequest) ToJsonString() string { 2023 b, _ := json.Marshal(r) 2024 return string(b) 2025} 2026 2027// It is highly **NOT** recommended to use this function 2028// because it has no param check, nor strict type check 2029func (r *GetPersonListRequest) FromJsonString(s string) error { 2030 f := make(map[string]interface{}) 2031 if err := json.Unmarshal([]byte(s), &f); err != nil { 2032 return err 2033 } 2034 delete(f, "GroupId") 2035 delete(f, "Offset") 2036 delete(f, "Limit") 2037 if len(f) > 0 { 2038 return errors.New("GetPersonListRequest has unknown keys!") 2039 } 2040 return json.Unmarshal([]byte(s), &r) 2041} 2042 2043type GetPersonListResponse struct { 2044 *tchttp.BaseResponse 2045 Response *struct { 2046 2047 // 返回的人员信息 2048 PersonInfos []*PersonInfo `json:"PersonInfos,omitempty" name:"PersonInfos" list` 2049 2050 // 该人员库的人员数量 2051 // 注意:此字段可能返回 null,表示取不到有效值。 2052 PersonNum *uint64 `json:"PersonNum,omitempty" name:"PersonNum"` 2053 2054 // 该人员库的人脸数量 2055 // 注意:此字段可能返回 null,表示取不到有效值。 2056 FaceNum *uint64 `json:"FaceNum,omitempty" name:"FaceNum"` 2057 2058 // 人脸识别所用的算法模型版本。 2059 // 注意:此字段可能返回 null,表示取不到有效值。 2060 FaceModelVersion *string `json:"FaceModelVersion,omitempty" name:"FaceModelVersion"` 2061 2062 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 2063 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 2064 } `json:"Response"` 2065} 2066 2067func (r *GetPersonListResponse) ToJsonString() string { 2068 b, _ := json.Marshal(r) 2069 return string(b) 2070} 2071 2072// It is highly **NOT** recommended to use this function 2073// because it has no param check, nor strict type check 2074func (r *GetPersonListResponse) FromJsonString(s string) error { 2075 return json.Unmarshal([]byte(s), &r) 2076} 2077 2078type GetSimilarPersonResultRequest struct { 2079 *tchttp.BaseRequest 2080 2081 // 查重任务ID,用于查询、获取查重的进度和结果。 2082 JobId *string `json:"JobId,omitempty" name:"JobId"` 2083} 2084 2085func (r *GetSimilarPersonResultRequest) ToJsonString() string { 2086 b, _ := json.Marshal(r) 2087 return string(b) 2088} 2089 2090// It is highly **NOT** recommended to use this function 2091// because it has no param check, nor strict type check 2092func (r *GetSimilarPersonResultRequest) FromJsonString(s string) error { 2093 f := make(map[string]interface{}) 2094 if err := json.Unmarshal([]byte(s), &f); err != nil { 2095 return err 2096 } 2097 delete(f, "JobId") 2098 if len(f) > 0 { 2099 return errors.New("GetSimilarPersonResultRequest has unknown keys!") 2100 } 2101 return json.Unmarshal([]byte(s), &r) 2102} 2103 2104type GetSimilarPersonResultResponse struct { 2105 *tchttp.BaseResponse 2106 Response *struct { 2107 2108 // 查重任务完成进度。取值[0.0,100.0]。当且仅当值为100时,SimilarPersons才有意义。 2109 Progress *float64 `json:"Progress,omitempty" name:"Progress"` 2110 2111 // 疑似同一人的人员信息文件临时下载链接, 有效时间为5分钟,结果文件实际保存90天。 2112 // 文件内容由 SimilarPerson 的数组组成。 2113 SimilarPersonsUrl *string `json:"SimilarPersonsUrl,omitempty" name:"SimilarPersonsUrl"` 2114 2115 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 2116 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 2117 } `json:"Response"` 2118} 2119 2120func (r *GetSimilarPersonResultResponse) ToJsonString() string { 2121 b, _ := json.Marshal(r) 2122 return string(b) 2123} 2124 2125// It is highly **NOT** recommended to use this function 2126// because it has no param check, nor strict type check 2127func (r *GetSimilarPersonResultResponse) FromJsonString(s string) error { 2128 return json.Unmarshal([]byte(s), &r) 2129} 2130 2131type GetUpgradeGroupFaceModelVersionJobListRequest struct { 2132 *tchttp.BaseRequest 2133 2134 // 起始序号,默认值为0。 2135 Offset *uint64 `json:"Offset,omitempty" name:"Offset"` 2136 2137 // 返回数量,默认值为10,最大值为1000。 2138 Limit *uint64 `json:"Limit,omitempty" name:"Limit"` 2139} 2140 2141func (r *GetUpgradeGroupFaceModelVersionJobListRequest) ToJsonString() string { 2142 b, _ := json.Marshal(r) 2143 return string(b) 2144} 2145 2146// It is highly **NOT** recommended to use this function 2147// because it has no param check, nor strict type check 2148func (r *GetUpgradeGroupFaceModelVersionJobListRequest) FromJsonString(s string) error { 2149 f := make(map[string]interface{}) 2150 if err := json.Unmarshal([]byte(s), &f); err != nil { 2151 return err 2152 } 2153 delete(f, "Offset") 2154 delete(f, "Limit") 2155 if len(f) > 0 { 2156 return errors.New("GetUpgradeGroupFaceModelVersionJobListRequest has unknown keys!") 2157 } 2158 return json.Unmarshal([]byte(s), &r) 2159} 2160 2161type GetUpgradeGroupFaceModelVersionJobListResponse struct { 2162 *tchttp.BaseResponse 2163 Response *struct { 2164 2165 // 人员库升级任务信息列表。 2166 JobInfos []*UpgradeJobInfo `json:"JobInfos,omitempty" name:"JobInfos" list` 2167 2168 // 升级任务总数量。 2169 JobNum *uint64 `json:"JobNum,omitempty" name:"JobNum"` 2170 2171 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 2172 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 2173 } `json:"Response"` 2174} 2175 2176func (r *GetUpgradeGroupFaceModelVersionJobListResponse) ToJsonString() string { 2177 b, _ := json.Marshal(r) 2178 return string(b) 2179} 2180 2181// It is highly **NOT** recommended to use this function 2182// because it has no param check, nor strict type check 2183func (r *GetUpgradeGroupFaceModelVersionJobListResponse) FromJsonString(s string) error { 2184 return json.Unmarshal([]byte(s), &r) 2185} 2186 2187type GetUpgradeGroupFaceModelVersionResultRequest struct { 2188 *tchttp.BaseRequest 2189 2190 // 升级任务ID,用于查询、获取人员库升级的进度和结果。 2191 JobId *string `json:"JobId,omitempty" name:"JobId"` 2192} 2193 2194func (r *GetUpgradeGroupFaceModelVersionResultRequest) ToJsonString() string { 2195 b, _ := json.Marshal(r) 2196 return string(b) 2197} 2198 2199// It is highly **NOT** recommended to use this function 2200// because it has no param check, nor strict type check 2201func (r *GetUpgradeGroupFaceModelVersionResultRequest) FromJsonString(s string) error { 2202 f := make(map[string]interface{}) 2203 if err := json.Unmarshal([]byte(s), &f); err != nil { 2204 return err 2205 } 2206 delete(f, "JobId") 2207 if len(f) > 0 { 2208 return errors.New("GetUpgradeGroupFaceModelVersionResultRequest has unknown keys!") 2209 } 2210 return json.Unmarshal([]byte(s), &r) 2211} 2212 2213type GetUpgradeGroupFaceModelVersionResultResponse struct { 2214 *tchttp.BaseResponse 2215 Response *struct { 2216 2217 // 人员升级任务预估结束时间。 StartTimestamp的值是自 Unix 纪元时间到人员查重任务预估结束的毫秒数。 2218 // Unix 纪元时间是 1970 年 1 月 1 日星期四,协调世界时 (UTC) 00:00:00。 2219 // 如果为0表示这个任务已经执行完毕。 2220 EndTimestamp *uint64 `json:"EndTimestamp,omitempty" name:"EndTimestamp"` 2221 2222 // 升级任务完成进度。取值[0.0,100.0]。 2223 Progress *float64 `json:"Progress,omitempty" name:"Progress"` 2224 2225 // 0表示升级中,1表示升级完毕,2表示回滚完毕。 2226 Status *int64 `json:"Status,omitempty" name:"Status"` 2227 2228 // 升级起始时间。 2229 // StartTime的值是自 Unix 纪元时间到Group创建时间的毫秒数。 2230 // Unix 纪元时间是 1970 年 1 月 1 日星期四,协调世界时 (UTC) 00:00:00。 2231 // 有关更多信息,请参阅 Unix 时间。 2232 StartTime *uint64 `json:"StartTime,omitempty" name:"StartTime"` 2233 2234 // 当前算法模型版本。 2235 FromFaceModelVersion *string `json:"FromFaceModelVersion,omitempty" name:"FromFaceModelVersion"` 2236 2237 // 目标算法模型版本。 2238 ToFaceModelVersion *string `json:"ToFaceModelVersion,omitempty" name:"ToFaceModelVersion"` 2239 2240 // 人员库ID。 2241 GroupId *string `json:"GroupId,omitempty" name:"GroupId"` 2242 2243 // 无法升级的人脸Id信息,文件格式 2244 FailedFacesUrl *string `json:"FailedFacesUrl,omitempty" name:"FailedFacesUrl"` 2245 2246 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 2247 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 2248 } `json:"Response"` 2249} 2250 2251func (r *GetUpgradeGroupFaceModelVersionResultResponse) ToJsonString() string { 2252 b, _ := json.Marshal(r) 2253 return string(b) 2254} 2255 2256// It is highly **NOT** recommended to use this function 2257// because it has no param check, nor strict type check 2258func (r *GetUpgradeGroupFaceModelVersionResultResponse) FromJsonString(s string) error { 2259 return json.Unmarshal([]byte(s), &r) 2260} 2261 2262type GroupCandidate struct { 2263 2264 // 人员库ID 。 2265 GroupId *string `json:"GroupId,omitempty" name:"GroupId"` 2266 2267 // 识别出的最相似候选人。 2268 Candidates []*Candidate `json:"Candidates,omitempty" name:"Candidates" list` 2269} 2270 2271type GroupExDescriptionInfo struct { 2272 2273 // 人员库自定义描述字段Index,从0开始 2274 // 注意:此字段可能返回 null,表示取不到有效值。 2275 GroupExDescriptionIndex *uint64 `json:"GroupExDescriptionIndex,omitempty" name:"GroupExDescriptionIndex"` 2276 2277 // 需要更新的人员库自定义描述字段内容 2278 GroupExDescription *string `json:"GroupExDescription,omitempty" name:"GroupExDescription"` 2279} 2280 2281type GroupInfo struct { 2282 2283 // 人员库名称 2284 GroupName *string `json:"GroupName,omitempty" name:"GroupName"` 2285 2286 // 人员库ID 2287 GroupId *string `json:"GroupId,omitempty" name:"GroupId"` 2288 2289 // 人员库自定义描述字段 2290 // 注意:此字段可能返回 null,表示取不到有效值。 2291 GroupExDescriptions []*string `json:"GroupExDescriptions,omitempty" name:"GroupExDescriptions" list` 2292 2293 // 人员库信息备注 2294 // 注意:此字段可能返回 null,表示取不到有效值。 2295 Tag *string `json:"Tag,omitempty" name:"Tag"` 2296 2297 // 人脸识别所用的算法模型版本。 2298 // 注意:此字段可能返回 null,表示取不到有效值。 2299 FaceModelVersion *string `json:"FaceModelVersion,omitempty" name:"FaceModelVersion"` 2300 2301 // Group的创建时间和日期 CreationTimestamp。CreationTimestamp 的值是自 Unix 纪元时间到Group创建时间的毫秒数。 2302 // Unix 纪元时间是 1970 年 1 月 1 日星期四,协调世界时 (UTC) 00:00:00。有关更多信息,请参阅 Unix 时间。 2303 // 注意:此字段可能返回 null,表示取不到有效值。 2304 CreationTimestamp *uint64 `json:"CreationTimestamp,omitempty" name:"CreationTimestamp"` 2305} 2306 2307type Hair struct { 2308 2309 // 头发长度信息。 2310 // AttributeItem对应的Type为 —— 0:光头,1:短发,2:中发,3:长发,4:绑发。 2311 Length *AttributeItem `json:"Length,omitempty" name:"Length"` 2312 2313 // 刘海信息。 2314 // AttributeItem对应的Type为 —— 0:无刘海,1:有刘海。 2315 Bang *AttributeItem `json:"Bang,omitempty" name:"Bang"` 2316 2317 // 头发颜色信息。 2318 // AttributeItem对应的Type为 —— 0:黑色,1:金色,2:棕色,3:灰白色。 2319 Color *AttributeItem `json:"Color,omitempty" name:"Color"` 2320} 2321 2322type Hat struct { 2323 2324 // 帽子佩戴状态信息。 2325 // AttributeItem对应的Type为 —— 0:不戴帽子,1:普通帽子,2:头盔,3:保安帽。 2326 Style *AttributeItem `json:"Style,omitempty" name:"Style"` 2327 2328 // 帽子颜色。 2329 // AttributeItem对应的Type为 —— 0:不戴帽子,1:红色系,2:黄色系,3:蓝色系,4:黑色系,5:灰白色系,6:混色系子。 2330 Color *AttributeItem `json:"Color,omitempty" name:"Color"` 2331} 2332 2333type HeadPose struct { 2334 2335 // 上下偏移[-30,30]。 2336 Pitch *int64 `json:"Pitch,omitempty" name:"Pitch"` 2337 2338 // 左右偏移[-30,30]。 2339 Yaw *int64 `json:"Yaw,omitempty" name:"Yaw"` 2340 2341 // 平面旋转[-180,180]。 2342 Roll *int64 `json:"Roll,omitempty" name:"Roll"` 2343} 2344 2345type JobIdInfo struct { 2346 2347 // 查重任务ID,用于查询、获取查重的进度和结果。 2348 JobId *string `json:"JobId,omitempty" name:"JobId"` 2349 2350 // 查重起始时间。 2351 // StartTime的值是自 Unix 纪元时间到Group创建时间的毫秒数。 2352 // Unix 纪元时间是 1970 年 1 月 1 日星期四,协调世界时 (UTC) 00:00:00。 2353 // 有关更多信息,请参阅 Unix 时间。 2354 StartTime *uint64 `json:"StartTime,omitempty" name:"StartTime"` 2355 2356 // 查重任务是否已完成。0: 成功 1: 未完成 2: 失败 2357 JobStatus *int64 `json:"JobStatus,omitempty" name:"JobStatus"` 2358} 2359 2360type ModifyGroupRequest struct { 2361 *tchttp.BaseRequest 2362 2363 // 人员库ID 2364 GroupId *string `json:"GroupId,omitempty" name:"GroupId"` 2365 2366 // 人员库名称 2367 GroupName *string `json:"GroupName,omitempty" name:"GroupName"` 2368 2369 // 需要修改的人员库自定义描述字段,key-value 2370 GroupExDescriptionInfos []*GroupExDescriptionInfo `json:"GroupExDescriptionInfos,omitempty" name:"GroupExDescriptionInfos" list` 2371 2372 // 人员库信息备注 2373 Tag *string `json:"Tag,omitempty" name:"Tag"` 2374} 2375 2376func (r *ModifyGroupRequest) ToJsonString() string { 2377 b, _ := json.Marshal(r) 2378 return string(b) 2379} 2380 2381// It is highly **NOT** recommended to use this function 2382// because it has no param check, nor strict type check 2383func (r *ModifyGroupRequest) FromJsonString(s string) error { 2384 f := make(map[string]interface{}) 2385 if err := json.Unmarshal([]byte(s), &f); err != nil { 2386 return err 2387 } 2388 delete(f, "GroupId") 2389 delete(f, "GroupName") 2390 delete(f, "GroupExDescriptionInfos") 2391 delete(f, "Tag") 2392 if len(f) > 0 { 2393 return errors.New("ModifyGroupRequest has unknown keys!") 2394 } 2395 return json.Unmarshal([]byte(s), &r) 2396} 2397 2398type ModifyGroupResponse struct { 2399 *tchttp.BaseResponse 2400 Response *struct { 2401 2402 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 2403 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 2404 } `json:"Response"` 2405} 2406 2407func (r *ModifyGroupResponse) ToJsonString() string { 2408 b, _ := json.Marshal(r) 2409 return string(b) 2410} 2411 2412// It is highly **NOT** recommended to use this function 2413// because it has no param check, nor strict type check 2414func (r *ModifyGroupResponse) FromJsonString(s string) error { 2415 return json.Unmarshal([]byte(s), &r) 2416} 2417 2418type ModifyPersonBaseInfoRequest struct { 2419 *tchttp.BaseRequest 2420 2421 // 人员ID 2422 PersonId *string `json:"PersonId,omitempty" name:"PersonId"` 2423 2424 // 需要修改的人员名称 2425 PersonName *string `json:"PersonName,omitempty" name:"PersonName"` 2426 2427 // 需要修改的人员性别 2428 Gender *int64 `json:"Gender,omitempty" name:"Gender"` 2429} 2430 2431func (r *ModifyPersonBaseInfoRequest) ToJsonString() string { 2432 b, _ := json.Marshal(r) 2433 return string(b) 2434} 2435 2436// It is highly **NOT** recommended to use this function 2437// because it has no param check, nor strict type check 2438func (r *ModifyPersonBaseInfoRequest) FromJsonString(s string) error { 2439 f := make(map[string]interface{}) 2440 if err := json.Unmarshal([]byte(s), &f); err != nil { 2441 return err 2442 } 2443 delete(f, "PersonId") 2444 delete(f, "PersonName") 2445 delete(f, "Gender") 2446 if len(f) > 0 { 2447 return errors.New("ModifyPersonBaseInfoRequest has unknown keys!") 2448 } 2449 return json.Unmarshal([]byte(s), &r) 2450} 2451 2452type ModifyPersonBaseInfoResponse struct { 2453 *tchttp.BaseResponse 2454 Response *struct { 2455 2456 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 2457 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 2458 } `json:"Response"` 2459} 2460 2461func (r *ModifyPersonBaseInfoResponse) ToJsonString() string { 2462 b, _ := json.Marshal(r) 2463 return string(b) 2464} 2465 2466// It is highly **NOT** recommended to use this function 2467// because it has no param check, nor strict type check 2468func (r *ModifyPersonBaseInfoResponse) FromJsonString(s string) error { 2469 return json.Unmarshal([]byte(s), &r) 2470} 2471 2472type ModifyPersonGroupInfoRequest struct { 2473 *tchttp.BaseRequest 2474 2475 // 人员库ID 2476 GroupId *string `json:"GroupId,omitempty" name:"GroupId"` 2477 2478 // 人员ID 2479 PersonId *string `json:"PersonId,omitempty" name:"PersonId"` 2480 2481 // 需要修改的人员描述字段内容,key-value 2482 PersonExDescriptionInfos []*PersonExDescriptionInfo `json:"PersonExDescriptionInfos,omitempty" name:"PersonExDescriptionInfos" list` 2483} 2484 2485func (r *ModifyPersonGroupInfoRequest) ToJsonString() string { 2486 b, _ := json.Marshal(r) 2487 return string(b) 2488} 2489 2490// It is highly **NOT** recommended to use this function 2491// because it has no param check, nor strict type check 2492func (r *ModifyPersonGroupInfoRequest) FromJsonString(s string) error { 2493 f := make(map[string]interface{}) 2494 if err := json.Unmarshal([]byte(s), &f); err != nil { 2495 return err 2496 } 2497 delete(f, "GroupId") 2498 delete(f, "PersonId") 2499 delete(f, "PersonExDescriptionInfos") 2500 if len(f) > 0 { 2501 return errors.New("ModifyPersonGroupInfoRequest has unknown keys!") 2502 } 2503 return json.Unmarshal([]byte(s), &r) 2504} 2505 2506type ModifyPersonGroupInfoResponse struct { 2507 *tchttp.BaseResponse 2508 Response *struct { 2509 2510 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 2511 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 2512 } `json:"Response"` 2513} 2514 2515func (r *ModifyPersonGroupInfoResponse) ToJsonString() string { 2516 b, _ := json.Marshal(r) 2517 return string(b) 2518} 2519 2520// It is highly **NOT** recommended to use this function 2521// because it has no param check, nor strict type check 2522func (r *ModifyPersonGroupInfoResponse) FromJsonString(s string) error { 2523 return json.Unmarshal([]byte(s), &r) 2524} 2525 2526type Mouth struct { 2527 2528 // 是否张嘴信息。 2529 // AttributeItem对应的Type为 —— 0:不张嘴,1:张嘴。 2530 MouthOpen *AttributeItem `json:"MouthOpen,omitempty" name:"MouthOpen"` 2531} 2532 2533type PersonExDescriptionInfo struct { 2534 2535 // 人员描述字段Index,从0开始 2536 // 注意:此字段可能返回 null,表示取不到有效值。 2537 PersonExDescriptionIndex *uint64 `json:"PersonExDescriptionIndex,omitempty" name:"PersonExDescriptionIndex"` 2538 2539 // 需要更新的人员描述字段内容 2540 PersonExDescription *string `json:"PersonExDescription,omitempty" name:"PersonExDescription"` 2541} 2542 2543type PersonGroupInfo struct { 2544 2545 // 包含此人员的人员库ID 2546 GroupId *string `json:"GroupId,omitempty" name:"GroupId"` 2547 2548 // 人员描述字段内容 2549 PersonExDescriptions []*string `json:"PersonExDescriptions,omitempty" name:"PersonExDescriptions" list` 2550} 2551 2552type PersonInfo struct { 2553 2554 // 人员名称 2555 PersonName *string `json:"PersonName,omitempty" name:"PersonName"` 2556 2557 // 人员Id 2558 PersonId *string `json:"PersonId,omitempty" name:"PersonId"` 2559 2560 // 人员性别 2561 Gender *int64 `json:"Gender,omitempty" name:"Gender"` 2562 2563 // 人员描述字段内容 2564 PersonExDescriptions []*string `json:"PersonExDescriptions,omitempty" name:"PersonExDescriptions" list` 2565 2566 // 包含的人脸照片列表 2567 FaceIds []*string `json:"FaceIds,omitempty" name:"FaceIds" list` 2568 2569 // 人员的创建时间和日期 CreationTimestamp。CreationTimestamp 的值是自 Unix 纪元时间到Group创建时间的毫秒数。 2570 // Unix 纪元时间是 1970 年 1 月 1 日星期四,协调世界时 (UTC) 00:00:00。有关更多信息,请参阅 Unix 时间。 2571 CreationTimestamp *uint64 `json:"CreationTimestamp,omitempty" name:"CreationTimestamp"` 2572} 2573 2574type Point struct { 2575 2576 // x坐标 2577 X *int64 `json:"X,omitempty" name:"X"` 2578 2579 // Y坐标 2580 Y *int64 `json:"Y,omitempty" name:"Y"` 2581} 2582 2583type Result struct { 2584 2585 // 识别出的最相似候选人 2586 Candidates []*Candidate `json:"Candidates,omitempty" name:"Candidates" list` 2587 2588 // 检测出的人脸框位置 2589 FaceRect *FaceRect `json:"FaceRect,omitempty" name:"FaceRect"` 2590 2591 // 检测出的人脸图片状态返回码。0 表示正常。 2592 // -1601代表不符合图片质量控制要求,此时Candidate内容为空。 2593 RetCode *int64 `json:"RetCode,omitempty" name:"RetCode"` 2594} 2595 2596type ResultsReturnsByGroup struct { 2597 2598 // 检测出的人脸框位置。 2599 FaceRect *FaceRect `json:"FaceRect,omitempty" name:"FaceRect"` 2600 2601 // 识别结果。 2602 GroupCandidates []*GroupCandidate `json:"GroupCandidates,omitempty" name:"GroupCandidates" list` 2603 2604 // 检测出的人脸图片状态返回码。0 表示正常。 2605 // -1601代表不符合图片质量控制要求,此时Candidate内容为空。 2606 RetCode *int64 `json:"RetCode,omitempty" name:"RetCode"` 2607} 2608 2609type RevertGroupFaceModelVersionRequest struct { 2610 *tchttp.BaseRequest 2611 2612 // 需要回滚的升级任务ID。 2613 JobId *string `json:"JobId,omitempty" name:"JobId"` 2614} 2615 2616func (r *RevertGroupFaceModelVersionRequest) ToJsonString() string { 2617 b, _ := json.Marshal(r) 2618 return string(b) 2619} 2620 2621// It is highly **NOT** recommended to use this function 2622// because it has no param check, nor strict type check 2623func (r *RevertGroupFaceModelVersionRequest) FromJsonString(s string) error { 2624 f := make(map[string]interface{}) 2625 if err := json.Unmarshal([]byte(s), &f); err != nil { 2626 return err 2627 } 2628 delete(f, "JobId") 2629 if len(f) > 0 { 2630 return errors.New("RevertGroupFaceModelVersionRequest has unknown keys!") 2631 } 2632 return json.Unmarshal([]byte(s), &r) 2633} 2634 2635type RevertGroupFaceModelVersionResponse struct { 2636 *tchttp.BaseResponse 2637 Response *struct { 2638 2639 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 2640 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 2641 } `json:"Response"` 2642} 2643 2644func (r *RevertGroupFaceModelVersionResponse) ToJsonString() string { 2645 b, _ := json.Marshal(r) 2646 return string(b) 2647} 2648 2649// It is highly **NOT** recommended to use this function 2650// because it has no param check, nor strict type check 2651func (r *RevertGroupFaceModelVersionResponse) FromJsonString(s string) error { 2652 return json.Unmarshal([]byte(s), &r) 2653} 2654 2655type SearchFacesRequest struct { 2656 *tchttp.BaseRequest 2657 2658 // 希望搜索的人员库列表,上限100个。 2659 GroupIds []*string `json:"GroupIds,omitempty" name:"GroupIds" list` 2660 2661 // 图片 base64 数据,base64 编码后大小不可超过5M。 2662 // 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。 2663 Image *string `json:"Image,omitempty" name:"Image"` 2664 2665 // 图片的 Url 。对应图片 base64 编码后大小不可超过5M。 2666 // Url、Image必须提供一个,如果都提供,只使用 Url。 2667 // 图片存储于腾讯云的Url可保障更高下载速度和稳定性,建议图片存储于腾讯云。 2668 // 非腾讯云存储的Url速度和稳定性可能受一定影响。 2669 // 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。 2670 Url *string `json:"Url,omitempty" name:"Url"` 2671 2672 // 最多识别的人脸数目。默认值为1(仅检测图片中面积最大的那张人脸),最大值为10。 2673 // MaxFaceNum用于,当输入的待识别图片包含多张人脸时,设定要搜索的人脸的数量。 2674 // 例:输入的Image或Url中的图片包含多张人脸,设MaxFaceNum=5,则会识别图片中面积最大的5张人脸。 2675 MaxFaceNum *uint64 `json:"MaxFaceNum,omitempty" name:"MaxFaceNum"` 2676 2677 // 人脸长和宽的最小尺寸,单位为像素。默认为34。低于34的人脸图片无法被识别。建议设置为80。 2678 MinFaceSize *uint64 `json:"MinFaceSize,omitempty" name:"MinFaceSize"` 2679 2680 // 单张被识别的人脸返回的最相似人员数量。默认值为5,最大值为100。 2681 // 例,设MaxFaceNum为1,MaxPersonNum为8,则返回Top8相似的人员信息。 2682 // 值越大,需要处理的时间越长。建议不要超过10。 2683 MaxPersonNum *uint64 `json:"MaxPersonNum,omitempty" name:"MaxPersonNum"` 2684 2685 // 是否返回人员具体信息。0 为关闭,1 为开启。默认为 0。其他非0非1值默认为0 2686 NeedPersonInfo *int64 `json:"NeedPersonInfo,omitempty" name:"NeedPersonInfo"` 2687 2688 // 图片质量控制。 2689 // 0: 不进行控制; 2690 // 1:较低的质量要求,图像存在非常模糊,眼睛鼻子嘴巴遮挡至少其中一种或多种的情况; 2691 // 2: 一般的质量要求,图像存在偏亮,偏暗,模糊或一般模糊,眉毛遮挡,脸颊遮挡,下巴遮挡,至少其中三种的情况; 2692 // 3: 较高的质量要求,图像存在偏亮,偏暗,一般模糊,眉毛遮挡,脸颊遮挡,下巴遮挡,其中一到两种的情况; 2693 // 4: 很高的质量要求,各个维度均为最好或最多在某一维度上存在轻微问题; 2694 // 默认 0。 2695 // 若图片质量不满足要求,则返回结果中会提示图片质量检测不符要求。 2696 QualityControl *uint64 `json:"QualityControl,omitempty" name:"QualityControl"` 2697 2698 // 出参Score中,只有超过FaceMatchThreshold值的结果才会返回。默认为0。 2699 FaceMatchThreshold *float64 `json:"FaceMatchThreshold,omitempty" name:"FaceMatchThreshold"` 2700 2701 // 是否开启图片旋转识别支持。0为不开启,1为开启。默认为0。本参数的作用为,当图片中的人脸被旋转且图片没有exif信息时,如果不开启图片旋转识别支持则无法正确检测、识别图片中的人脸。若您确认图片包含exif信息或者您确认输入图中人脸不会出现被旋转情况,请不要开启本参数。开启后,整体耗时将可能增加数百毫秒。 2702 NeedRotateDetection *uint64 `json:"NeedRotateDetection,omitempty" name:"NeedRotateDetection"` 2703} 2704 2705func (r *SearchFacesRequest) ToJsonString() string { 2706 b, _ := json.Marshal(r) 2707 return string(b) 2708} 2709 2710// It is highly **NOT** recommended to use this function 2711// because it has no param check, nor strict type check 2712func (r *SearchFacesRequest) FromJsonString(s string) error { 2713 f := make(map[string]interface{}) 2714 if err := json.Unmarshal([]byte(s), &f); err != nil { 2715 return err 2716 } 2717 delete(f, "GroupIds") 2718 delete(f, "Image") 2719 delete(f, "Url") 2720 delete(f, "MaxFaceNum") 2721 delete(f, "MinFaceSize") 2722 delete(f, "MaxPersonNum") 2723 delete(f, "NeedPersonInfo") 2724 delete(f, "QualityControl") 2725 delete(f, "FaceMatchThreshold") 2726 delete(f, "NeedRotateDetection") 2727 if len(f) > 0 { 2728 return errors.New("SearchFacesRequest has unknown keys!") 2729 } 2730 return json.Unmarshal([]byte(s), &r) 2731} 2732 2733type SearchFacesResponse struct { 2734 *tchttp.BaseResponse 2735 Response *struct { 2736 2737 // 识别结果。 2738 Results []*Result `json:"Results,omitempty" name:"Results" list` 2739 2740 // 搜索的人员库中包含的人脸数。 2741 FaceNum *uint64 `json:"FaceNum,omitempty" name:"FaceNum"` 2742 2743 // 人脸识别所用的算法模型版本。 2744 FaceModelVersion *string `json:"FaceModelVersion,omitempty" name:"FaceModelVersion"` 2745 2746 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 2747 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 2748 } `json:"Response"` 2749} 2750 2751func (r *SearchFacesResponse) ToJsonString() string { 2752 b, _ := json.Marshal(r) 2753 return string(b) 2754} 2755 2756// It is highly **NOT** recommended to use this function 2757// because it has no param check, nor strict type check 2758func (r *SearchFacesResponse) FromJsonString(s string) error { 2759 return json.Unmarshal([]byte(s), &r) 2760} 2761 2762type SearchFacesReturnsByGroupRequest struct { 2763 *tchttp.BaseRequest 2764 2765 // 希望搜索的人员库列表,上限60个。 2766 GroupIds []*string `json:"GroupIds,omitempty" name:"GroupIds" list` 2767 2768 // 图片 base64 数据,base64 编码后大小不可超过5M。 2769 // 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。 2770 Image *string `json:"Image,omitempty" name:"Image"` 2771 2772 // 图片的 Url 。对应图片 base64 编码后大小不可超过5M。 2773 // Url、Image必须提供一个,如果都提供,只使用 Url。 2774 // 图片存储于腾讯云的Url可保障更高下载速度和稳定性,建议图片存储于腾讯云。 2775 // 非腾讯云存储的Url速度和稳定性可能受一定影响。 2776 // 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。 2777 Url *string `json:"Url,omitempty" name:"Url"` 2778 2779 // 最多识别的人脸数目。默认值为1(仅检测图片中面积最大的那张人脸),最大值为10。 2780 // MaxFaceNum用于,当输入的待识别图片包含多张人脸时,设定要搜索的人脸的数量。 2781 // 例:输入的Image或Url中的图片包含多张人脸,设MaxFaceNum=5,则会识别图片中面积最大的5张人脸。 2782 MaxFaceNum *uint64 `json:"MaxFaceNum,omitempty" name:"MaxFaceNum"` 2783 2784 // 人脸长和宽的最小尺寸,单位为像素。默认为34。低于34将影响搜索精度。建议设置为80。 2785 MinFaceSize *uint64 `json:"MinFaceSize,omitempty" name:"MinFaceSize"` 2786 2787 // 被检测到的人脸,对应最多返回的最相似人员数目。默认值为5,最大值为10。 2788 // 例,设MaxFaceNum为3,MaxPersonNum为5,则最多可能返回3*5=15个人员。 2789 MaxPersonNumPerGroup *uint64 `json:"MaxPersonNumPerGroup,omitempty" name:"MaxPersonNumPerGroup"` 2790 2791 // 是否返回人员具体信息。0 为关闭,1 为开启。默认为 0。其他非0非1值默认为0 2792 NeedPersonInfo *int64 `json:"NeedPersonInfo,omitempty" name:"NeedPersonInfo"` 2793 2794 // 图片质量控制。 2795 // 0: 不进行控制; 2796 // 1:较低的质量要求,图像存在非常模糊,眼睛鼻子嘴巴遮挡至少其中一种或多种的情况; 2797 // 2: 一般的质量要求,图像存在偏亮,偏暗,模糊或一般模糊,眉毛遮挡,脸颊遮挡,下巴遮挡,至少其中三种的情况; 2798 // 3: 较高的质量要求,图像存在偏亮,偏暗,一般模糊,眉毛遮挡,脸颊遮挡,下巴遮挡,其中一到两种的情况; 2799 // 4: 很高的质量要求,各个维度均为最好或最多在某一维度上存在轻微问题; 2800 // 默认 0。 2801 // 若图片质量不满足要求,则返回结果中会提示图片质量检测不符要求。 2802 QualityControl *uint64 `json:"QualityControl,omitempty" name:"QualityControl"` 2803 2804 // 出参Score中,只有大于等于FaceMatchThreshold值的结果才会返回。 2805 // 默认为0。 2806 // 取值范围[0.0,100.0) 。 2807 FaceMatchThreshold *float64 `json:"FaceMatchThreshold,omitempty" name:"FaceMatchThreshold"` 2808 2809 // 是否开启图片旋转识别支持。0为不开启,1为开启。默认为0。本参数的作用为,当图片中的人脸被旋转且图片没有exif信息时,如果不开启图片旋转识别支持则无法正确检测、识别图片中的人脸。若您确认图片包含exif信息或者您确认输入图中人脸不会出现被旋转情况,请不要开启本参数。开启后,整体耗时将可能增加数百毫秒。 2810 NeedRotateDetection *uint64 `json:"NeedRotateDetection,omitempty" name:"NeedRotateDetection"` 2811} 2812 2813func (r *SearchFacesReturnsByGroupRequest) ToJsonString() string { 2814 b, _ := json.Marshal(r) 2815 return string(b) 2816} 2817 2818// It is highly **NOT** recommended to use this function 2819// because it has no param check, nor strict type check 2820func (r *SearchFacesReturnsByGroupRequest) FromJsonString(s string) error { 2821 f := make(map[string]interface{}) 2822 if err := json.Unmarshal([]byte(s), &f); err != nil { 2823 return err 2824 } 2825 delete(f, "GroupIds") 2826 delete(f, "Image") 2827 delete(f, "Url") 2828 delete(f, "MaxFaceNum") 2829 delete(f, "MinFaceSize") 2830 delete(f, "MaxPersonNumPerGroup") 2831 delete(f, "NeedPersonInfo") 2832 delete(f, "QualityControl") 2833 delete(f, "FaceMatchThreshold") 2834 delete(f, "NeedRotateDetection") 2835 if len(f) > 0 { 2836 return errors.New("SearchFacesReturnsByGroupRequest has unknown keys!") 2837 } 2838 return json.Unmarshal([]byte(s), &r) 2839} 2840 2841type SearchFacesReturnsByGroupResponse struct { 2842 *tchttp.BaseResponse 2843 Response *struct { 2844 2845 // 搜索的人员库中包含的人脸数。 2846 FaceNum *uint64 `json:"FaceNum,omitempty" name:"FaceNum"` 2847 2848 // 识别结果。 2849 ResultsReturnsByGroup []*ResultsReturnsByGroup `json:"ResultsReturnsByGroup,omitempty" name:"ResultsReturnsByGroup" list` 2850 2851 // 人脸识别所用的算法模型版本。 2852 FaceModelVersion *string `json:"FaceModelVersion,omitempty" name:"FaceModelVersion"` 2853 2854 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 2855 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 2856 } `json:"Response"` 2857} 2858 2859func (r *SearchFacesReturnsByGroupResponse) ToJsonString() string { 2860 b, _ := json.Marshal(r) 2861 return string(b) 2862} 2863 2864// It is highly **NOT** recommended to use this function 2865// because it has no param check, nor strict type check 2866func (r *SearchFacesReturnsByGroupResponse) FromJsonString(s string) error { 2867 return json.Unmarshal([]byte(s), &r) 2868} 2869 2870type SearchPersonsRequest struct { 2871 *tchttp.BaseRequest 2872 2873 // 希望搜索的人员库列表,上限100个。 2874 GroupIds []*string `json:"GroupIds,omitempty" name:"GroupIds" list` 2875 2876 // 图片 base64 数据,base64 编码后大小不可超过5M。 2877 // 若图片中包含多张人脸,只选取其中人脸面积最大的人脸。 2878 // 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。 2879 Image *string `json:"Image,omitempty" name:"Image"` 2880 2881 // 图片的 Url 。对应图片 base64 编码后大小不可超过5M。 2882 // Url、Image必须提供一个,如果都提供,只使用 Url。 2883 // 图片存储于腾讯云的Url可保障更高下载速度和稳定性,建议图片存储于腾讯云。 2884 // 非腾讯云存储的Url速度和稳定性可能受一定影响。 2885 // 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。 2886 Url *string `json:"Url,omitempty" name:"Url"` 2887 2888 // 最多识别的人脸数目。默认值为1(仅检测图片中面积最大的那张人脸),最大值为10。 2889 // MaxFaceNum用于,当输入的待识别图片包含多张人脸时,设定要搜索的人脸的数量。 2890 // 例:输入的Image或Url中的图片包含多张人脸,设MaxFaceNum=5,则会识别图片中面积最大的5张人脸。 2891 MaxFaceNum *uint64 `json:"MaxFaceNum,omitempty" name:"MaxFaceNum"` 2892 2893 // 人脸长和宽的最小尺寸,单位为像素。默认为34。低于34将影响搜索精度。建议设置为80。 2894 MinFaceSize *uint64 `json:"MinFaceSize,omitempty" name:"MinFaceSize"` 2895 2896 // 单张被识别的人脸返回的最相似人员数量。默认值为5,最大值为100。 2897 // 例,设MaxFaceNum为1,MaxPersonNum为8,则返回Top8相似的人员信息。 2898 // 值越大,需要处理的时间越长。建议不要超过10。 2899 MaxPersonNum *uint64 `json:"MaxPersonNum,omitempty" name:"MaxPersonNum"` 2900 2901 // 图片质量控制。 2902 // 0: 不进行控制; 2903 // 1:较低的质量要求,图像存在非常模糊,眼睛鼻子嘴巴遮挡至少其中一种或多种的情况; 2904 // 2: 一般的质量要求,图像存在偏亮,偏暗,模糊或一般模糊,眉毛遮挡,脸颊遮挡,下巴遮挡,至少其中三种的情况; 2905 // 3: 较高的质量要求,图像存在偏亮,偏暗,一般模糊,眉毛遮挡,脸颊遮挡,下巴遮挡,其中一到两种的情况; 2906 // 4: 很高的质量要求,各个维度均为最好或最多在某一维度上存在轻微问题; 2907 // 默认 0。 2908 // 若图片质量不满足要求,则返回结果中会提示图片质量检测不符要求。 2909 QualityControl *uint64 `json:"QualityControl,omitempty" name:"QualityControl"` 2910 2911 // 出参Score中,只有大于等于FaceMatchThreshold值的结果才会返回。默认为0。取值范围[0.0,100.0) 。 2912 FaceMatchThreshold *float64 `json:"FaceMatchThreshold,omitempty" name:"FaceMatchThreshold"` 2913 2914 // 是否返回人员具体信息。0 为关闭,1 为开启。默认为 0。其他非0非1值默认为0 2915 NeedPersonInfo *int64 `json:"NeedPersonInfo,omitempty" name:"NeedPersonInfo"` 2916 2917 // 是否开启图片旋转识别支持。0为不开启,1为开启。默认为0。本参数的作用为,当图片中的人脸被旋转且图片没有exif信息时,如果不开启图片旋转识别支持则无法正确检测、识别图片中的人脸。若您确认图片包含exif信息或者您确认输入图中人脸不会出现被旋转情况,请不要开启本参数。开启后,整体耗时将可能增加数百毫秒。 2918 NeedRotateDetection *uint64 `json:"NeedRotateDetection,omitempty" name:"NeedRotateDetection"` 2919} 2920 2921func (r *SearchPersonsRequest) ToJsonString() string { 2922 b, _ := json.Marshal(r) 2923 return string(b) 2924} 2925 2926// It is highly **NOT** recommended to use this function 2927// because it has no param check, nor strict type check 2928func (r *SearchPersonsRequest) FromJsonString(s string) error { 2929 f := make(map[string]interface{}) 2930 if err := json.Unmarshal([]byte(s), &f); err != nil { 2931 return err 2932 } 2933 delete(f, "GroupIds") 2934 delete(f, "Image") 2935 delete(f, "Url") 2936 delete(f, "MaxFaceNum") 2937 delete(f, "MinFaceSize") 2938 delete(f, "MaxPersonNum") 2939 delete(f, "QualityControl") 2940 delete(f, "FaceMatchThreshold") 2941 delete(f, "NeedPersonInfo") 2942 delete(f, "NeedRotateDetection") 2943 if len(f) > 0 { 2944 return errors.New("SearchPersonsRequest has unknown keys!") 2945 } 2946 return json.Unmarshal([]byte(s), &r) 2947} 2948 2949type SearchPersonsResponse struct { 2950 *tchttp.BaseResponse 2951 Response *struct { 2952 2953 // 识别结果。 2954 Results []*Result `json:"Results,omitempty" name:"Results" list` 2955 2956 // 搜索的人员库中包含的人员数。若输入图片中所有人脸均不符合质量要求,则返回0。 2957 PersonNum *uint64 `json:"PersonNum,omitempty" name:"PersonNum"` 2958 2959 // 人脸识别所用的算法模型版本。 2960 // 注意:此字段可能返回 null,表示取不到有效值。 2961 FaceModelVersion *string `json:"FaceModelVersion,omitempty" name:"FaceModelVersion"` 2962 2963 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 2964 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 2965 } `json:"Response"` 2966} 2967 2968func (r *SearchPersonsResponse) ToJsonString() string { 2969 b, _ := json.Marshal(r) 2970 return string(b) 2971} 2972 2973// It is highly **NOT** recommended to use this function 2974// because it has no param check, nor strict type check 2975func (r *SearchPersonsResponse) FromJsonString(s string) error { 2976 return json.Unmarshal([]byte(s), &r) 2977} 2978 2979type SearchPersonsReturnsByGroupRequest struct { 2980 *tchttp.BaseRequest 2981 2982 // 希望搜索的人员库列表,上限60个。 2983 GroupIds []*string `json:"GroupIds,omitempty" name:"GroupIds" list` 2984 2985 // 图片 base64 数据,base64 编码后大小不可超过5M。 2986 // 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。 2987 Image *string `json:"Image,omitempty" name:"Image"` 2988 2989 // 图片的 Url 。对应图片 base64 编码后大小不可超过5M。 2990 // Url、Image必须提供一个,如果都提供,只使用 Url。 2991 // 图片存储于腾讯云的Url可保障更高下载速度和稳定性,建议图片存储于腾讯云。 2992 // 非腾讯云存储的Url速度和稳定性可能受一定影响。 2993 // 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。 2994 Url *string `json:"Url,omitempty" name:"Url"` 2995 2996 // 最多识别的人脸数目。默认值为1(仅检测图片中面积最大的那张人脸),最大值为10。 2997 // MaxFaceNum用于,当输入的待识别图片包含多张人脸时,设定要搜索的人脸的数量。 2998 // 例:输入的Image或Url中的图片包含多张人脸,设MaxFaceNum=5,则会识别图片中面积最大的5张人脸。 2999 MaxFaceNum *uint64 `json:"MaxFaceNum,omitempty" name:"MaxFaceNum"` 3000 3001 // 人脸长和宽的最小尺寸,单位为像素。默认为34。低于34将影响搜索精度。建议设置为80。 3002 MinFaceSize *uint64 `json:"MinFaceSize,omitempty" name:"MinFaceSize"` 3003 3004 // 被检测到的人脸,对应最多返回的最相似人员数目。默认值为5,最大值为10。 3005 // 例,设MaxFaceNum为3,MaxPersonNumPerGroup为5,GroupIds长度为3,则最多可能返回3*5*3=45个人员。 3006 MaxPersonNumPerGroup *uint64 `json:"MaxPersonNumPerGroup,omitempty" name:"MaxPersonNumPerGroup"` 3007 3008 // 图片质量控制。 3009 // 0: 不进行控制; 3010 // 1:较低的质量要求,图像存在非常模糊,眼睛鼻子嘴巴遮挡至少其中一种或多种的情况; 3011 // 2: 一般的质量要求,图像存在偏亮,偏暗,模糊或一般模糊,眉毛遮挡,脸颊遮挡,下巴遮挡,至少其中三种的情况; 3012 // 3: 较高的质量要求,图像存在偏亮,偏暗,一般模糊,眉毛遮挡,脸颊遮挡,下巴遮挡,其中一到两种的情况; 3013 // 4: 很高的质量要求,各个维度均为最好或最多在某一维度上存在轻微问题; 3014 // 默认 0。 3015 // 若图片质量不满足要求,则返回结果中会提示图片质量检测不符要求。 3016 QualityControl *uint64 `json:"QualityControl,omitempty" name:"QualityControl"` 3017 3018 // 出参Score中,只有超过FaceMatchThreshold值的结果才会返回。默认为0。 3019 FaceMatchThreshold *float64 `json:"FaceMatchThreshold,omitempty" name:"FaceMatchThreshold"` 3020 3021 // 是否返回人员具体信息。0 为关闭,1 为开启。默认为 0。其他非0非1值默认为0 3022 NeedPersonInfo *int64 `json:"NeedPersonInfo,omitempty" name:"NeedPersonInfo"` 3023 3024 // 是否开启图片旋转识别支持。0为不开启,1为开启。默认为0。本参数的作用为,当图片中的人脸被旋转且图片没有exif信息时,如果不开启图片旋转识别支持则无法正确检测、识别图片中的人脸。若您确认图片包含exif信息或者您确认输入图中人脸不会出现被旋转情况,请不要开启本参数。开启后,整体耗时将可能增加数百毫秒。 3025 NeedRotateDetection *uint64 `json:"NeedRotateDetection,omitempty" name:"NeedRotateDetection"` 3026} 3027 3028func (r *SearchPersonsReturnsByGroupRequest) ToJsonString() string { 3029 b, _ := json.Marshal(r) 3030 return string(b) 3031} 3032 3033// It is highly **NOT** recommended to use this function 3034// because it has no param check, nor strict type check 3035func (r *SearchPersonsReturnsByGroupRequest) FromJsonString(s string) error { 3036 f := make(map[string]interface{}) 3037 if err := json.Unmarshal([]byte(s), &f); err != nil { 3038 return err 3039 } 3040 delete(f, "GroupIds") 3041 delete(f, "Image") 3042 delete(f, "Url") 3043 delete(f, "MaxFaceNum") 3044 delete(f, "MinFaceSize") 3045 delete(f, "MaxPersonNumPerGroup") 3046 delete(f, "QualityControl") 3047 delete(f, "FaceMatchThreshold") 3048 delete(f, "NeedPersonInfo") 3049 delete(f, "NeedRotateDetection") 3050 if len(f) > 0 { 3051 return errors.New("SearchPersonsReturnsByGroupRequest has unknown keys!") 3052 } 3053 return json.Unmarshal([]byte(s), &r) 3054} 3055 3056type SearchPersonsReturnsByGroupResponse struct { 3057 *tchttp.BaseResponse 3058 Response *struct { 3059 3060 // 搜索的人员库中包含的人员数。若输入图片中所有人脸均不符合质量要求,则返回0。 3061 PersonNum *uint64 `json:"PersonNum,omitempty" name:"PersonNum"` 3062 3063 // 识别结果。 3064 ResultsReturnsByGroup []*ResultsReturnsByGroup `json:"ResultsReturnsByGroup,omitempty" name:"ResultsReturnsByGroup" list` 3065 3066 // 人脸识别所用的算法模型版本。 3067 FaceModelVersion *string `json:"FaceModelVersion,omitempty" name:"FaceModelVersion"` 3068 3069 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 3070 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 3071 } `json:"Response"` 3072} 3073 3074func (r *SearchPersonsReturnsByGroupResponse) ToJsonString() string { 3075 b, _ := json.Marshal(r) 3076 return string(b) 3077} 3078 3079// It is highly **NOT** recommended to use this function 3080// because it has no param check, nor strict type check 3081func (r *SearchPersonsReturnsByGroupResponse) FromJsonString(s string) error { 3082 return json.Unmarshal([]byte(s), &r) 3083} 3084 3085type UpgradeGroupFaceModelVersionRequest struct { 3086 *tchttp.BaseRequest 3087 3088 // 需要升级的人员库ID。 3089 GroupId *string `json:"GroupId,omitempty" name:"GroupId"` 3090 3091 // 需要升级至的算法模型版本。默认为最新版本。 3092 FaceModelVersion *string `json:"FaceModelVersion,omitempty" name:"FaceModelVersion"` 3093} 3094 3095func (r *UpgradeGroupFaceModelVersionRequest) ToJsonString() string { 3096 b, _ := json.Marshal(r) 3097 return string(b) 3098} 3099 3100// It is highly **NOT** recommended to use this function 3101// because it has no param check, nor strict type check 3102func (r *UpgradeGroupFaceModelVersionRequest) FromJsonString(s string) error { 3103 f := make(map[string]interface{}) 3104 if err := json.Unmarshal([]byte(s), &f); err != nil { 3105 return err 3106 } 3107 delete(f, "GroupId") 3108 delete(f, "FaceModelVersion") 3109 if len(f) > 0 { 3110 return errors.New("UpgradeGroupFaceModelVersionRequest has unknown keys!") 3111 } 3112 return json.Unmarshal([]byte(s), &r) 3113} 3114 3115type UpgradeGroupFaceModelVersionResponse struct { 3116 *tchttp.BaseResponse 3117 Response *struct { 3118 3119 // 升级任务ID,用于查询、获取升级的进度和结果。 3120 JobId *string `json:"JobId,omitempty" name:"JobId"` 3121 3122 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 3123 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 3124 } `json:"Response"` 3125} 3126 3127func (r *UpgradeGroupFaceModelVersionResponse) ToJsonString() string { 3128 b, _ := json.Marshal(r) 3129 return string(b) 3130} 3131 3132// It is highly **NOT** recommended to use this function 3133// because it has no param check, nor strict type check 3134func (r *UpgradeGroupFaceModelVersionResponse) FromJsonString(s string) error { 3135 return json.Unmarshal([]byte(s), &r) 3136} 3137 3138type UpgradeJobInfo struct { 3139 3140 // 人员库升级任务ID,用于查询、获取升级的进度和结果。 3141 JobId *string `json:"JobId,omitempty" name:"JobId"` 3142 3143 // 人员库ID。 3144 GroupId *string `json:"GroupId,omitempty" name:"GroupId"` 3145 3146 // 当前算法模型版本。 3147 FromFaceModelVersion *string `json:"FromFaceModelVersion,omitempty" name:"FromFaceModelVersion"` 3148 3149 // 目标算法模型版本。 3150 ToFaceModelVersion *string `json:"ToFaceModelVersion,omitempty" name:"ToFaceModelVersion"` 3151 3152 // 升级起始时间。 3153 // StartTime的值是自 Unix 纪元时间到Group创建时间的毫秒数。 3154 // Unix 纪元时间是 1970 年 1 月 1 日星期四,协调世界时 (UTC) 00:00:00。 3155 // 有关更多信息,请参阅 Unix 时间。 3156 StartTime *uint64 `json:"StartTime,omitempty" name:"StartTime"` 3157 3158 // 0表示升级中,1表示升级完毕,2表示回滚完毕。 3159 Status *uint64 `json:"Status,omitempty" name:"Status"` 3160} 3161 3162type VerifyFaceRequest struct { 3163 *tchttp.BaseRequest 3164 3165 // 待验证的人员ID。人员ID具体信息请参考人员库管理相关接口。 3166 PersonId *string `json:"PersonId,omitempty" name:"PersonId"` 3167 3168 // 图片 base64 数据,base64 编码后大小不可超过5M。 3169 // 若图片中包含多张人脸,只选取其中人脸面积最大的人脸。 3170 // 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。 3171 Image *string `json:"Image,omitempty" name:"Image"` 3172 3173 // 图片的 Url 。对应图片 base64 编码后大小不可超过5M。 3174 // Url、Image必须提供一个,如果都提供,只使用 Url。 3175 // 图片存储于腾讯云的Url可保障更高下载速度和稳定性,建议图片存储于腾讯云。 3176 // 非腾讯云存储的Url速度和稳定性可能受一定影响。 3177 // 若图片中包含多张人脸,只选取其中人脸面积最大的人脸。 3178 // 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。 3179 Url *string `json:"Url,omitempty" name:"Url"` 3180 3181 // 图片质量控制。 3182 // 0: 不进行控制; 3183 // 1:较低的质量要求,图像存在非常模糊,眼睛鼻子嘴巴遮挡至少其中一种或多种的情况; 3184 // 2: 一般的质量要求,图像存在偏亮,偏暗,模糊或一般模糊,眉毛遮挡,脸颊遮挡,下巴遮挡,至少其中三种的情况; 3185 // 3: 较高的质量要求,图像存在偏亮,偏暗,一般模糊,眉毛遮挡,脸颊遮挡,下巴遮挡,其中一到两种的情况; 3186 // 4: 很高的质量要求,各个维度均为最好或最多在某一维度上存在轻微问题; 3187 // 默认 0。 3188 // 若图片质量不满足要求,则返回结果中会提示图片质量检测不符要求。 3189 QualityControl *uint64 `json:"QualityControl,omitempty" name:"QualityControl"` 3190 3191 // 是否开启图片旋转识别支持。0为不开启,1为开启。默认为0。本参数的作用为,当图片中的人脸被旋转且图片没有exif信息时,如果不开启图片旋转识别支持则无法正确检测、识别图片中的人脸。若您确认图片包含exif信息或者您确认输入图中人脸不会出现被旋转情况,请不要开启本参数。开启后,整体耗时将可能增加数百毫秒。 3192 NeedRotateDetection *uint64 `json:"NeedRotateDetection,omitempty" name:"NeedRotateDetection"` 3193} 3194 3195func (r *VerifyFaceRequest) ToJsonString() string { 3196 b, _ := json.Marshal(r) 3197 return string(b) 3198} 3199 3200// It is highly **NOT** recommended to use this function 3201// because it has no param check, nor strict type check 3202func (r *VerifyFaceRequest) FromJsonString(s string) error { 3203 f := make(map[string]interface{}) 3204 if err := json.Unmarshal([]byte(s), &f); err != nil { 3205 return err 3206 } 3207 delete(f, "PersonId") 3208 delete(f, "Image") 3209 delete(f, "Url") 3210 delete(f, "QualityControl") 3211 delete(f, "NeedRotateDetection") 3212 if len(f) > 0 { 3213 return errors.New("VerifyFaceRequest has unknown keys!") 3214 } 3215 return json.Unmarshal([]byte(s), &r) 3216} 3217 3218type VerifyFaceResponse struct { 3219 *tchttp.BaseResponse 3220 Response *struct { 3221 3222 // 给定的人脸图片与 PersonId 对应人脸的相似度。若 PersonId 下有多张人脸(Face),返回相似度最大的分数。 3223 // 3224 // 不同算法版本返回的相似度分数不同。 3225 // 若需要验证两张图片中人脸是否为同一人,3.0版本误识率千分之一对应分数为40分,误识率万分之一对应分数为50分,误识率十万分之一对应分数为60分。 一般超过50分则可认定为同一人。 3226 // 2.0版本误识率千分之一对应分数为70分,误识率万分之一对应分数为80分,误识率十万分之一对应分数为90分。 一般超过80分则可认定为同一人。 3227 Score *float64 `json:"Score,omitempty" name:"Score"` 3228 3229 // 是否为同一人的判断。 3230 IsMatch *bool `json:"IsMatch,omitempty" name:"IsMatch"` 3231 3232 // 人脸识别所用的算法模型版本。 3233 FaceModelVersion *string `json:"FaceModelVersion,omitempty" name:"FaceModelVersion"` 3234 3235 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 3236 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 3237 } `json:"Response"` 3238} 3239 3240func (r *VerifyFaceResponse) ToJsonString() string { 3241 b, _ := json.Marshal(r) 3242 return string(b) 3243} 3244 3245// It is highly **NOT** recommended to use this function 3246// because it has no param check, nor strict type check 3247func (r *VerifyFaceResponse) FromJsonString(s string) error { 3248 return json.Unmarshal([]byte(s), &r) 3249} 3250 3251type VerifyPersonRequest struct { 3252 *tchttp.BaseRequest 3253 3254 // 待验证的人员ID。人员ID具体信息请参考人员库管理相关接口。 3255 PersonId *string `json:"PersonId,omitempty" name:"PersonId"` 3256 3257 // 图片 base64 数据。 3258 // 若图片中包含多张人脸,只选取其中人脸面积最大的人脸。 3259 // 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。 3260 Image *string `json:"Image,omitempty" name:"Image"` 3261 3262 // 图片的 Url 。 图片的 Url、Image必须提供一个,如果都提供,只使用 Url。 3263 // 图片存储于腾讯云的Url可保障更高下载速度和稳定性,建议图片存储于腾讯云。 3264 // 非腾讯云存储的Url速度和稳定性可能受一定影响。 3265 // 若图片中包含多张人脸,只选取其中人脸面积最大的人脸。 3266 // 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。 3267 Url *string `json:"Url,omitempty" name:"Url"` 3268 3269 // 图片质量控制。 3270 // 0: 不进行控制; 3271 // 1:较低的质量要求,图像存在非常模糊,眼睛鼻子嘴巴遮挡至少其中一种或多种的情况; 3272 // 2: 一般的质量要求,图像存在偏亮,偏暗,模糊或一般模糊,眉毛遮挡,脸颊遮挡,下巴遮挡,至少其中三种的情况; 3273 // 3: 较高的质量要求,图像存在偏亮,偏暗,一般模糊,眉毛遮挡,脸颊遮挡,下巴遮挡,其中一到两种的情况; 3274 // 4: 很高的质量要求,各个维度均为最好或最多在某一维度上存在轻微问题; 3275 // 默认 0。 3276 // 若图片质量不满足要求,则返回结果中会提示图片质量检测不符要求。 3277 QualityControl *uint64 `json:"QualityControl,omitempty" name:"QualityControl"` 3278 3279 // 是否开启图片旋转识别支持。0为不开启,1为开启。默认为0。本参数的作用为,当图片中的人脸被旋转且图片没有exif信息时,如果不开启图片旋转识别支持则无法正确检测、识别图片中的人脸。若您确认图片包含exif信息或者您确认输入图中人脸不会出现被旋转情况,请不要开启本参数。开启后,整体耗时将可能增加数百毫秒。 3280 NeedRotateDetection *uint64 `json:"NeedRotateDetection,omitempty" name:"NeedRotateDetection"` 3281} 3282 3283func (r *VerifyPersonRequest) ToJsonString() string { 3284 b, _ := json.Marshal(r) 3285 return string(b) 3286} 3287 3288// It is highly **NOT** recommended to use this function 3289// because it has no param check, nor strict type check 3290func (r *VerifyPersonRequest) FromJsonString(s string) error { 3291 f := make(map[string]interface{}) 3292 if err := json.Unmarshal([]byte(s), &f); err != nil { 3293 return err 3294 } 3295 delete(f, "PersonId") 3296 delete(f, "Image") 3297 delete(f, "Url") 3298 delete(f, "QualityControl") 3299 delete(f, "NeedRotateDetection") 3300 if len(f) > 0 { 3301 return errors.New("VerifyPersonRequest has unknown keys!") 3302 } 3303 return json.Unmarshal([]byte(s), &r) 3304} 3305 3306type VerifyPersonResponse struct { 3307 *tchttp.BaseResponse 3308 Response *struct { 3309 3310 // 给定的人脸照片与 PersonId 对应的相似度。若 PersonId 下有多张人脸(Face),会融合多张人脸信息进行验证。 3311 Score *float64 `json:"Score,omitempty" name:"Score"` 3312 3313 // 是否为同一人的判断。 3314 IsMatch *bool `json:"IsMatch,omitempty" name:"IsMatch"` 3315 3316 // 人脸识别所用的算法模型版本。 3317 FaceModelVersion *string `json:"FaceModelVersion,omitempty" name:"FaceModelVersion"` 3318 3319 // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 3320 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` 3321 } `json:"Response"` 3322} 3323 3324func (r *VerifyPersonResponse) ToJsonString() string { 3325 b, _ := json.Marshal(r) 3326 return string(b) 3327} 3328 3329// It is highly **NOT** recommended to use this function 3330// because it has no param check, nor strict type check 3331func (r *VerifyPersonResponse) FromJsonString(s string) error { 3332 return json.Unmarshal([]byte(s), &r) 3333} 3334