1 package face 2 3 // Copyright (c) Microsoft Corporation. All rights reserved. 4 // Licensed under the MIT License. See License.txt in the project root for license information. 5 // 6 // Code generated by Microsoft (R) AutoRest Code Generator. 7 // Changes may cause incorrect behavior and will be lost if the code is regenerated. 8 9 import ( 10 "github.com/Azure/go-autorest/autorest" 11 "github.com/Azure/go-autorest/autorest/date" 12 "github.com/gofrs/uuid" 13 ) 14 15 // The package's fully qualified name. 16 const fqdn = "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/face" 17 18 // Accessory accessory item and corresponding confidence level. 19 type Accessory struct { 20 // Type - Type of an accessory. Possible values include: 'HeadWear', 'Glasses', 'Mask' 21 Type AccessoryType `json:"type,omitempty"` 22 // Confidence - Confidence level of an accessory 23 Confidence *float64 `json:"confidence,omitempty"` 24 } 25 26 // APIError error information returned by the API 27 type APIError struct { 28 Error *Error `json:"error,omitempty"` 29 } 30 31 // ApplySnapshotRequest request body for applying snapshot operation. 32 type ApplySnapshotRequest struct { 33 // ObjectID - User specified target object id to be created from the snapshot. 34 ObjectID *string `json:"objectId,omitempty"` 35 // Mode - Snapshot applying mode. Currently only CreateNew is supported, which means the apply operation will fail if target subscription already contains an object of same type and using the same objectId. Users can specify the "objectId" in request body to avoid such conflicts. Possible values include: 'CreateNew' 36 Mode SnapshotApplyMode `json:"mode,omitempty"` 37 } 38 39 // Attributes face Attributes 40 type Attributes struct { 41 // Age - Age in years 42 Age *float64 `json:"age,omitempty"` 43 // Gender - Possible gender of the face. Possible values include: 'Male', 'Female' 44 Gender Gender `json:"gender,omitempty"` 45 // Smile - Smile intensity, a number between [0,1] 46 Smile *float64 `json:"smile,omitempty"` 47 // FacialHair - Properties describing facial hair attributes. 48 FacialHair *FacialHair `json:"facialHair,omitempty"` 49 // Glasses - Glasses type if any of the face. Possible values include: 'NoGlasses', 'ReadingGlasses', 'Sunglasses', 'SwimmingGoggles' 50 Glasses GlassesType `json:"glasses,omitempty"` 51 // HeadPose - Properties indicating head pose of the face. 52 HeadPose *HeadPose `json:"headPose,omitempty"` 53 // Emotion - Properties describing facial emotion in form of confidence ranging from 0 to 1. 54 Emotion *Emotion `json:"emotion,omitempty"` 55 // Hair - Properties describing hair attributes. 56 Hair *Hair `json:"hair,omitempty"` 57 // Makeup - Properties describing present makeups on a given face. 58 Makeup *Makeup `json:"makeup,omitempty"` 59 // Occlusion - Properties describing occlusions on a given face. 60 Occlusion *Occlusion `json:"occlusion,omitempty"` 61 // Accessories - Properties describing any accessories on a given face. 62 Accessories *[]Accessory `json:"accessories,omitempty"` 63 // Blur - Properties describing any presence of blur within the image. 64 Blur *Blur `json:"blur,omitempty"` 65 // Exposure - Properties describing exposure level of the image. 66 Exposure *Exposure `json:"exposure,omitempty"` 67 // Noise - Properties describing noise level of the image. 68 Noise *Noise `json:"noise,omitempty"` 69 } 70 71 // Blur properties describing any presence of blur within the image. 72 type Blur struct { 73 // BlurLevel - An enum value indicating level of blurriness. Possible values include: 'Low', 'Medium', 'High' 74 BlurLevel BlurLevel `json:"blurLevel,omitempty"` 75 // Value - A number indicating level of blurriness ranging from 0 to 1. 76 Value *float64 `json:"value,omitempty"` 77 } 78 79 // Coordinate coordinates within an image 80 type Coordinate struct { 81 // X - The horizontal component, in pixels. 82 X *float64 `json:"x,omitempty"` 83 // Y - The vertical component, in pixels. 84 Y *float64 `json:"y,omitempty"` 85 } 86 87 // DetectedFace detected Face object. 88 type DetectedFace struct { 89 FaceID *uuid.UUID `json:"faceId,omitempty"` 90 // RecognitionModel - Possible values include: 'Recognition01', 'Recognition02', 'Recognition03' 91 RecognitionModel RecognitionModel `json:"recognitionModel,omitempty"` 92 FaceRectangle *Rectangle `json:"faceRectangle,omitempty"` 93 FaceLandmarks *Landmarks `json:"faceLandmarks,omitempty"` 94 FaceAttributes *Attributes `json:"faceAttributes,omitempty"` 95 } 96 97 // Emotion properties describing facial emotion in form of confidence ranging from 0 to 1. 98 type Emotion struct { 99 Anger *float64 `json:"anger,omitempty"` 100 Contempt *float64 `json:"contempt,omitempty"` 101 Disgust *float64 `json:"disgust,omitempty"` 102 Fear *float64 `json:"fear,omitempty"` 103 Happiness *float64 `json:"happiness,omitempty"` 104 Neutral *float64 `json:"neutral,omitempty"` 105 Sadness *float64 `json:"sadness,omitempty"` 106 Surprise *float64 `json:"surprise,omitempty"` 107 } 108 109 // Error error body. 110 type Error struct { 111 Code *string `json:"code,omitempty"` 112 Message *string `json:"message,omitempty"` 113 } 114 115 // Exposure properties describing exposure level of the image. 116 type Exposure struct { 117 // ExposureLevel - An enum value indicating level of exposure. Possible values include: 'UnderExposure', 'GoodExposure', 'OverExposure' 118 ExposureLevel ExposureLevel `json:"exposureLevel,omitempty"` 119 // Value - A number indicating level of exposure level ranging from 0 to 1. [0, 0.25) is under exposure. [0.25, 0.75) is good exposure. [0.75, 1] is over exposure. 120 Value *float64 `json:"value,omitempty"` 121 } 122 123 // FacialHair properties describing facial hair attributes. 124 type FacialHair struct { 125 Moustache *float64 `json:"moustache,omitempty"` 126 Beard *float64 `json:"beard,omitempty"` 127 Sideburns *float64 `json:"sideburns,omitempty"` 128 } 129 130 // FindSimilarRequest request body for find similar operation. 131 type FindSimilarRequest struct { 132 // FaceID - FaceId of the query face. User needs to call Face - Detect first to get a valid faceId. Note that this faceId is not persisted and will expire 24 hours after the detection call 133 FaceID *uuid.UUID `json:"faceId,omitempty"` 134 // FaceListID - An existing user-specified unique candidate face list, created in Face List - Create a Face List. Face list contains a set of persistedFaceIds which are persisted and will never expire. Parameter faceListId, largeFaceListId and faceIds should not be provided at the same time. 135 FaceListID *string `json:"faceListId,omitempty"` 136 // LargeFaceListID - An existing user-specified unique candidate large face list, created in LargeFaceList - Create. Large face list contains a set of persistedFaceIds which are persisted and will never expire. Parameter faceListId, largeFaceListId and faceIds should not be provided at the same time. 137 LargeFaceListID *string `json:"largeFaceListId,omitempty"` 138 // FaceIds - An array of candidate faceIds. All of them are created by Face - Detect and the faceIds will expire 24 hours after the detection call. The number of faceIds is limited to 1000. Parameter faceListId, largeFaceListId and faceIds should not be provided at the same time. 139 FaceIds *[]uuid.UUID `json:"faceIds,omitempty"` 140 // MaxNumOfCandidatesReturned - The number of top similar faces returned. The valid range is [1, 1000]. 141 MaxNumOfCandidatesReturned *int32 `json:"maxNumOfCandidatesReturned,omitempty"` 142 // Mode - Similar face searching mode. It can be "matchPerson" or "matchFace". Possible values include: 'MatchPerson', 'MatchFace' 143 Mode FindSimilarMatchMode `json:"mode,omitempty"` 144 } 145 146 // GroupRequest request body for group request. 147 type GroupRequest struct { 148 // FaceIds - Array of candidate faceId created by Face - Detect. The maximum is 1000 faces 149 FaceIds *[]uuid.UUID `json:"faceIds,omitempty"` 150 } 151 152 // GroupResult an array of face groups based on face similarity. 153 type GroupResult struct { 154 autorest.Response `json:"-"` 155 // Groups - A partition of the original faces based on face similarity. Groups are ranked by number of faces 156 Groups *[][]uuid.UUID `json:"groups,omitempty"` 157 // MessyGroup - Face ids array of faces that cannot find any similar faces from original faces. 158 MessyGroup *[]uuid.UUID `json:"messyGroup,omitempty"` 159 } 160 161 // Hair properties describing hair attributes. 162 type Hair struct { 163 // Bald - A number describing confidence level of whether the person is bald. 164 Bald *float64 `json:"bald,omitempty"` 165 // Invisible - A boolean value describing whether the hair is visible in the image. 166 Invisible *bool `json:"invisible,omitempty"` 167 // HairColor - An array of candidate colors and confidence level in the presence of each. 168 HairColor *[]HairColor `json:"hairColor,omitempty"` 169 } 170 171 // HairColor hair color and associated confidence 172 type HairColor struct { 173 // Color - Name of the hair color. Possible values include: 'Unknown', 'White', 'Gray', 'Blond', 'Brown', 'Red', 'Black', 'Other' 174 Color HairColorType `json:"color,omitempty"` 175 // Confidence - Confidence level of the color 176 Confidence *float64 `json:"confidence,omitempty"` 177 } 178 179 // HeadPose properties indicating head pose of the face. 180 type HeadPose struct { 181 Roll *float64 `json:"roll,omitempty"` 182 Yaw *float64 `json:"yaw,omitempty"` 183 Pitch *float64 `json:"pitch,omitempty"` 184 } 185 186 // IdentifyCandidate all possible faces that may qualify. 187 type IdentifyCandidate struct { 188 // PersonID - Id of candidate 189 PersonID *uuid.UUID `json:"personId,omitempty"` 190 // Confidence - Confidence threshold of identification, used to judge whether one face belong to one person. The range of confidenceThreshold is [0, 1] (default specified by algorithm). 191 Confidence *float64 `json:"confidence,omitempty"` 192 } 193 194 // IdentifyRequest request body for identify face operation. 195 type IdentifyRequest struct { 196 // FaceIds - Array of query faces faceIds, created by the Face - Detect. Each of the faces are identified independently. The valid number of faceIds is between [1, 10]. 197 FaceIds *[]uuid.UUID `json:"faceIds,omitempty"` 198 // PersonGroupID - PersonGroupId of the target person group, created by PersonGroup - Create. Parameter personGroupId and largePersonGroupId should not be provided at the same time. 199 PersonGroupID *string `json:"personGroupId,omitempty"` 200 // LargePersonGroupID - LargePersonGroupId of the target large person group, created by LargePersonGroup - Create. Parameter personGroupId and largePersonGroupId should not be provided at the same time. 201 LargePersonGroupID *string `json:"largePersonGroupId,omitempty"` 202 // MaxNumOfCandidatesReturned - The range of maxNumOfCandidatesReturned is between 1 and 5 (default is 1). 203 MaxNumOfCandidatesReturned *int32 `json:"maxNumOfCandidatesReturned,omitempty"` 204 // ConfidenceThreshold - Confidence threshold of identification, used to judge whether one face belong to one person. The range of confidenceThreshold is [0, 1] (default specified by algorithm). 205 ConfidenceThreshold *float64 `json:"confidenceThreshold,omitempty"` 206 } 207 208 // IdentifyResult response body for identify face operation. 209 type IdentifyResult struct { 210 // FaceID - FaceId of the query face 211 FaceID *uuid.UUID `json:"faceId,omitempty"` 212 // Candidates - Identified person candidates for that face (ranked by confidence). Array size should be no larger than input maxNumOfCandidatesReturned. If no person is identified, will return an empty array. 213 Candidates *[]IdentifyCandidate `json:"candidates,omitempty"` 214 } 215 216 // ImageURL ... 217 type ImageURL struct { 218 // URL - Publicly reachable URL of an image 219 URL *string `json:"url,omitempty"` 220 } 221 222 // Landmarks a collection of 27-point face landmarks pointing to the important positions of face 223 // components. 224 type Landmarks struct { 225 PupilLeft *Coordinate `json:"pupilLeft,omitempty"` 226 PupilRight *Coordinate `json:"pupilRight,omitempty"` 227 NoseTip *Coordinate `json:"noseTip,omitempty"` 228 MouthLeft *Coordinate `json:"mouthLeft,omitempty"` 229 MouthRight *Coordinate `json:"mouthRight,omitempty"` 230 EyebrowLeftOuter *Coordinate `json:"eyebrowLeftOuter,omitempty"` 231 EyebrowLeftInner *Coordinate `json:"eyebrowLeftInner,omitempty"` 232 EyeLeftOuter *Coordinate `json:"eyeLeftOuter,omitempty"` 233 EyeLeftTop *Coordinate `json:"eyeLeftTop,omitempty"` 234 EyeLeftBottom *Coordinate `json:"eyeLeftBottom,omitempty"` 235 EyeLeftInner *Coordinate `json:"eyeLeftInner,omitempty"` 236 EyebrowRightInner *Coordinate `json:"eyebrowRightInner,omitempty"` 237 EyebrowRightOuter *Coordinate `json:"eyebrowRightOuter,omitempty"` 238 EyeRightInner *Coordinate `json:"eyeRightInner,omitempty"` 239 EyeRightTop *Coordinate `json:"eyeRightTop,omitempty"` 240 EyeRightBottom *Coordinate `json:"eyeRightBottom,omitempty"` 241 EyeRightOuter *Coordinate `json:"eyeRightOuter,omitempty"` 242 NoseRootLeft *Coordinate `json:"noseRootLeft,omitempty"` 243 NoseRootRight *Coordinate `json:"noseRootRight,omitempty"` 244 NoseLeftAlarTop *Coordinate `json:"noseLeftAlarTop,omitempty"` 245 NoseRightAlarTop *Coordinate `json:"noseRightAlarTop,omitempty"` 246 NoseLeftAlarOutTip *Coordinate `json:"noseLeftAlarOutTip,omitempty"` 247 NoseRightAlarOutTip *Coordinate `json:"noseRightAlarOutTip,omitempty"` 248 UpperLipTop *Coordinate `json:"upperLipTop,omitempty"` 249 UpperLipBottom *Coordinate `json:"upperLipBottom,omitempty"` 250 UnderLipTop *Coordinate `json:"underLipTop,omitempty"` 251 UnderLipBottom *Coordinate `json:"underLipBottom,omitempty"` 252 } 253 254 // LargeFaceList large face list object. 255 type LargeFaceList struct { 256 autorest.Response `json:"-"` 257 // LargeFaceListID - LargeFaceListId of the target large face list. 258 LargeFaceListID *string `json:"largeFaceListId,omitempty"` 259 // RecognitionModel - Possible values include: 'Recognition01', 'Recognition02', 'Recognition03' 260 RecognitionModel RecognitionModel `json:"recognitionModel,omitempty"` 261 // Name - User defined name, maximum length is 128. 262 Name *string `json:"name,omitempty"` 263 // UserData - User specified data. Length should not exceed 16KB. 264 UserData *string `json:"userData,omitempty"` 265 } 266 267 // LargePersonGroup large person group object. 268 type LargePersonGroup struct { 269 autorest.Response `json:"-"` 270 // LargePersonGroupID - LargePersonGroupId of the target large person groups 271 LargePersonGroupID *string `json:"largePersonGroupId,omitempty"` 272 // RecognitionModel - Possible values include: 'Recognition01', 'Recognition02', 'Recognition03' 273 RecognitionModel RecognitionModel `json:"recognitionModel,omitempty"` 274 // Name - User defined name, maximum length is 128. 275 Name *string `json:"name,omitempty"` 276 // UserData - User specified data. Length should not exceed 16KB. 277 UserData *string `json:"userData,omitempty"` 278 } 279 280 // List face list object. 281 type List struct { 282 autorest.Response `json:"-"` 283 // FaceListID - FaceListId of the target face list. 284 FaceListID *string `json:"faceListId,omitempty"` 285 // PersistedFaces - Persisted faces within the face list. 286 PersistedFaces *[]PersistedFace `json:"persistedFaces,omitempty"` 287 // RecognitionModel - Possible values include: 'Recognition01', 'Recognition02', 'Recognition03' 288 RecognitionModel RecognitionModel `json:"recognitionModel,omitempty"` 289 // Name - User defined name, maximum length is 128. 290 Name *string `json:"name,omitempty"` 291 // UserData - User specified data. Length should not exceed 16KB. 292 UserData *string `json:"userData,omitempty"` 293 } 294 295 // ListDetectedFace ... 296 type ListDetectedFace struct { 297 autorest.Response `json:"-"` 298 Value *[]DetectedFace `json:"value,omitempty"` 299 } 300 301 // ListIdentifyResult ... 302 type ListIdentifyResult struct { 303 autorest.Response `json:"-"` 304 Value *[]IdentifyResult `json:"value,omitempty"` 305 } 306 307 // ListLargeFaceList ... 308 type ListLargeFaceList struct { 309 autorest.Response `json:"-"` 310 Value *[]LargeFaceList `json:"value,omitempty"` 311 } 312 313 // ListLargePersonGroup ... 314 type ListLargePersonGroup struct { 315 autorest.Response `json:"-"` 316 Value *[]LargePersonGroup `json:"value,omitempty"` 317 } 318 319 // ListList ... 320 type ListList struct { 321 autorest.Response `json:"-"` 322 Value *[]List `json:"value,omitempty"` 323 } 324 325 // ListPersistedFace ... 326 type ListPersistedFace struct { 327 autorest.Response `json:"-"` 328 Value *[]PersistedFace `json:"value,omitempty"` 329 } 330 331 // ListPerson ... 332 type ListPerson struct { 333 autorest.Response `json:"-"` 334 Value *[]Person `json:"value,omitempty"` 335 } 336 337 // ListPersonGroup ... 338 type ListPersonGroup struct { 339 autorest.Response `json:"-"` 340 Value *[]PersonGroup `json:"value,omitempty"` 341 } 342 343 // ListSimilarFace ... 344 type ListSimilarFace struct { 345 autorest.Response `json:"-"` 346 Value *[]SimilarFace `json:"value,omitempty"` 347 } 348 349 // ListSnapshot ... 350 type ListSnapshot struct { 351 autorest.Response `json:"-"` 352 Value *[]Snapshot `json:"value,omitempty"` 353 } 354 355 // Makeup properties describing present makeups on a given face. 356 type Makeup struct { 357 // EyeMakeup - A boolean value describing whether eye makeup is present on a face. 358 EyeMakeup *bool `json:"eyeMakeup,omitempty"` 359 // LipMakeup - A boolean value describing whether lip makeup is present on a face. 360 LipMakeup *bool `json:"lipMakeup,omitempty"` 361 } 362 363 // MetaDataContract a combination of user defined name and user specified data and recognition model name 364 // for largePersonGroup/personGroup, and largeFaceList/faceList. 365 type MetaDataContract struct { 366 // RecognitionModel - Possible values include: 'Recognition01', 'Recognition02', 'Recognition03' 367 RecognitionModel RecognitionModel `json:"recognitionModel,omitempty"` 368 // Name - User defined name, maximum length is 128. 369 Name *string `json:"name,omitempty"` 370 // UserData - User specified data. Length should not exceed 16KB. 371 UserData *string `json:"userData,omitempty"` 372 } 373 374 // NameAndUserDataContract a combination of user defined name and user specified data for the person, 375 // largePersonGroup/personGroup, and largeFaceList/faceList. 376 type NameAndUserDataContract struct { 377 // Name - User defined name, maximum length is 128. 378 Name *string `json:"name,omitempty"` 379 // UserData - User specified data. Length should not exceed 16KB. 380 UserData *string `json:"userData,omitempty"` 381 } 382 383 // Noise properties describing noise level of the image. 384 type Noise struct { 385 // NoiseLevel - An enum value indicating level of noise. Possible values include: 'NoiseLevelLow', 'NoiseLevelMedium', 'NoiseLevelHigh' 386 NoiseLevel NoiseLevel `json:"noiseLevel,omitempty"` 387 // Value - A number indicating level of noise level ranging from 0 to 1. [0, 0.25) is under exposure. [0.25, 0.75) is good exposure. [0.75, 1] is over exposure. [0, 0.3) is low noise level. [0.3, 0.7) is medium noise level. [0.7, 1] is high noise level. 388 Value *float64 `json:"value,omitempty"` 389 } 390 391 // Occlusion properties describing occlusions on a given face. 392 type Occlusion struct { 393 // ForeheadOccluded - A boolean value indicating whether forehead is occluded. 394 ForeheadOccluded *bool `json:"foreheadOccluded,omitempty"` 395 // EyeOccluded - A boolean value indicating whether eyes are occluded. 396 EyeOccluded *bool `json:"eyeOccluded,omitempty"` 397 // MouthOccluded - A boolean value indicating whether the mouth is occluded. 398 MouthOccluded *bool `json:"mouthOccluded,omitempty"` 399 } 400 401 // OperationStatus operation status object. Operation refers to the asynchronous backend task including 402 // taking a snapshot and applying a snapshot. 403 type OperationStatus struct { 404 autorest.Response `json:"-"` 405 // Status - Operation status: notstarted, running, succeeded, failed. If the operation is requested and waiting to perform, the status is notstarted. If the operation is ongoing in backend, the status is running. Status succeeded means the operation is completed successfully, specifically for snapshot taking operation, it illustrates the snapshot is well taken and ready to apply, and for snapshot applying operation, it presents the target object has finished creating by the snapshot and ready to be used. Status failed is often caused by editing the source object while taking the snapshot or editing the target object while applying the snapshot before completion, see the field "message" to check the failure reason. Possible values include: 'Notstarted', 'Running', 'Succeeded', 'Failed' 406 Status OperationStatusType `json:"status,omitempty"` 407 // CreatedTime - A combined UTC date and time string that describes the time when the operation (take or apply a snapshot) is requested. E.g. 2018-12-25T11:41:02.2331413Z. 408 CreatedTime *date.Time `json:"createdTime,omitempty"` 409 // LastActionTime - A combined UTC date and time string that describes the last time the operation (take or apply a snapshot) is actively migrating data. The lastActionTime will keep increasing until the operation finishes. E.g. 2018-12-25T11:51:27.8705696Z. 410 LastActionTime *date.Time `json:"lastActionTime,omitempty"` 411 // ResourceLocation - When the operation succeeds successfully, for snapshot taking operation the snapshot id will be included in this field, and for snapshot applying operation, the path to get the target object will be returned in this field. 412 ResourceLocation *string `json:"resourceLocation,omitempty"` 413 // Message - Show failure message when operation fails (omitted when operation succeeds). 414 Message *string `json:"message,omitempty"` 415 } 416 417 // PersistedFace personFace object. 418 type PersistedFace struct { 419 autorest.Response `json:"-"` 420 // PersistedFaceID - The persistedFaceId of the target face, which is persisted and will not expire. Different from faceId created by Face - Detect and will expire in 24 hours after the detection call. 421 PersistedFaceID *uuid.UUID `json:"persistedFaceId,omitempty"` 422 // UserData - User-provided data attached to the face. The size limit is 1KB. 423 UserData *string `json:"userData,omitempty"` 424 } 425 426 // Person person object. 427 type Person struct { 428 autorest.Response `json:"-"` 429 // PersonID - PersonId of the target face list. 430 PersonID *uuid.UUID `json:"personId,omitempty"` 431 // PersistedFaceIds - PersistedFaceIds of registered faces in the person. These persistedFaceIds are returned from Person - Add a Person Face, and will not expire. 432 PersistedFaceIds *[]uuid.UUID `json:"persistedFaceIds,omitempty"` 433 // Name - User defined name, maximum length is 128. 434 Name *string `json:"name,omitempty"` 435 // UserData - User specified data. Length should not exceed 16KB. 436 UserData *string `json:"userData,omitempty"` 437 } 438 439 // PersonGroup person group object. 440 type PersonGroup struct { 441 autorest.Response `json:"-"` 442 // PersonGroupID - PersonGroupId of the target person group. 443 PersonGroupID *string `json:"personGroupId,omitempty"` 444 // RecognitionModel - Possible values include: 'Recognition01', 'Recognition02', 'Recognition03' 445 RecognitionModel RecognitionModel `json:"recognitionModel,omitempty"` 446 // Name - User defined name, maximum length is 128. 447 Name *string `json:"name,omitempty"` 448 // UserData - User specified data. Length should not exceed 16KB. 449 UserData *string `json:"userData,omitempty"` 450 } 451 452 // Rectangle a rectangle within which a face can be found 453 type Rectangle struct { 454 // Width - The width of the rectangle, in pixels. 455 Width *int32 `json:"width,omitempty"` 456 // Height - The height of the rectangle, in pixels. 457 Height *int32 `json:"height,omitempty"` 458 // Left - The distance from the left edge if the image to the left edge of the rectangle, in pixels. 459 Left *int32 `json:"left,omitempty"` 460 // Top - The distance from the top edge if the image to the top edge of the rectangle, in pixels. 461 Top *int32 `json:"top,omitempty"` 462 } 463 464 // SimilarFace response body for find similar face operation. 465 type SimilarFace struct { 466 // FaceID - FaceId of candidate face when find by faceIds. faceId is created by Face - Detect and will expire 24 hours after the detection call 467 FaceID *uuid.UUID `json:"faceId,omitempty"` 468 // PersistedFaceID - PersistedFaceId of candidate face when find by faceListId. persistedFaceId in face list is persisted and will not expire. As showed in below response 469 PersistedFaceID *uuid.UUID `json:"persistedFaceId,omitempty"` 470 // Confidence - Similarity confidence of the candidate face. The higher confidence, the more similar. Range between [0,1]. 471 Confidence *float64 `json:"confidence,omitempty"` 472 } 473 474 // Snapshot snapshot object. 475 type Snapshot struct { 476 autorest.Response `json:"-"` 477 // ID - Snapshot id. 478 ID *uuid.UUID `json:"id,omitempty"` 479 // Account - Azure Cognitive Service Face account id of the subscriber who created the snapshot by Snapshot - Take. 480 Account *string `json:"account,omitempty"` 481 // Type - Type of the source object in the snapshot, specified by the subscriber who created the snapshot when calling Snapshot - Take. Currently FaceList, PersonGroup, LargeFaceList and LargePersonGroup are supported. Possible values include: 'SnapshotObjectTypeFaceList', 'SnapshotObjectTypeLargeFaceList', 'SnapshotObjectTypeLargePersonGroup', 'SnapshotObjectTypePersonGroup' 482 Type SnapshotObjectType `json:"type,omitempty"` 483 // ApplyScope - Array of the target Face subscription ids for the snapshot, specified by the user who created the snapshot when calling Snapshot - Take. For each snapshot, only subscriptions included in the applyScope of Snapshot - Take can apply it. 484 ApplyScope *[]uuid.UUID `json:"applyScope,omitempty"` 485 // UserData - User specified data about the snapshot for any purpose. Length should not exceed 16KB. 486 UserData *string `json:"userData,omitempty"` 487 // CreatedTime - A combined UTC date and time string that describes the created time of the snapshot. E.g. 2018-12-25T11:41:02.2331413Z. 488 CreatedTime *date.Time `json:"createdTime,omitempty"` 489 // LastUpdateTime - A combined UTC date and time string that describes the last time when the snapshot was created or updated by Snapshot - Update. E.g. 2018-12-25T11:51:27.8705696Z. 490 LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` 491 } 492 493 // TakeSnapshotRequest request body for taking snapshot operation. 494 type TakeSnapshotRequest struct { 495 // Type - User specified type for the source object to take snapshot from. Currently FaceList, PersonGroup, LargeFaceList and LargePersonGroup are supported. Possible values include: 'SnapshotObjectTypeFaceList', 'SnapshotObjectTypeLargeFaceList', 'SnapshotObjectTypeLargePersonGroup', 'SnapshotObjectTypePersonGroup' 496 Type SnapshotObjectType `json:"type,omitempty"` 497 // ObjectID - User specified source object id to take snapshot from. 498 ObjectID *string `json:"objectId,omitempty"` 499 // ApplyScope - User specified array of target Face subscription ids for the snapshot. For each snapshot, only subscriptions included in the applyScope of Snapshot - Take can apply it. 500 ApplyScope *[]uuid.UUID `json:"applyScope,omitempty"` 501 // UserData - User specified data about the snapshot for any purpose. Length should not exceed 16KB. 502 UserData *string `json:"userData,omitempty"` 503 } 504 505 // TrainingStatus training status object. 506 type TrainingStatus struct { 507 autorest.Response `json:"-"` 508 // Status - Training status: notstarted, running, succeeded, failed. If the training process is waiting to perform, the status is notstarted. If the training is ongoing, the status is running. Status succeed means this person group or large person group is ready for Face - Identify, or this large face list is ready for Face - Find Similar. Status failed is often caused by no person or no persisted face exist in the person group or large person group, or no persisted face exist in the large face list. Possible values include: 'TrainingStatusTypeNonstarted', 'TrainingStatusTypeRunning', 'TrainingStatusTypeSucceeded', 'TrainingStatusTypeFailed' 509 Status TrainingStatusType `json:"status,omitempty"` 510 // Created - A combined UTC date and time string that describes the created time of the person group, large person group or large face list. 511 Created *date.Time `json:"createdDateTime,omitempty"` 512 // LastAction - A combined UTC date and time string that describes the last modify time of the person group, large person group or large face list, could be null value when the group is not successfully trained. 513 LastAction *date.Time `json:"lastActionDateTime,omitempty"` 514 // LastSuccessfulTraining - A combined UTC date and time string that describes the last successful training time of the person group, large person group or large face list. 515 LastSuccessfulTraining *date.Time `json:"lastSuccessfulTrainingDateTime,omitempty"` 516 // Message - Show failure message when training failed (omitted when training succeed). 517 Message *string `json:"message,omitempty"` 518 } 519 520 // UpdateFaceRequest request to update face data. 521 type UpdateFaceRequest struct { 522 // UserData - User-provided data attached to the face. The size limit is 1KB. 523 UserData *string `json:"userData,omitempty"` 524 } 525 526 // UpdateSnapshotRequest request body for updating a snapshot, with a combination of user defined apply 527 // scope and user specified data. 528 type UpdateSnapshotRequest struct { 529 // ApplyScope - Array of the target Face subscription ids for the snapshot, specified by the user who created the snapshot when calling Snapshot - Take. For each snapshot, only subscriptions included in the applyScope of Snapshot - Take can apply it. 530 ApplyScope *[]uuid.UUID `json:"applyScope,omitempty"` 531 // UserData - User specified data about the snapshot for any purpose. Length should not exceed 16KB. 532 UserData *string `json:"userData,omitempty"` 533 } 534 535 // VerifyFaceToFaceRequest request body for face to face verification. 536 type VerifyFaceToFaceRequest struct { 537 // FaceID1 - FaceId of the first face, comes from Face - Detect 538 FaceID1 *uuid.UUID `json:"faceId1,omitempty"` 539 // FaceID2 - FaceId of the second face, comes from Face - Detect 540 FaceID2 *uuid.UUID `json:"faceId2,omitempty"` 541 } 542 543 // VerifyFaceToPersonRequest request body for face to person verification. 544 type VerifyFaceToPersonRequest struct { 545 // FaceID - FaceId of the face, comes from Face - Detect 546 FaceID *uuid.UUID `json:"faceId,omitempty"` 547 // PersonGroupID - Using existing personGroupId and personId for fast loading a specified person. personGroupId is created in PersonGroup - Create. Parameter personGroupId and largePersonGroupId should not be provided at the same time. 548 PersonGroupID *string `json:"personGroupId,omitempty"` 549 // LargePersonGroupID - Using existing largePersonGroupId and personId for fast loading a specified person. largePersonGroupId is created in LargePersonGroup - Create. Parameter personGroupId and largePersonGroupId should not be provided at the same time. 550 LargePersonGroupID *string `json:"largePersonGroupId,omitempty"` 551 // PersonID - Specify a certain person in a person group or a large person group. personId is created in PersonGroup Person - Create or LargePersonGroup Person - Create. 552 PersonID *uuid.UUID `json:"personId,omitempty"` 553 } 554 555 // VerifyResult result of the verify operation. 556 type VerifyResult struct { 557 autorest.Response `json:"-"` 558 // IsIdentical - True if the two faces belong to the same person or the face belongs to the person, otherwise false. 559 IsIdentical *bool `json:"isIdentical,omitempty"` 560 // Confidence - A number indicates the similarity confidence of whether two faces belong to the same person, or whether the face belongs to the person. By default, isIdentical is set to True if similarity confidence is greater than or equal to 0.5. This is useful for advanced users to override "isIdentical" and fine-tune the result on their own data. 561 Confidence *float64 `json:"confidence,omitempty"` 562 } 563