diff --git a/sdk/cognitiveservices/cognitiveservices-face/LICENSE.txt b/sdk/cognitiveservices/cognitiveservices-face/LICENSE.txt index ea8fb1516028..2d3163745319 100644 --- a/sdk/cognitiveservices/cognitiveservices-face/LICENSE.txt +++ b/sdk/cognitiveservices/cognitiveservices-face/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2020 Microsoft +Copyright (c) 2021 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/cognitiveservices/cognitiveservices-face/README.md b/sdk/cognitiveservices/cognitiveservices-face/README.md index 343c6a481fcb..d5234208dafc 100644 --- a/sdk/cognitiveservices/cognitiveservices-face/README.md +++ b/sdk/cognitiveservices/cognitiveservices-face/README.md @@ -15,50 +15,49 @@ npm install @azure/cognitiveservices-face ### How to use -#### nodejs - Authentication, client creation and list personGroupPerson as an example written in TypeScript. +#### nodejs - client creation and list personGroupPerson as an example written in TypeScript. -##### Install @azure/ms-rest-azure-js +##### Install @azure/ms-rest-nodeauth +- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`. ```bash -npm install @azure/ms-rest-azure-js +npm install @azure/ms-rest-nodeauth@"^3.0.0" ``` ##### Sample code -The following sample detects the facial features on the given image. To know more, refer to the [Azure Documentation on Face APIs](https://docs.microsoft.com/azure/cognitive-services/face/overview) - -```javascript -const { FaceClient, FaceModels } = require("@azure/cognitiveservices-face"); -const { CognitiveServicesCredentials } = require("@azure/ms-rest-azure-js"); - -async function main() { - const faceKey = process.env["faceKey"] || ""; - const faceEndPoint = process.env["faceEndPoint"] || ""; - const cognitiveServiceCredentials = new CognitiveServicesCredentials(faceKey); - const client = new FaceClient(cognitiveServiceCredentials, faceEndPoint); - const url = - "https://pbs.twimg.com/profile_images/3354326900/3a5168f2b45c07d0965098be1a4e3007.jpeg"; - const options = { - returnFaceLandmarks: true - }; - client.face - .detectWithUrl(url, options) - .then(result => { - console.log("The result is: "); - console.log(result); - }) - .catch(err => { - console.log("An error occurred:"); - console.error(err); - }); -} - -main(); + +While the below sample uses the interactive login, other authentication options can be found in the [README.md file of @azure/ms-rest-nodeauth](https://www.npmjs.com/package/@azure/ms-rest-nodeauth) package +```typescript +const msRestNodeAuth = require("@azure/ms-rest-nodeauth"); +const { FaceClient } = require("@azure/cognitiveservices-face"); +const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; + +msRestNodeAuth.interactiveLogin().then((creds) => { + const client = new FaceClient(creds, subscriptionId); + const personGroupId = "testpersonGroupId"; + const start = "teststart"; + const top = 1; + client.personGroupPerson.list(personGroupId, start, top).then((result) => { + console.log("The result is:"); + console.log(result); + }); +}).catch((err) => { + console.error(err); +}); ``` #### browser - Authentication, client creation and list personGroupPerson as an example written in JavaScript. +##### Install @azure/ms-rest-browserauth + +```bash +npm install @azure/ms-rest-browserauth +``` + ##### Sample code +See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. + - index.html ```html @@ -66,35 +65,31 @@ main(); @azure/cognitiveservices-face sample + @@ -105,4 +100,4 @@ main(); - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcognitiveservices%2Fcognitiveservices-face%2FREADME.png) +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/cognitiveservices/cognitiveservices-face/README.png) diff --git a/sdk/cognitiveservices/cognitiveservices-face/rollup.config.js b/sdk/cognitiveservices/cognitiveservices-face/rollup.config.js index 7473944f8d56..11e8f0ddd355 100644 --- a/sdk/cognitiveservices/cognitiveservices-face/rollup.config.js +++ b/sdk/cognitiveservices/cognitiveservices-face/rollup.config.js @@ -21,8 +21,8 @@ const config = { "@azure/ms-rest-azure-js": "msRestAzure" }, banner: `/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. diff --git a/sdk/cognitiveservices/cognitiveservices-face/src/faceClient.ts b/sdk/cognitiveservices/cognitiveservices-face/src/faceClient.ts index 9638aeeb2bd1..6f7a8ea0d56b 100644 --- a/sdk/cognitiveservices/cognitiveservices-face/src/faceClient.ts +++ b/sdk/cognitiveservices/cognitiveservices-face/src/faceClient.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is diff --git a/sdk/cognitiveservices/cognitiveservices-face/src/faceClientContext.ts b/sdk/cognitiveservices/cognitiveservices-face/src/faceClientContext.ts index 346c24eea8ff..a8b19c8e3b05 100644 --- a/sdk/cognitiveservices/cognitiveservices-face/src/faceClientContext.ts +++ b/sdk/cognitiveservices/cognitiveservices-face/src/faceClientContext.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is diff --git a/sdk/cognitiveservices/cognitiveservices-face/src/models/faceListOperationsMappers.ts b/sdk/cognitiveservices/cognitiveservices-face/src/models/faceListOperationsMappers.ts index 5267f02f0159..30e09519c8c4 100644 --- a/sdk/cognitiveservices/cognitiveservices-face/src/models/faceListOperationsMappers.ts +++ b/sdk/cognitiveservices/cognitiveservices-face/src/models/faceListOperationsMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. diff --git a/sdk/cognitiveservices/cognitiveservices-face/src/models/faceMappers.ts b/sdk/cognitiveservices/cognitiveservices-face/src/models/faceMappers.ts index 23d160bab9f6..489f8ccf386b 100644 --- a/sdk/cognitiveservices/cognitiveservices-face/src/models/faceMappers.ts +++ b/sdk/cognitiveservices/cognitiveservices-face/src/models/faceMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -30,6 +30,7 @@ export { IdentifyResult, ImageUrl, Makeup, + Mask, Noise, Occlusion, SimilarFace, diff --git a/sdk/cognitiveservices/cognitiveservices-face/src/models/index.ts b/sdk/cognitiveservices/cognitiveservices-face/src/models/index.ts index 2368ff4225cb..77f2e140d5e7 100644 --- a/sdk/cognitiveservices/cognitiveservices-face/src/models/index.ts +++ b/sdk/cognitiveservices/cognitiveservices-face/src/models/index.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -159,7 +159,7 @@ export interface Hair { } /** - * Properties describing present makeups on a given face. + * Properties describing the presence of makeup on a given face. */ export interface Makeup { /** @@ -250,6 +250,21 @@ export interface Noise { value?: number; } +/** + * Properties describing the presence of a mask on a given face. + */ +export interface Mask { + /** + * Mask type if any of the face. Possible values include: 'noMask', 'faceMask', + * 'otherMaskOrOcclusion', 'uncertain' + */ + type?: MaskType; + /** + * A boolean value indicating whether nose and mouth are covered. + */ + noseAndMouthCovered?: boolean; +} + /** * Face Attributes */ @@ -288,7 +303,7 @@ export interface FaceAttributes { */ hair?: Hair; /** - * Properties describing present makeups on a given face. + * Properties describing the presence of makeup on a given face. */ makeup?: Makeup; /** @@ -311,6 +326,10 @@ export interface FaceAttributes { * Properties describing noise level of the image. */ noise?: Noise; + /** + * Properties describing the presence of a mask on a given face. + */ + mask?: Mask; } /** @@ -319,8 +338,8 @@ export interface FaceAttributes { export interface DetectedFace { faceId?: string; /** - * Possible values include: 'recognition_01', 'recognition_02', 'recognition_03'. Default value: - * 'recognition_01'. + * Possible values include: 'recognition_01', 'recognition_02', 'recognition_03', + * 'recognition_04'. Default value: 'recognition_01'. */ recognitionModel?: RecognitionModel; faceRectangle: FaceRectangle; @@ -334,7 +353,8 @@ export interface DetectedFace { export interface FindSimilarRequest { /** * 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 + * that this faceId is not persisted and will expire at the time specified by faceIdTimeToLive + * after the detection call */ faceId: string; /** @@ -352,8 +372,9 @@ export interface FindSimilarRequest { largeFaceListId?: string; /** * 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. + * expire at the time specified by faceIdTimeToLive 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. */ faceIds?: string[]; /** @@ -373,7 +394,7 @@ export interface FindSimilarRequest { export interface SimilarFace { /** * FaceId of candidate face when find by faceIds. faceId is created by Face - Detect and will - * expire 24 hours after the detection call + * expire at the time specified by faceIdTimeToLive after the detection call */ faceId?: string; /** @@ -539,7 +560,8 @@ export interface VerifyResult { export interface PersistedFace { /** * 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. + * faceId created by Face - Detect and will expire in at the time specified by faceIdTimeToLive + * after the detection call. */ persistedFaceId: string; /** @@ -569,8 +591,8 @@ export interface NameAndUserDataContract { */ export interface MetaDataContract extends NameAndUserDataContract { /** - * Possible values include: 'recognition_01', 'recognition_02', 'recognition_03'. Default value: - * 'recognition_01'. + * Possible values include: 'recognition_01', 'recognition_02', 'recognition_03', + * 'recognition_04'. Default value: 'recognition_01'. */ recognitionModel?: RecognitionModel; } @@ -850,8 +872,9 @@ export interface FaceFindSimilarOptionalParams extends msRest.RequestOptionsBase largeFaceListId?: string; /** * 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. + * expire at the time specified by faceIdTimeToLive 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. */ faceIds?: string[]; /** @@ -906,9 +929,11 @@ export interface FaceDetectWithUrlOptionalParams extends msRest.RequestOptionsBa returnFaceLandmarks?: boolean; /** * Analyze and return the one or more specified face attributes in the comma-separated string - * like "returnFaceAttributes=age,gender". Supported face attributes include age, gender, - * headPose, smile, facialHair, glasses and emotion. Note that each face attribute analysis has - * additional computational and time cost. + * like "returnFaceAttributes=age,gender". The available attributes depends on the + * 'detectionModel' specified. 'detection_01' supports age, gender, headPose, smile, facialHair, + * glasses, emotion, hair, makeup, occlusion, accessories, blur, exposure, and noise. While + * 'detection_02' does not support any attributes and 'detection_03' only supports mask. Note + * that each face attribute analysis has additional computational and time cost. */ returnFaceAttributes?: FaceAttributeType[]; /** @@ -917,7 +942,7 @@ export interface FaceDetectWithUrlOptionalParams extends msRest.RequestOptionsBa * name can be provided when performing Face - Detect or (Large)FaceList - Create or * (Large)PersonGroup - Create. The default value is 'recognition_01', if latest model needed, * please explicitly specify the model you need. Possible values include: 'recognition_01', - * 'recognition_02', 'recognition_03'. Default value: 'recognition_01'. + * 'recognition_02', 'recognition_03', 'recognition_04'. Default value: 'recognition_01'. */ recognitionModel?: RecognitionModel; /** @@ -930,9 +955,14 @@ export interface FaceDetectWithUrlOptionalParams extends msRest.RequestOptionsBa * detection model name can be provided when performing Face - Detect or (Large)FaceList - Add * Face or (Large)PersonGroup - Add Face. The default value is 'detection_01', if another model * is needed, please explicitly specify it. Possible values include: 'detection_01', - * 'detection_02'. Default value: 'detection_01'. + * 'detection_02', 'detection_03'. Default value: 'detection_01'. */ detectionModel?: DetectionModel; + /** + * The number of seconds for the faceId being cached. Supported range from 60 seconds up to 86400 + * seconds. The default value is 86400 (24 hours). Default value: 86400. + */ + faceIdTimeToLive?: number; } /** @@ -969,9 +999,11 @@ export interface FaceDetectWithStreamOptionalParams extends msRest.RequestOption returnFaceLandmarks?: boolean; /** * Analyze and return the one or more specified face attributes in the comma-separated string - * like "returnFaceAttributes=age,gender". Supported face attributes include age, gender, - * headPose, smile, facialHair, glasses and emotion. Note that each face attribute analysis has - * additional computational and time cost. + * like "returnFaceAttributes=age,gender". The available attributes depends on the + * 'detectionModel' specified. 'detection_01' supports age, gender, headPose, smile, facialHair, + * glasses, emotion, hair, makeup, occlusion, accessories, blur, exposure, and noise. While + * 'detection_02' does not support any attributes and 'detection_03' only supports mask. Note + * that each face attribute analysis has additional computational and time cost. */ returnFaceAttributes?: FaceAttributeType[]; /** @@ -980,7 +1012,7 @@ export interface FaceDetectWithStreamOptionalParams extends msRest.RequestOption * name can be provided when performing Face - Detect or (Large)FaceList - Create or * (Large)PersonGroup - Create. The default value is 'recognition_01', if latest model needed, * please explicitly specify the model you need. Possible values include: 'recognition_01', - * 'recognition_02', 'recognition_03'. Default value: 'recognition_01'. + * 'recognition_02', 'recognition_03', 'recognition_04'. Default value: 'recognition_01'. */ recognitionModel?: RecognitionModel; /** @@ -993,9 +1025,14 @@ export interface FaceDetectWithStreamOptionalParams extends msRest.RequestOption * detection model name can be provided when performing Face - Detect or (Large)FaceList - Add * Face or (Large)PersonGroup - Add Face. The default value is 'detection_01', if another model * is needed, please explicitly specify it. Possible values include: 'detection_01', - * 'detection_02'. Default value: 'detection_01'. + * 'detection_02', 'detection_03'. Default value: 'detection_01'. */ detectionModel?: DetectionModel; + /** + * The number of seconds for the faceId being cached. Supported range from 60 seconds up to 86400 + * seconds. The default value is 86400 (24 hours). Default value: 86400. + */ + faceIdTimeToLive?: number; } /** @@ -1070,7 +1107,7 @@ export interface PersonGroupPersonAddFaceFromUrlOptionalParams extends msRest.Re * detection model name can be provided when performing Face - Detect or (Large)FaceList - Add * Face or (Large)PersonGroup - Add Face. The default value is 'detection_01', if another model * is needed, please explicitly specify it. Possible values include: 'detection_01', - * 'detection_02'. Default value: 'detection_01'. + * 'detection_02', 'detection_03'. Default value: 'detection_01'. */ detectionModel?: DetectionModel; } @@ -1095,7 +1132,7 @@ export interface PersonGroupPersonAddFaceFromStreamOptionalParams extends msRest * detection model name can be provided when performing Face - Detect or (Large)FaceList - Add * Face or (Large)PersonGroup - Add Face. The default value is 'detection_01', if another model * is needed, please explicitly specify it. Possible values include: 'detection_01', - * 'detection_02'. Default value: 'detection_01'. + * 'detection_02', 'detection_03'. Default value: 'detection_01'. */ detectionModel?: DetectionModel; } @@ -1113,8 +1150,8 @@ export interface PersonGroupCreateOptionalParams extends msRest.RequestOptionsBa */ userData?: string; /** - * Possible values include: 'recognition_01', 'recognition_02', 'recognition_03'. Default value: - * 'recognition_01'. + * Possible values include: 'recognition_01', 'recognition_02', 'recognition_03', + * 'recognition_04'. Default value: 'recognition_01'. */ recognitionModel?: RecognitionModel; } @@ -1176,8 +1213,8 @@ export interface FaceListCreateOptionalParams extends msRest.RequestOptionsBase */ userData?: string; /** - * Possible values include: 'recognition_01', 'recognition_02', 'recognition_03'. Default value: - * 'recognition_01'. + * Possible values include: 'recognition_01', 'recognition_02', 'recognition_03', + * 'recognition_04'. Default value: 'recognition_01'. */ recognitionModel?: RecognitionModel; } @@ -1238,7 +1275,7 @@ export interface FaceListAddFaceFromUrlOptionalParams extends msRest.RequestOpti * detection model name can be provided when performing Face - Detect or (Large)FaceList - Add * Face or (Large)PersonGroup - Add Face. The default value is 'detection_01', if another model * is needed, please explicitly specify it. Possible values include: 'detection_01', - * 'detection_02'. Default value: 'detection_01'. + * 'detection_02', 'detection_03'. Default value: 'detection_01'. */ detectionModel?: DetectionModel; } @@ -1263,7 +1300,7 @@ export interface FaceListAddFaceFromStreamOptionalParams extends msRest.RequestO * detection model name can be provided when performing Face - Detect or (Large)FaceList - Add * Face or (Large)PersonGroup - Add Face. The default value is 'detection_01', if another model * is needed, please explicitly specify it. Possible values include: 'detection_01', - * 'detection_02'. Default value: 'detection_01'. + * 'detection_02', 'detection_03'. Default value: 'detection_01'. */ detectionModel?: DetectionModel; } @@ -1340,7 +1377,7 @@ export interface LargePersonGroupPersonAddFaceFromUrlOptionalParams extends msRe * detection model name can be provided when performing Face - Detect or (Large)FaceList - Add * Face or (Large)PersonGroup - Add Face. The default value is 'detection_01', if another model * is needed, please explicitly specify it. Possible values include: 'detection_01', - * 'detection_02'. Default value: 'detection_01'. + * 'detection_02', 'detection_03'. Default value: 'detection_01'. */ detectionModel?: DetectionModel; } @@ -1365,7 +1402,7 @@ export interface LargePersonGroupPersonAddFaceFromStreamOptionalParams extends m * detection model name can be provided when performing Face - Detect or (Large)FaceList - Add * Face or (Large)PersonGroup - Add Face. The default value is 'detection_01', if another model * is needed, please explicitly specify it. Possible values include: 'detection_01', - * 'detection_02'. Default value: 'detection_01'. + * 'detection_02', 'detection_03'. Default value: 'detection_01'. */ detectionModel?: DetectionModel; } @@ -1383,8 +1420,8 @@ export interface LargePersonGroupCreateOptionalParams extends msRest.RequestOpti */ userData?: string; /** - * Possible values include: 'recognition_01', 'recognition_02', 'recognition_03'. Default value: - * 'recognition_01'. + * Possible values include: 'recognition_01', 'recognition_02', 'recognition_03', + * 'recognition_04'. Default value: 'recognition_01'. */ recognitionModel?: RecognitionModel; } @@ -1446,8 +1483,8 @@ export interface LargeFaceListCreateOptionalParams extends msRest.RequestOptions */ userData?: string; /** - * Possible values include: 'recognition_01', 'recognition_02', 'recognition_03'. Default value: - * 'recognition_01'. + * Possible values include: 'recognition_01', 'recognition_02', 'recognition_03', + * 'recognition_04'. Default value: 'recognition_01'. */ recognitionModel?: RecognitionModel; } @@ -1518,7 +1555,7 @@ export interface LargeFaceListAddFaceFromUrlOptionalParams extends msRest.Reques * detection model name can be provided when performing Face - Detect or (Large)FaceList - Add * Face or (Large)PersonGroup - Add Face. The default value is 'detection_01', if another model * is needed, please explicitly specify it. Possible values include: 'detection_01', - * 'detection_02'. Default value: 'detection_01'. + * 'detection_02', 'detection_03'. Default value: 'detection_01'. */ detectionModel?: DetectionModel; } @@ -1557,7 +1594,7 @@ export interface LargeFaceListAddFaceFromStreamOptionalParams extends msRest.Req * detection model name can be provided when performing Face - Detect or (Large)FaceList - Add * Face or (Large)PersonGroup - Add Face. The default value is 'detection_01', if another model * is needed, please explicitly specify it. Possible values include: 'detection_01', - * 'detection_02'. Default value: 'detection_01'. + * 'detection_02', 'detection_03'. Default value: 'detection_01'. */ detectionModel?: DetectionModel; } @@ -1643,11 +1680,11 @@ export interface SnapshotApplyHeaders { /** * Defines values for RecognitionModel. - * Possible values include: 'recognition_01', 'recognition_02', 'recognition_03' + * Possible values include: 'recognition_01', 'recognition_02', 'recognition_03', 'recognition_04' * @readonly * @enum {string} */ -export type RecognitionModel = 'recognition_01' | 'recognition_02' | 'recognition_03'; +export type RecognitionModel = 'recognition_01' | 'recognition_02' | 'recognition_03' | 'recognition_04'; /** * Defines values for Gender. @@ -1705,6 +1742,14 @@ export type ExposureLevel = 'UnderExposure' | 'GoodExposure' | 'OverExposure'; */ export type NoiseLevel = 'Low' | 'Medium' | 'High'; +/** + * Defines values for MaskType. + * Possible values include: 'noMask', 'faceMask', 'otherMaskOrOcclusion', 'uncertain' + * @readonly + * @enum {string} + */ +export type MaskType = 'noMask' | 'faceMask' | 'otherMaskOrOcclusion' | 'uncertain'; + /** * Defines values for FindSimilarMatchMode. * Possible values include: 'matchPerson', 'matchFace' @@ -1748,19 +1793,19 @@ export type OperationStatusType = 'notstarted' | 'running' | 'succeeded' | 'fail /** * Defines values for FaceAttributeType. * Possible values include: 'age', 'gender', 'headPose', 'smile', 'facialHair', 'glasses', - * 'emotion', 'hair', 'makeup', 'occlusion', 'accessories', 'blur', 'exposure', 'noise' + * 'emotion', 'hair', 'makeup', 'occlusion', 'accessories', 'blur', 'exposure', 'noise', 'mask' * @readonly * @enum {string} */ -export type FaceAttributeType = 'age' | 'gender' | 'headPose' | 'smile' | 'facialHair' | 'glasses' | 'emotion' | 'hair' | 'makeup' | 'occlusion' | 'accessories' | 'blur' | 'exposure' | 'noise'; +export type FaceAttributeType = 'age' | 'gender' | 'headPose' | 'smile' | 'facialHair' | 'glasses' | 'emotion' | 'hair' | 'makeup' | 'occlusion' | 'accessories' | 'blur' | 'exposure' | 'noise' | 'mask'; /** * Defines values for DetectionModel. - * Possible values include: 'detection_01', 'detection_02' + * Possible values include: 'detection_01', 'detection_02', 'detection_03' * @readonly * @enum {string} */ -export type DetectionModel = 'detection_01' | 'detection_02'; +export type DetectionModel = 'detection_01' | 'detection_02' | 'detection_03'; /** * Contains response data for the findSimilar operation. diff --git a/sdk/cognitiveservices/cognitiveservices-face/src/models/largeFaceListOperationsMappers.ts b/sdk/cognitiveservices/cognitiveservices-face/src/models/largeFaceListOperationsMappers.ts index bbed40fc997b..beb311fc96dd 100644 --- a/sdk/cognitiveservices/cognitiveservices-face/src/models/largeFaceListOperationsMappers.ts +++ b/sdk/cognitiveservices/cognitiveservices-face/src/models/largeFaceListOperationsMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. diff --git a/sdk/cognitiveservices/cognitiveservices-face/src/models/largePersonGroupOperationsMappers.ts b/sdk/cognitiveservices/cognitiveservices-face/src/models/largePersonGroupOperationsMappers.ts index 96323652e5c0..8b5a456a9ba7 100644 --- a/sdk/cognitiveservices/cognitiveservices-face/src/models/largePersonGroupOperationsMappers.ts +++ b/sdk/cognitiveservices/cognitiveservices-face/src/models/largePersonGroupOperationsMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. diff --git a/sdk/cognitiveservices/cognitiveservices-face/src/models/largePersonGroupPersonMappers.ts b/sdk/cognitiveservices/cognitiveservices-face/src/models/largePersonGroupPersonMappers.ts index b158abde514a..88cb6d79e8d0 100644 --- a/sdk/cognitiveservices/cognitiveservices-face/src/models/largePersonGroupPersonMappers.ts +++ b/sdk/cognitiveservices/cognitiveservices-face/src/models/largePersonGroupPersonMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. diff --git a/sdk/cognitiveservices/cognitiveservices-face/src/models/mappers.ts b/sdk/cognitiveservices/cognitiveservices-face/src/models/mappers.ts index a4399c639d1c..0c70f9c4b4a3 100644 --- a/sdk/cognitiveservices/cognitiveservices-face/src/models/mappers.ts +++ b/sdk/cognitiveservices/cognitiveservices-face/src/models/mappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -678,6 +678,36 @@ export const Noise: msRest.CompositeMapper = { } }; +export const Mask: msRest.CompositeMapper = { + serializedName: "Mask", + type: { + name: "Composite", + className: "Mask", + modelProperties: { + type: { + nullable: false, + serializedName: "type", + type: { + name: "Enum", + allowedValues: [ + "noMask", + "faceMask", + "otherMaskOrOcclusion", + "uncertain" + ] + } + }, + noseAndMouthCovered: { + nullable: false, + serializedName: "noseAndMouthCovered", + type: { + name: "Boolean" + } + } + } + } +}; + export const FaceAttributes: msRest.CompositeMapper = { serializedName: "FaceAttributes", type: { @@ -792,6 +822,13 @@ export const FaceAttributes: msRest.CompositeMapper = { name: "Composite", className: "Noise" } + }, + mask: { + serializedName: "mask", + type: { + name: "Composite", + className: "Mask" + } } } } diff --git a/sdk/cognitiveservices/cognitiveservices-face/src/models/parameters.ts b/sdk/cognitiveservices/cognitiveservices-face/src/models/parameters.ts index 1c2831e16efd..dbed7d61222b 100644 --- a/sdk/cognitiveservices/cognitiveservices-face/src/models/parameters.ts +++ b/sdk/cognitiveservices/cognitiveservices-face/src/models/parameters.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -53,6 +52,23 @@ export const endpoint: msRest.OperationURLParameter = { }, skipEncoding: true }; +export const faceIdTimeToLive: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "faceIdTimeToLive" + ], + mapper: { + serializedName: "faceIdTimeToLive", + defaultValue: 86400, + constraints: { + InclusiveMaximum: 86400, + InclusiveMinimum: 60 + }, + type: { + name: "Number" + } + } +}; export const faceListId: msRest.OperationURLParameter = { parameterPath: "faceListId", mapper: { @@ -178,7 +194,8 @@ export const returnFaceAttributes: msRest.OperationQueryParameter = { "accessories", "blur", "exposure", - "noise" + "noise", + "mask" ] } } diff --git a/sdk/cognitiveservices/cognitiveservices-face/src/models/personGroupOperationsMappers.ts b/sdk/cognitiveservices/cognitiveservices-face/src/models/personGroupOperationsMappers.ts index 96323652e5c0..8b5a456a9ba7 100644 --- a/sdk/cognitiveservices/cognitiveservices-face/src/models/personGroupOperationsMappers.ts +++ b/sdk/cognitiveservices/cognitiveservices-face/src/models/personGroupOperationsMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. diff --git a/sdk/cognitiveservices/cognitiveservices-face/src/models/personGroupPersonMappers.ts b/sdk/cognitiveservices/cognitiveservices-face/src/models/personGroupPersonMappers.ts index b158abde514a..88cb6d79e8d0 100644 --- a/sdk/cognitiveservices/cognitiveservices-face/src/models/personGroupPersonMappers.ts +++ b/sdk/cognitiveservices/cognitiveservices-face/src/models/personGroupPersonMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. diff --git a/sdk/cognitiveservices/cognitiveservices-face/src/models/snapshotOperationsMappers.ts b/sdk/cognitiveservices/cognitiveservices-face/src/models/snapshotOperationsMappers.ts index d8f46446e597..be8e553e18a7 100644 --- a/sdk/cognitiveservices/cognitiveservices-face/src/models/snapshotOperationsMappers.ts +++ b/sdk/cognitiveservices/cognitiveservices-face/src/models/snapshotOperationsMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. diff --git a/sdk/cognitiveservices/cognitiveservices-face/src/operations/face.ts b/sdk/cognitiveservices/cognitiveservices-face/src/operations/face.ts index b113a61733b6..06d0a8b9fe4c 100644 --- a/sdk/cognitiveservices/cognitiveservices-face/src/operations/face.ts +++ b/sdk/cognitiveservices/cognitiveservices-face/src/operations/face.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -28,14 +27,13 @@ export class Face { /** * Given query face's faceId, to search the similar-looking faces from a faceId array, a face list - * or a large face list. faceId array contains the faces created by [Face - - * Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl), which - * will expire 24 hours after creation. A "faceListId" is created by [FaceList - - * Create](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/create) containing - * persistedFaceIds that will not expire. And a "largeFaceListId" is created by [LargeFaceList - - * Create](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist/create) - * containing persistedFaceIds that will also not expire. Depending on the input the returned - * similar faces list contains faceIds or persistedFaceIds ranked by similarity. + * or a large face list. faceId array contains the faces created by [Face - Detect With + * Url](detectwithurl) or [Face - Detect With Stream](detectwithstream), which will expire at the + * time specified by faceIdTimeToLive after creation. A "faceListId" is created by [FaceList - + * Create](../facelist/create) containing persistedFaceIds that will not expire. And a + * "largeFaceListId" is created by [LargeFaceList - Create](../largefacelist/create) containing + * persistedFaceIds that will also not expire. Depending on the input the returned similar faces + * list contains faceIds or persistedFaceIds ranked by similarity. *
Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the * default mode that it tries to find faces of the same person as possible by using internal * same-person thresholds. It is useful to find a known person's other photos. Note that an empty @@ -45,20 +43,23 @@ export class Face { *
The 'recognitionModel' associated with the query face's faceId should be the same as the * 'recognitionModel' used by the target faceId array, face list or large face list. * @param 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 + * faceId. Note that this faceId is not persisted and will expire at the time specified by + * faceIdTimeToLive after the detection call * @param [options] The optional parameters * @returns Promise */ findSimilar(faceId: string, options?: Models.FaceFindSimilarOptionalParams): Promise; /** * @param 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 + * faceId. Note that this faceId is not persisted and will expire at the time specified by + * faceIdTimeToLive after the detection call * @param callback The callback */ findSimilar(faceId: string, callback: msRest.ServiceCallback): void; /** * @param 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 + * faceId. Note that this faceId is not persisted and will expire at the time specified by + * faceIdTimeToLive after the detection call * @param options The optional parameters * @param callback The callback */ @@ -83,8 +84,7 @@ export class Face { * face from original faces. The messyGroup will not appear in the result if all faces found their * counterparts. * * Group API needs at least 2 candidate faces and 1000 at most. We suggest to try [Face - - * Verify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/verifyfacetoface) when - * you only have 2 candidate faces. + * Verify](verifyfacetoface) when you only have 2 candidate faces. * * The 'recognitionModel' associated with the query faces' faceIds should be the same. * @param faceIds Array of candidate faceId created by Face - Detect. The maximum is 1000 faces * @param [options] The optional parameters @@ -119,10 +119,8 @@ export class Face { * query face and all the faces in the person group (given by personGroupId) or large person group * (given by largePersonGroupId), and return candidate person(s) for that face ranked by similarity * confidence. The person group/large person group should be trained to make it ready for - * identification. See more in [PersonGroup - - * Train](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroup/train) and - * [LargePersonGroup - - * Train](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroup/train). + * identification. See more in [PersonGroup - Train](../persongroup/train) and [LargePersonGroup - + * Train](../largepersongroup/train). *
* * Remarks:
@@ -134,10 +132,8 @@ export class Face { * faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. * * Number of candidates returned is restricted by maxNumOfCandidatesReturned and * confidenceThreshold. If no person is identified, the returned candidates will be an empty array. - * * Try [Face - Find - * Similar](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/findsimilar) when you - * need to find similar faces from a face list/large face list instead of a person group/large - * person group. + * * Try [Face - Find Similar](../face/findsimilar) when you need to find similar faces from a face + * list/large face list instead of a person group/large person group. * * The 'recognitionModel' associated with the query faces' faceIds should be the same as the * 'recognitionModel' used by the target person group or large person group. * @param faceIds Array of query faces faceIds, created by the Face - Detect. Each of the faces are @@ -212,12 +208,10 @@ export class Face { * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, * and attributes.
* * No image will be stored. Only the extracted face feature will be stored on server. The faceId - * is an identifier of the face feature and will be used in [Face - - * Identify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/identify), [Face - - * Verify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/verifyfacetoface), and - * [Face - Find - * Similar](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/findsimilar). The - * stored face feature(s) will expire and be deleted 24 hours after the original detection call. + * is an identifier of the face feature and will be used in [Face - Identify](../face/identify), + * [Face - Verify](../face/verifyfacetoface), and [Face - Find Similar](../face/findsimilar). The + * stored face feature(s) will expire and be deleted at the time specified by faceIdTimeToLive + * after the original detection call. * * Optional parameters include faceId, landmarks, and attributes. Attributes include age, gender, * headPose, smile, facialHair, glasses, emotion, hair, makeup, occlusion, accessories, blur, * exposure and noise. Some of the results returned for specific attributes may not be highly @@ -226,11 +220,8 @@ export class Face { * from 1KB to 6MB. * * Up to 100 faces can be returned for an image. Faces are ranked by face rectangle size from * large to small. - * * For optimal results when querying [Face - - * Identify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/identify), [Face - - * Verify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/verifyfacetoface), and - * [Face - Find - * Similar](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/findsimilar) + * * For optimal results when querying [Face - Identify](../face/identify), [Face - + * Verify](../face/verifyfacetoface), and [Face - Find Similar](../face/findsimilar) * ('returnFaceId' is true), please use faces that are: frontal, clear, and with a minimum size of * 200x200 pixels (100 pixels between eyes). * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. @@ -238,32 +229,15 @@ export class Face { * face size. * * Different 'detectionModel' values can be provided. To use and compare different detection * models, please refer to [How to specify a detection - * model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) - * | Model | Recommended use-case(s) | - * | ---------- | -------- | - * | 'detection_01': | The default detection model for [Face - - * Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl). - * Recommend for near frontal face detection. For scenarios with exceptionally large angle - * (head-pose) faces, occluded faces or wrong image orientation, the faces in such cases may not be - * detected. | - * | 'detection_02': | Detection model released in 2019 May with improved accuracy especially on - * small, side and blurry faces. | + * model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model). * * * Different 'recognitionModel' values are provided. If follow-up operations like Verify, * Identify, Find Similar are needed, please specify the recognition model with 'recognitionModel' * parameter. The default value for 'recognitionModel' is 'recognition_01', if latest model needed, * please explicitly specify the model you need in this parameter. Once specified, the detected * faceIds will be associated with the specified recognition model. More details, please refer to - * [How to specify a recognition - * model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-recognition-model) - * | Model | Recommended use-case(s) | - * | ---------- | -------- | - * | 'recognition_01': | The default recognition model for [Face - - * Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl). All - * those faceIds created before 2019 March are bonded with this recognition model. | - * | 'recognition_02': | Recognition model released in 2019 March. | - * | 'recognition_03': | Recognition model released in 2020 May. 'recognition_03' is recommended - * since its overall accuracy is improved compared with 'recognition_01' and 'recognition_02'. | + * [Specify a recognition + * model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-recognition-model). * @param url Publicly reachable URL of an image * @param [options] The optional parameters * @returns Promise @@ -329,12 +303,10 @@ export class Face { * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, * and attributes.
* * No image will be stored. Only the extracted face feature will be stored on server. The faceId - * is an identifier of the face feature and will be used in [Face - - * Identify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/identify), [Face - - * Verify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/verifyfacetoface), and - * [Face - Find - * Similar](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/findsimilar). The - * stored face feature(s) will expire and be deleted 24 hours after the original detection call. + * is an identifier of the face feature and will be used in [Face - Identify](../face/identify), + * [Face - Verify](../face/verifyfacetoface), and [Face - Find Similar](../face/findsimilar). The + * stored face feature(s) will expire and be deleted at the time specified by faceIdTimeToLive + * after the original detection call. * * Optional parameters include faceId, landmarks, and attributes. Attributes include age, gender, * headPose, smile, facialHair, glasses, emotion, hair, makeup, occlusion, accessories, blur, * exposure and noise. Some of the results returned for specific attributes may not be highly @@ -343,11 +315,8 @@ export class Face { * from 1KB to 6MB. * * Up to 100 faces can be returned for an image. Faces are ranked by face rectangle size from * large to small. - * * For optimal results when querying [Face - - * Identify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/identify), [Face - - * Verify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/verifyfacetoface), and - * [Face - Find - * Similar](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/findsimilar) + * * For optimal results when querying [Face - Identify](../face/identify), [Face - + * Verify](../face/verifyfacetoface), and [Face - Find Similar](../face/findsimilar) * ('returnFaceId' is true), please use faces that are: frontal, clear, and with a minimum size of * 200x200 pixels (100 pixels between eyes). * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. @@ -356,31 +325,13 @@ export class Face { * * Different 'detectionModel' values can be provided. To use and compare different detection * models, please refer to [How to specify a detection * model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) - * | Model | Recommended use-case(s) | - * | ---------- | -------- | - * | 'detection_01': | The default detection model for [Face - - * Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl). - * Recommend for near frontal face detection. For scenarios with exceptionally large angle - * (head-pose) faces, occluded faces or wrong image orientation, the faces in such cases may not be - * detected. | - * | 'detection_02': | Detection model released in 2019 May with improved accuracy especially on - * small, side and blurry faces. | - * * * Different 'recognitionModel' values are provided. If follow-up operations like Verify, * Identify, Find Similar are needed, please specify the recognition model with 'recognitionModel' * parameter. The default value for 'recognitionModel' is 'recognition_01', if latest model needed, * please explicitly specify the model you need in this parameter. Once specified, the detected * faceIds will be associated with the specified recognition model. More details, please refer to - * [How to specify a recognition - * model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-recognition-model) - * | Model | Recommended use-case(s) | - * | ---------- | -------- | - * | 'recognition_01': | The default recognition model for [Face - - * Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl). All - * those faceIds created before 2019 March are bonded with this recognition model. | - * | 'recognition_02': | Recognition model released in 2019 March. | - * | 'recognition_03': | Recognition model released in 2020 May. 'recognition_03' is recommended - * since its overall accuracy is improved compared with 'recognition_01' and 'recognition_02'. | + * [Specify a recognition + * model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-recognition-model). * @param image An image stream. * @param [options] The optional parameters * @returns Promise @@ -585,7 +536,8 @@ const detectWithUrlOperationSpec: msRest.OperationSpec = { Parameters.returnFaceAttributes, Parameters.recognitionModel, Parameters.returnRecognitionModel, - Parameters.detectionModel + Parameters.detectionModel, + Parameters.faceIdTimeToLive ], requestBody: { parameterPath: { @@ -665,7 +617,8 @@ const detectWithStreamOperationSpec: msRest.OperationSpec = { Parameters.returnFaceAttributes, Parameters.recognitionModel, Parameters.returnRecognitionModel, - Parameters.detectionModel + Parameters.detectionModel, + Parameters.faceIdTimeToLive ], requestBody: { parameterPath: "image", diff --git a/sdk/cognitiveservices/cognitiveservices-face/src/operations/faceListOperations.ts b/sdk/cognitiveservices/cognitiveservices-face/src/operations/faceListOperations.ts index 3264fa5628f5..6020bff56fcb 100644 --- a/sdk/cognitiveservices/cognitiveservices-face/src/operations/faceListOperations.ts +++ b/sdk/cognitiveservices/cognitiveservices-face/src/operations/faceListOperations.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -30,33 +29,24 @@ export class FaceListOperations { * Create an empty face list with user-specified faceListId, name, an optional userData and * recognitionModel. Up to 64 face lists are allowed in one subscription. *
Face list is a list of faces, up to 1,000 faces, and used by [Face - Find - * Similar](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/findsimilar). - *
After creation, user should use [FaceList - Add - * Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/addfacefromurl) to + * Similar](../face/findsimilar). + *
After creation, user should use [FaceList - Add Face](../facelist/addfacefromurl) to * import the faces. No image will be stored. Only the extracted face features are stored on server - * until [FaceList - - * Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/delete) is called. + * until [FaceList - Delete](../facelist/delete) is called. *
Find Similar is used for scenario like finding celebrity-like faces, similar face * filtering, or as a light way face identification. But if the actual use is to identify person, - * please use [PersonGroup](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroup) - * / - * [LargePersonGroup](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroup) - * and [Face - Identify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/identify). - *
Please consider - * [LargeFaceList](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist) when - * the face number is large. It can support up to 1,000,000 faces. + * please use [PersonGroup](../persongroup) / [LargePersonGroup](../largepersongroup) and [Face - + * Identify](../face/identify). + *
Please consider [LargeFaceList](../largefacelist) when the face number is large. It can + * support up to 1,000,000 faces. *
'recognitionModel' should be specified to associate with this face list. The default value * for 'recognitionModel' is 'recognition_01', if the latest model needed, please explicitly * specify the model you need in this parameter. New faces that are added to an existing face list * will use the recognition model that's already associated with the collection. Existing face * features in a face list can't be updated to features extracted by another version of recognition * model. - * * 'recognition_01': The default recognition model for [FaceList- - * Create](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/create). All those - * face lists created before 2019 March are bonded with this recognition model. - * * 'recognition_02': Recognition model released in 2019 March. - * * 'recognition_03': Recognition model released in 2020 May. 'recognition_03' is recommended - * since its overall accuracy is improved compared with 'recognition_01' and 'recognition_02'. + * Please Refer to [Specify a face recognition + * model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-recognition-model). * @param faceListId Id referencing a particular face list. * @param [options] The optional parameters * @returns Promise @@ -169,8 +159,7 @@ export class FaceListOperations { /** * List face lists’ faceListId, name, userData and recognitionModel.
- * To get face information inside faceList use [FaceList - - * Get](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/get) + * To get face information inside faceList use [FaceList - Get](../facelist/get) * @param [options] The optional parameters * @returns Promise */ @@ -232,11 +221,9 @@ export class FaceListOperations { *
To deal with an image contains multiple faces, input face can be specified as an image * with a targetFace rectangle. It returns a persistedFaceId representing the added face. No image * will be stored. Only the extracted face feature will be stored on server until [FaceList - - * Delete Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/deleteface) or - * [FaceList - Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/delete) - * is called. + * Delete Face](../facelist/deleteface) or [FaceList - Delete](../facelist/delete) is called. *
Note persistedFaceId is different from faceId generated by [Face - - * Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl). + * Detect](../face/detectwithurl). * * Higher face image quality means better detection and recognition precision. Please consider * high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or * bigger. @@ -244,8 +231,7 @@ export class FaceListOperations { * from 1KB to 6MB. * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an * error. If the provided "targetFace" rectangle is not returned from [Face - - * Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl), there’s - * no guarantee to detect and add the face successfully. + * Detect](../face/detectwithurl), there’s no guarantee to detect and add the face successfully. * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions * will cause failures. * * Adding/deleting faces to/from a same face list are processed sequentially and to/from @@ -255,16 +241,7 @@ export class FaceListOperations { * face size. * * Different 'detectionModel' values can be provided. To use and compare different detection * models, please refer to [How to specify a detection - * model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) - * | Model | Recommended use-case(s) | - * | ---------- | -------- | - * | 'detection_01': | The default detection model for [FaceList - Add - * Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/addfacefromurl). - * Recommend for near frontal face detection. For scenarios with exceptionally large angle - * (head-pose) faces, occluded faces or wrong image orientation, the faces in such cases may not be - * detected. | - * | 'detection_02': | Detection model released in 2019 May with improved accuracy especially on - * small, side and blurry faces. | + * model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model). * @param faceListId Id referencing a particular face list. * @param url Publicly reachable URL of an image * @param [options] The optional parameters @@ -300,11 +277,9 @@ export class FaceListOperations { *
To deal with an image contains multiple faces, input face can be specified as an image * with a targetFace rectangle. It returns a persistedFaceId representing the added face. No image * will be stored. Only the extracted face feature will be stored on server until [FaceList - - * Delete Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/deleteface) or - * [FaceList - Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/delete) - * is called. + * Delete Face](../facelist/deleteface) or [FaceList - Delete](../facelist/delete) is called. *
Note persistedFaceId is different from faceId generated by [Face - - * Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl). + * Detect](../face/detectwithurl). * * Higher face image quality means better detection and recognition precision. Please consider * high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or * bigger. @@ -312,8 +287,7 @@ export class FaceListOperations { * from 1KB to 6MB. * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an * error. If the provided "targetFace" rectangle is not returned from [Face - - * Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl), there’s - * no guarantee to detect and add the face successfully. + * Detect](../face/detectwithurl), there’s no guarantee to detect and add the face successfully. * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions * will cause failures. * * Adding/deleting faces to/from a same face list are processed sequentially and to/from @@ -323,16 +297,7 @@ export class FaceListOperations { * face size. * * Different 'detectionModel' values can be provided. To use and compare different detection * models, please refer to [How to specify a detection - * model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) - * | Model | Recommended use-case(s) | - * | ---------- | -------- | - * | 'detection_01': | The default detection model for [FaceList - Add - * Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/addfacefromurl). - * Recommend for near frontal face detection. For scenarios with exceptionally large angle - * (head-pose) faces, occluded faces or wrong image orientation, the faces in such cases may not be - * detected. | - * | 'detection_02': | Detection model released in 2019 May with improved accuracy especially on - * small, side and blurry faces. | + * model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model). * @param faceListId Id referencing a particular face list. * @param image An image stream. * @param [options] The optional parameters diff --git a/sdk/cognitiveservices/cognitiveservices-face/src/operations/index.ts b/sdk/cognitiveservices/cognitiveservices-face/src/operations/index.ts index 3a6f9ae466be..5668f8550fe4 100644 --- a/sdk/cognitiveservices/cognitiveservices-face/src/operations/index.ts +++ b/sdk/cognitiveservices/cognitiveservices-face/src/operations/index.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is diff --git a/sdk/cognitiveservices/cognitiveservices-face/src/operations/largeFaceListOperations.ts b/sdk/cognitiveservices/cognitiveservices-face/src/operations/largeFaceListOperations.ts index 3ab5c4b30456..a77ba7f90b9a 100644 --- a/sdk/cognitiveservices/cognitiveservices-face/src/operations/largeFaceListOperations.ts +++ b/sdk/cognitiveservices/cognitiveservices-face/src/operations/largeFaceListOperations.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -30,34 +29,23 @@ export class LargeFaceListOperations { * Create an empty large face list with user-specified largeFaceListId, name, an optional userData * and recognitionModel. *
Large face list is a list of faces, up to 1,000,000 faces, and used by [Face - Find - * Similar](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/findsimilar). + * Similar](../face/findsimilar). *
After creation, user should use [LargeFaceList Face - - * Add](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist/addfacefromurl) to - * import the faces and [LargeFaceList - - * Train](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist/train) to make - * it ready for [Face - Find - * Similar](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/findsimilar). No image - * will be stored. Only the extracted face features are stored on server until [LargeFaceList - - * Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist/delete) is - * called. + * Add](../largefacelist/addfacefromurl) to import the faces and [LargeFaceList - + * Train](../largefacelist/train) to make it ready for [Face - Find Similar](../face/findsimilar). + * No image will be stored. Only the extracted face features are stored on server until + * [LargeFaceList - Delete](../largefacelist/delete) is called. *
Find Similar is used for scenario like finding celebrity-like faces, similar face * filtering, or as a light way face identification. But if the actual use is to identify person, - * please use [PersonGroup](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroup) - * / - * [LargePersonGroup](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroup) - * and [Face - Identify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/identify). + * please use [PersonGroup](../persongroup) / [LargePersonGroup](../largepersongroup) and [Face - + * Identify](../face/identify). *
'recognitionModel' should be specified to associate with this large face list. The default * value for 'recognitionModel' is 'recognition_01', if the latest model needed, please explicitly * specify the model you need in this parameter. New faces that are added to an existing large face * list will use the recognition model that's already associated with the collection. Existing face * features in a large face list can't be updated to features extracted by another version of - * recognition model. - * * 'recognition_01': The default recognition model for [LargeFaceList- - * Create](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist/create). All - * those large face lists created before 2019 March are bonded with this recognition model. - * * 'recognition_02': Recognition model released in 2019 March. - * * 'recognition_03': Recognition model released in 2020 May. 'recognition_03' is recommended - * since its overall accuracy is improved compared with 'recognition_01' and 'recognition_02'. + * recognition model. Please refer to [Specify a recognition + * model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-recognition-model). * * Large face list quota: * * Free-tier subscription quota: 64 large face lists. @@ -204,7 +192,7 @@ export class LargeFaceListOperations { * List large face lists’ information of largeFaceListId, name, userData and recognitionModel.
* To get face information inside largeFaceList use [LargeFaceList Face - - * Get](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist/getface)
+ * Get](../largefacelist/getface)
* * Large face lists are stored in alphabetical order of largeFaceListId. * * "start" parameter (string, optional) is a user-provided largeFaceListId value that returned * entries have larger ids by string comparison. "start" set to empty to indicate return from the @@ -371,21 +359,17 @@ export class LargeFaceListOperations { *
To deal with an image contains multiple faces, input face can be specified as an image * with a targetFace rectangle. It returns a persistedFaceId representing the added face. No image * will be stored. Only the extracted face feature will be stored on server until [LargeFaceList - * Face - - * Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist/deleteface) or - * [LargeFaceList - - * Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist/delete) is - * called. + * Face - Delete](../largefacelist/deleteface) or [LargeFaceList - Delete](../largefacelist/delete) + * is called. *
Note persistedFaceId is different from faceId generated by [Face - - * Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl). + * Detect](../face/detectwithurl). * * Higher face image quality means better recognition precision. Please consider high-quality * faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is * from 1KB to 6MB. * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an * error. If the provided "targetFace" rectangle is not returned from [Face - - * Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl), there’s - * no guarantee to detect and add the face successfully. + * Detect](../face/detectwithurl), there’s no guarantee to detect and add the face successfully. * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions * will cause failures. * * Adding/deleting faces to/from a same face list are processed sequentially and to/from @@ -396,15 +380,6 @@ export class LargeFaceListOperations { * * Different 'detectionModel' values can be provided. To use and compare different detection * models, please refer to [How to specify a detection * model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) - * | Model | Recommended use-case(s) | - * | ---------- | -------- | - * | 'detection_01': | The default detection model for [LargeFaceList - Add - * Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist/addfacefromurl). - * Recommend for near frontal face detection. For scenarios with exceptionally large angle - * (head-pose) faces, occluded faces or wrong image orientation, the faces in such cases may not be - * detected. | - * | 'detection_02': | Detection model released in 2019 May with improved accuracy especially on - * small, side and blurry faces. | * * Quota: * * Free-tier subscription quota: 1,000 faces per large face list. @@ -473,21 +448,17 @@ export class LargeFaceListOperations { *
To deal with an image contains multiple faces, input face can be specified as an image * with a targetFace rectangle. It returns a persistedFaceId representing the added face. No image * will be stored. Only the extracted face feature will be stored on server until [LargeFaceList - * Face - - * Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist/deleteface) or - * [LargeFaceList - - * Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist/delete) is - * called. + * Face - Delete](../largefacelist/deleteface) or [LargeFaceList - Delete](../largefacelist/delete) + * is called. *
Note persistedFaceId is different from faceId generated by [Face - - * Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl). + * Detect](../face/detectwithurl). * * Higher face image quality means better recognition precision. Please consider high-quality * faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is * from 1KB to 6MB. * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an * error. If the provided "targetFace" rectangle is not returned from [Face - - * Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl), there’s - * no guarantee to detect and add the face successfully. + * Detect](../face/detectwithurl), there’s no guarantee to detect and add the face successfully. * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions * will cause failures. * * Adding/deleting faces to/from a same face list are processed sequentially and to/from @@ -497,16 +468,7 @@ export class LargeFaceListOperations { * face size. * * Different 'detectionModel' values can be provided. To use and compare different detection * models, please refer to [How to specify a detection - * model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) - * | Model | Recommended use-case(s) | - * | ---------- | -------- | - * | 'detection_01': | The default detection model for [LargeFaceList - Add - * Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist/addfacefromurl). - * Recommend for near frontal face detection. For scenarios with exceptionally large angle - * (head-pose) faces, occluded faces or wrong image orientation, the faces in such cases may not be - * detected. | - * | 'detection_02': | Detection model released in 2019 May with improved accuracy especially on - * small, side and blurry faces. | + * model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model). * * Quota: * * Free-tier subscription quota: 1,000 faces per large face list. diff --git a/sdk/cognitiveservices/cognitiveservices-face/src/operations/largePersonGroupOperations.ts b/sdk/cognitiveservices/cognitiveservices-face/src/operations/largePersonGroupOperations.ts index efb7d6408c7f..caa6213eedd0 100644 --- a/sdk/cognitiveservices/cognitiveservices-face/src/operations/largePersonGroupOperations.ts +++ b/sdk/cognitiveservices/cognitiveservices-face/src/operations/largePersonGroupOperations.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -32,30 +31,19 @@ export class LargePersonGroupOperations { *
A large person group is the container of the uploaded person data, including face * recognition feature, and up to 1,000,000 * people. - *
After creation, use [LargePersonGroup Person - - * Create](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroupperson/create) - * to add person into the group, and call [LargePersonGroup - - * Train](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroup/train) to get - * this group ready for [Face - - * Identify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/identify). + *
After creation, use [LargePersonGroup Person - Create](../largepersongroupperson/create) + * to add person into the group, and call [LargePersonGroup - Train](../largepersongroup/train) to + * get this group ready for [Face - Identify](../face/identify). *
No image will be stored. Only the person's extracted face features and userData will be - * stored on server until [LargePersonGroup Person - - * Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroupperson/delete) - * or [LargePersonGroup - - * Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroup/delete) is - * called. + * stored on server until [LargePersonGroup Person - Delete](../largepersongroupperson/delete) or + * [LargePersonGroup - Delete](../largepersongroup/delete) is called. *
'recognitionModel' should be specified to associate with this large person group. The * default value for 'recognitionModel' is 'recognition_01', if the latest model needed, please * explicitly specify the model you need in this parameter. New faces that are added to an existing * large person group will use the recognition model that's already associated with the collection. * Existing face features in a large person group can't be updated to features extracted by another - * version of recognition model. - * * 'recognition_01': The default recognition model for [LargePersonGroup - - * Create](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroup/create). All - * those large person groups created before 2019 March are bonded with this recognition model. - * * 'recognition_02': Recognition model released in 2019 March. - * * 'recognition_03': Recognition model released in 2020 May. 'recognition_03' is recommended - * since its overall accuracy is improved compared with 'recognition_01' and 'recognition_02'. + * version of recognition model. Please refer to [Specify a face recognition + * model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-recognition-model). * * Large person group quota: * * Free-tier subscription quota: 1,000 large person groups. @@ -118,9 +106,8 @@ export class LargePersonGroupOperations { /** * Retrieve the information of a large person group, including its name, userData and * recognitionModel. This API returns large person group information only, use [LargePersonGroup - * Person - - * List](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroupperson/list) - * instead to retrieve person information under the large person group. + * Person - List](../largepersongroupperson/list) instead to retrieve person information under the + * large person group. * @param largePersonGroupId Id referencing a particular large person group. * @param [options] The optional parameters * @returns Promise diff --git a/sdk/cognitiveservices/cognitiveservices-face/src/operations/largePersonGroupPerson.ts b/sdk/cognitiveservices/cognitiveservices-face/src/operations/largePersonGroupPerson.ts index 28182bedc0e2..b4104eeb33d1 100644 --- a/sdk/cognitiveservices/cognitiveservices-face/src/operations/largePersonGroupPerson.ts +++ b/sdk/cognitiveservices/cognitiveservices-face/src/operations/largePersonGroupPerson.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -298,15 +297,11 @@ export class LargePersonGroupPerson { * deal with an image contains multiple faces, input face can be specified as an image with a * targetFace rectangle. It returns a persistedFaceId representing the added face. No image will be * stored. Only the extracted face feature will be stored on server until [LargePersonGroup - * PersonFace - - * Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroupperson/deleteface), - * [LargePersonGroup Person - - * Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroupperson/delete) - * or [LargePersonGroup - - * Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroup/delete) is - * called. + * PersonFace - Delete](../largepersongroupperson/deleteface), [LargePersonGroup Person - + * Delete](../largepersongroupperson/delete) or [LargePersonGroup - + * Delete](../largepersongroup/delete) is called. *
Note persistedFaceId is different from faceId generated by [Face - - * Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl). + * Detect](../face/detectwithurl). * * Higher face image quality means better recognition precision. Please consider high-quality * faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. * * Each person entry can hold up to 248 faces. @@ -314,8 +309,7 @@ export class LargePersonGroupPerson { * from 1KB to 6MB. * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an * error. If the provided "targetFace" rectangle is not returned from [Face - - * Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl), there’s - * no guarantee to detect and add the face successfully. + * Detect](../face/detectwithurl), there’s no guarantee to detect and add the face successfully. * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions * will cause failures. * * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting @@ -326,15 +320,6 @@ export class LargePersonGroupPerson { * * Different 'detectionModel' values can be provided. To use and compare different detection * models, please refer to [How to specify a detection * model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) - * | Model | Recommended use-case(s) | - * | ---------- | -------- | - * | 'detection_01': | The default detection model for [LargePersonGroup Person - Add - * Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroupperson/addfacefromurl). - * Recommend for near frontal face detection. For scenarios with exceptionally large angle - * (head-pose) faces, occluded faces or wrong image orientation, the faces in such cases may not be - * detected. | - * | 'detection_02': | Detection model released in 2019 May with improved accuracy especially on - * small, side and blurry faces. | * @param largePersonGroupId Id referencing a particular large person group. * @param personId Id referencing a particular person. * @param url Publicly reachable URL of an image @@ -374,15 +359,11 @@ export class LargePersonGroupPerson { * deal with an image contains multiple faces, input face can be specified as an image with a * targetFace rectangle. It returns a persistedFaceId representing the added face. No image will be * stored. Only the extracted face feature will be stored on server until [LargePersonGroup - * PersonFace - - * Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroupperson/deleteface), - * [LargePersonGroup Person - - * Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroupperson/delete) - * or [LargePersonGroup - - * Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroup/delete) is - * called. + * PersonFace - Delete](../largepersongroupperson/deleteface), [LargePersonGroup Person - + * Delete](../largepersongroupperson/delete) or [LargePersonGroup - + * Delete](../largepersongroup/delete) is called. *
Note persistedFaceId is different from faceId generated by [Face - - * Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl). + * Detect](../face/detectwithurl). * * Higher face image quality means better recognition precision. Please consider high-quality * faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. * * Each person entry can hold up to 248 faces. @@ -390,8 +371,7 @@ export class LargePersonGroupPerson { * from 1KB to 6MB. * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an * error. If the provided "targetFace" rectangle is not returned from [Face - - * Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl), there’s - * no guarantee to detect and add the face successfully. + * Detect](../face/detectwithurl), there’s no guarantee to detect and add the face successfully. * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions * will cause failures. * * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting @@ -401,16 +381,7 @@ export class LargePersonGroupPerson { * face size. * * Different 'detectionModel' values can be provided. To use and compare different detection * models, please refer to [How to specify a detection - * model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) - * | Model | Recommended use-case(s) | - * | ---------- | -------- | - * | 'detection_01': | The default detection model for [LargePersonGroup Person - Add - * Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroupperson/addfacefromurl). - * Recommend for near frontal face detection. For scenarios with exceptionally large angle - * (head-pose) faces, occluded faces or wrong image orientation, the faces in such cases may not be - * detected. | - * | 'detection_02': | Detection model released in 2019 May with improved accuracy especially on - * small, side and blurry faces. | + * model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model). * @param largePersonGroupId Id referencing a particular large person group. * @param personId Id referencing a particular person. * @param image An image stream. diff --git a/sdk/cognitiveservices/cognitiveservices-face/src/operations/personGroupOperations.ts b/sdk/cognitiveservices/cognitiveservices-face/src/operations/personGroupOperations.ts index 0433ec2430fc..27b7766599b0 100644 --- a/sdk/cognitiveservices/cognitiveservices-face/src/operations/personGroupOperations.ts +++ b/sdk/cognitiveservices/cognitiveservices-face/src/operations/personGroupOperations.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -31,36 +30,24 @@ export class PersonGroupOperations { * recognitionModel. *
A person group is the container of the uploaded person data, including face recognition * features. - *
After creation, use [PersonGroup Person - - * Create](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroupperson/create) to - * add persons into the group, and then call [PersonGroup - - * Train](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroup/train) to get this - * group ready for [Face - - * Identify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/identify). + *
After creation, use [PersonGroup Person - Create](../persongroupperson/create) to add + * persons into the group, and then call [PersonGroup - Train](../persongroup/train) to get this + * group ready for [Face - Identify](../face/identify). *
No image will be stored. Only the person's extracted face features and userData will be - * stored on server until [PersonGroup Person - - * Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroupperson/delete) or - * [PersonGroup - - * Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroup/delete) is - * called. + * stored on server until [PersonGroup Person - Delete](../persongroupperson/delete) or + * [PersonGroup - Delete](../persongroup/delete) is called. *
'recognitionModel' should be specified to associate with this person group. The default * value for 'recognitionModel' is 'recognition_01', if the latest model needed, please explicitly * specify the model you need in this parameter. New faces that are added to an existing person * group will use the recognition model that's already associated with the collection. Existing * face features in a person group can't be updated to features extracted by another version of * recognition model. - * * 'recognition_01': The default recognition model for [PersonGroup - - * Create](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroup/create). All - * those person groups created before 2019 March are bonded with this recognition model. - * * 'recognition_02': Recognition model released in 2019 March. - * * 'recognition_03': Recognition model released in 2020 May. 'recognition_03' is recommended - * since its overall accuracy is improved compared with 'recognition_01' and 'recognition_02'. * * Person group quota: * * Free-tier subscription quota: 1,000 person groups. Each holds up to 1,000 persons. * * S0-tier subscription quota: 1,000,000 person groups. Each holds up to 10,000 persons. * * to handle larger scale face identification problem, please consider using - * [LargePersonGroup](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroup). + * [LargePersonGroup](../largepersongroup). * @param personGroupId Id referencing a particular person group. * @param [options] The optional parameters * @returns Promise @@ -118,8 +105,7 @@ export class PersonGroupOperations { /** * Retrieve person group name, userData and recognitionModel. To get person information under this - * personGroup, use [PersonGroup Person - - * List](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroupperson/list). + * personGroup, use [PersonGroup Person - List](../persongroupperson/list). * @param personGroupId Id referencing a particular person group. * @param [options] The optional parameters * @returns Promise diff --git a/sdk/cognitiveservices/cognitiveservices-face/src/operations/personGroupPerson.ts b/sdk/cognitiveservices/cognitiveservices-face/src/operations/personGroupPerson.ts index 5ad5a5c8d0ca..071de9ba89f7 100644 --- a/sdk/cognitiveservices/cognitiveservices-face/src/operations/personGroupPerson.ts +++ b/sdk/cognitiveservices/cognitiveservices-face/src/operations/personGroupPerson.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -261,14 +260,10 @@ export class PersonGroupPerson { * an image contains multiple faces, input face can be specified as an image with a targetFace * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. * Only the extracted face feature will be stored on server until [PersonGroup PersonFace - - * Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroupperson/deleteface), - * [PersonGroup Person - - * Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroupperson/delete) or - * [PersonGroup - - * Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroup/delete) is - * called. + * Delete](../persongroupperson/deleteface), [PersonGroup Person - + * Delete](../persongroupperson/delete) or [PersonGroup - Delete](../persongroup/delete) is called. *
Note persistedFaceId is different from faceId generated by [Face - - * Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl). + * Detect](../face/detectwithurl). * * Higher face image quality means better recognition precision. Please consider high-quality * faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. * * Each person entry can hold up to 248 faces. @@ -276,8 +271,7 @@ export class PersonGroupPerson { * from 1KB to 6MB. * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an * error. If the provided "targetFace" rectangle is not returned from [Face - - * Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl), there’s - * no guarantee to detect and add the face successfully. + * Detect](../face/detectwithurl), there’s no guarantee to detect and add the face successfully. * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions * will cause failures. * * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting @@ -321,14 +315,10 @@ export class PersonGroupPerson { * an image contains multiple faces, input face can be specified as an image with a targetFace * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. * Only the extracted face feature will be stored on server until [PersonGroup PersonFace - - * Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroupperson/deleteface), - * [PersonGroup Person - - * Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroupperson/delete) or - * [PersonGroup - - * Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroup/delete) is - * called. + * Delete](../persongroupperson/deleteface), [PersonGroup Person - + * Delete](../persongroupperson/delete) or [PersonGroup - Delete](../persongroup/delete) is called. *
Note persistedFaceId is different from faceId generated by [Face - - * Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl). + * Detect](../face/detectwithurl). * * Higher face image quality means better recognition precision. Please consider high-quality * faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. * * Each person entry can hold up to 248 faces. @@ -336,8 +326,7 @@ export class PersonGroupPerson { * is from 1KB to 6MB. * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as * an error. If the provided "targetFace" rectangle is not returned from [Face - - * Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl), there’s - * no guarantee to detect and add the face successfully. + * Detect](../face/detectwithurl), there’s no guarantee to detect and add the face successfully. * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions * will cause failures. * * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting @@ -347,16 +336,7 @@ export class PersonGroupPerson { * face size. * * Different 'detectionModel' values can be provided. To use and compare different detection * models, please refer to [How to specify a detection - * model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) - * | Model | Recommended use-case(s) | - * | ---------- | -------- | - * | 'detection_01': | The default detection model for [PersonGroup Person - Add - * Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroupperson/addfacefromurl). - * Recommend for near frontal face detection. For scenarios with exceptionally large angle - * (head-pose) faces, occluded faces or wrong image orientation, the faces in such cases may not be - * detected. | - * | 'detection_02': | Detection model released in 2019 May with improved accuracy especially on - * small, side and blurry faces. | + * model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model). * @param personGroupId Id referencing a particular person group. * @param personId Id referencing a particular person. * @param url Publicly reachable URL of an image @@ -396,14 +376,10 @@ export class PersonGroupPerson { * an image contains multiple faces, input face can be specified as an image with a targetFace * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. * Only the extracted face feature will be stored on server until [PersonGroup PersonFace - - * Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroupperson/deleteface), - * [PersonGroup Person - - * Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroupperson/delete) or - * [PersonGroup - - * Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroup/delete) is - * called. + * Delete](../persongroupperson/deleteface), [PersonGroup Person - + * Delete](../persongroupperson/delete) or [PersonGroup - Delete](../persongroup/delete) is called. *
Note persistedFaceId is different from faceId generated by [Face - - * Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl). + * Detect](../face/detectwithurl). * * Higher face image quality means better recognition precision. Please consider high-quality * faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. * * Each person entry can hold up to 248 faces. @@ -411,8 +387,7 @@ export class PersonGroupPerson { * is from 1KB to 6MB. * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as * an error. If the provided "targetFace" rectangle is not returned from [Face - - * Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl), there’s - * no guarantee to detect and add the face successfully. + * Detect](../face/detectwithurl), there’s no guarantee to detect and add the face successfully. * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions * will cause failures. * * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting @@ -422,16 +397,7 @@ export class PersonGroupPerson { * face size. * * Different 'detectionModel' values can be provided. To use and compare different detection * models, please refer to [How to specify a detection - * model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) - * | Model | Recommended use-case(s) | - * | ---------- | -------- | - * | 'detection_01': | The default detection model for [PersonGroup Person - Add - * Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroupperson/addfacefromurl). - * Recommend for near frontal face detection. For scenarios with exceptionally large angle - * (head-pose) faces, occluded faces or wrong image orientation, the faces in such cases may not be - * detected. | - * | 'detection_02': | Detection model released in 2019 May with improved accuracy especially on - * small, side and blurry faces. | + * model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model). * @param personGroupId Id referencing a particular person group. * @param personId Id referencing a particular person. * @param image An image stream. diff --git a/sdk/cognitiveservices/cognitiveservices-face/src/operations/snapshotOperations.ts b/sdk/cognitiveservices/cognitiveservices-face/src/operations/snapshotOperations.ts index 3d68784865ed..c6afb673264c 100644 --- a/sdk/cognitiveservices/cognitiveservices-face/src/operations/snapshotOperations.ts +++ b/sdk/cognitiveservices/cognitiveservices-face/src/operations/snapshotOperations.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -332,7 +331,8 @@ const takeOperationSpec: msRest.OperationSpec = { headersMapper: Mappers.SnapshotTakeHeaders }, default: { - bodyMapper: Mappers.APIError + bodyMapper: Mappers.APIError, + headersMapper: Mappers.SnapshotTakeHeaders } }, serializer @@ -461,7 +461,8 @@ const applyOperationSpec: msRest.OperationSpec = { headersMapper: Mappers.SnapshotApplyHeaders }, default: { - bodyMapper: Mappers.APIError + bodyMapper: Mappers.APIError, + headersMapper: Mappers.SnapshotApplyHeaders } }, serializer