@azure-rest/ai-vision-face 1.0.0-alpha.20250205.1 → 1.0.0-alpha.20250206.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -90,17 +90,13 @@ You will also need to [register a new Microsoft Entra ID application and grant a
90
90
  Once completed, set the values of the client ID, tenant ID, and client secret of the Microsoft Entra ID application as environment variables:
91
91
  `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.
92
92
 
93
- ```js
94
- /**
95
- * DefaultAzureCredential will use the values from these environment
96
- * variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET
97
- */
93
+ ```ts snippet:ReadmeSampleCreateClient_Entra
98
94
  import { DefaultAzureCredential } from "@azure/identity";
99
- import createFaceClient from "@azure-rest/ai-vision-face";
95
+ import FaceClient from "@azure-rest/ai-vision-face";
100
96
 
101
97
  const endpoint = process.env["FACE_ENDPOINT"] || "<endpoint>";
102
98
  const credential = new DefaultAzureCredential();
103
- const client = createFaceClient(endpoint, credential);
99
+ const client = FaceClient(endpoint, credential);
104
100
  ```
105
101
 
106
102
  #### Create the client with AzureKeyCredential
@@ -113,14 +109,14 @@ You can get the API key for your Face resource using the [Azure Portal](https://
113
109
  az cognitiveservices account keys list --name "<resource-name>" --resource-group "<resource-group-name>"
114
110
  ```
115
111
 
116
- ```js
112
+ ```ts snippet:ReadmeSampleCreateClient_KeyCredential
117
113
  import { AzureKeyCredential } from "@azure/core-auth";
118
- import createFaceClient from "@azure-rest/ai-vision-face";
114
+ import FaceClient from "@azure-rest/ai-vision-face";
119
115
 
120
116
  const endpoint = process.env["FACE_ENDPOINT"] || "<endpoint>";
121
117
  const apikey = process.env["FACE_APIKEY"] || "<apikey>";
122
118
  const credential = new AzureKeyCredential(apikey);
123
- const client = createFaceClient(endpoint, credential);
119
+ const client = FaceClient(endpoint, credential);
124
120
  ```
125
121
 
126
122
  ## Key concepts
@@ -162,16 +158,14 @@ The following section provides several code snippets covering some of the most c
162
158
 
163
159
  Detect faces and analyze them from an binary data.
164
160
 
165
- ```js
166
- import { readFileSync } from "fs";
167
- import { AzureKeyCredential } from "@azure/core-auth";
168
-
169
- import createFaceClient, { isUnexpected } from "@azure-rest/ai-vision-face";
161
+ ```ts snippet:ReadmeSampleFaceDetection
162
+ import { DefaultAzureCredential } from "@azure/identity";
163
+ import FaceClient, { isUnexpected } from "@azure-rest/ai-vision-face";
164
+ import { readFileSync } from "node:fs";
170
165
 
171
166
  const endpoint = process.env["FACE_ENDPOINT"] || "<endpoint>";
172
- const apikey = process.env["FACE_APIKEY"] || "<apikey>";
173
- const credential = new AzureKeyCredential(apikey);
174
- const client = createFaceClient(endpoint, credential);
167
+ const credential = new DefaultAzureCredential();
168
+ const client = FaceClient(endpoint, credential);
175
169
 
176
170
  const response = await client.path("/detect").post({
177
171
  contentType: "application/octet-stream",
@@ -186,9 +180,11 @@ const response = await client.path("/detect").post({
186
180
  },
187
181
  body: readFileSync("path/to/test/image"),
188
182
  });
183
+
189
184
  if (isUnexpected(response)) {
190
185
  throw new Error(response.body.error.message);
191
186
  }
187
+
192
188
  console.log(response.body);
193
189
  ```
194
190
 
@@ -198,16 +194,14 @@ Identify a face against a defined LargePersonGroup.
198
194
 
199
195
  First, we have to create a LargePersonGroup, add a few Persons to it, and then register faces with these Persons.
200
196
 
201
- ```js
202
- import { readFileSync } from "fs";
203
- import { AzureKeyCredential } from "@azure/core-auth";
204
-
205
- import createFaceClient, { getLongRunningPoller, isUnexpected } from "@azure-rest/ai-vision-face";
197
+ ```ts snippet:ReadmeSampleFaceRecognitionFromLargePersonGroup
198
+ import { DefaultAzureCredential } from "@azure/identity";
199
+ import FaceClient, { isUnexpected } from "@azure-rest/ai-vision-face";
200
+ import { readFileSync } from "node:fs";
206
201
 
207
202
  const endpoint = process.env["FACE_ENDPOINT"] || "<endpoint>";
208
- const apikey = process.env["FACE_APIKEY"] || "<apikey>";
209
- const credential = new AzureKeyCredential(apikey);
210
- const client = createFaceClient(endpoint, credential);
203
+ const credential = new DefaultAzureCredential();
204
+ const client = FaceClient(endpoint, credential);
211
205
 
212
206
  const largePersonGroupId = "lpg_family";
213
207
 
@@ -230,9 +224,11 @@ const createLargePersonGroupPersonResponse_bill = await client
230
224
  userData: "Dad",
231
225
  },
232
226
  });
227
+
233
228
  if (isUnexpected(createLargePersonGroupPersonResponse_bill)) {
234
229
  throw new Error(createLargePersonGroupPersonResponse_bill.body.error.message);
235
230
  }
231
+
236
232
  const personId_bill = createLargePersonGroupPersonResponse_bill.body.personId;
237
233
  await client
238
234
  .path(
@@ -258,9 +254,11 @@ const createLargePersonGroupPersonResponse_clare = await client
258
254
  userData: "Mom",
259
255
  },
260
256
  });
257
+
261
258
  if (isUnexpected(createLargePersonGroupPersonResponse_clare)) {
262
259
  throw new Error(createLargePersonGroupPersonResponse_clare.body.error.message);
263
260
  }
261
+
264
262
  const personId_clare = createLargePersonGroupPersonResponse_clare.body.personId;
265
263
  await client
266
264
  .path(
@@ -280,47 +278,79 @@ await client
280
278
 
281
279
  Before doing the identification, we must train the LargePersonGroup first.
282
280
 
283
- ```js
281
+ ```ts snippet:ReadmeSampleFaceRecognitionFromLargePersonGroup_Train
282
+ import { DefaultAzureCredential } from "@azure/identity";
283
+ import FaceClient, { getLongRunningPoller } from "@azure-rest/ai-vision-face";
284
+
285
+ const endpoint = process.env["FACE_ENDPOINT"] || "<endpoint>";
286
+ const credential = new DefaultAzureCredential();
287
+ const client = FaceClient(endpoint, credential);
288
+
289
+ const largePersonGroupId = "lpg_family";
290
+
284
291
  console.log(`Start to train the large person group: ${largePersonGroupId}`);
285
292
  const trainResponse = await client
286
293
  .path("/largepersongroups/{largePersonGroupId}/train", largePersonGroupId)
287
294
  .post();
288
295
  const trainPoller = await getLongRunningPoller(client, trainResponse);
289
296
  await trainPoller.pollUntilDone();
290
- // Check if poller.getOperationState().status is 'succeeded'.
291
297
  ```
292
298
 
293
299
  When the training operation is completed successfully, we can identify the faces in this LargePersonGroup throught.
294
300
 
295
- ```js
296
- console.log('Detect faces from the target image.');
297
- const detectResponse = await client.path('/detect').post({
298
- contentType: 'application/octet-stream',
299
- queryParameters: {
300
- detectionModel: 'detection_03',
301
- recognitionModel: 'recognition_04',
302
- returnFaceId: true,
303
- },
304
- body: readFileSync('path/to/target/image'),
301
+ ```ts snippet:ReadmeSampleFaceRecognitionFromLargePersonGroup_Identify
302
+ import { DefaultAzureCredential } from "@azure/identity";
303
+ import FaceClient, { isUnexpected } from "@azure-rest/ai-vision-face";
304
+ import { readFileSync } from "node:fs";
305
+
306
+ const endpoint = process.env["FACE_ENDPOINT"] || "<endpoint>";
307
+ const credential = new DefaultAzureCredential();
308
+ const client = FaceClient(endpoint, credential);
309
+
310
+ const largePersonGroupId = "lpg_family";
311
+
312
+ console.log("Detect faces from the target image.");
313
+ const detectResponse = await client.path("/detect").post({
314
+ contentType: "application/octet-stream",
315
+ queryParameters: {
316
+ detectionModel: "detection_03",
317
+ recognitionModel: "recognition_04",
318
+ returnFaceId: true,
319
+ },
320
+ body: readFileSync("path/to/target/image"),
305
321
  });
322
+
306
323
  if (isUnexpected(detectResponse)) {
307
- throw new Error(detectResponse.body.error.message);
324
+ throw new Error(detectResponse.body.error.message);
308
325
  }
309
- const faceIds = detectResponse.body.map(face => face.faceId as string)
310
326
 
311
- console.log('Identify the faces in the large person group.');
312
- const identifyResponse = await client.path('/identify').post({
313
- body: { faceIds, largePersonGroupId },
327
+ const faceIds = detectResponse.body.map((face) => face.faceId as string);
328
+
329
+ console.log("Identify the faces in the large person group.");
330
+
331
+ const identifyResponse = await client.path("/identify").post({
332
+ body: { faceIds, largePersonGroupId },
314
333
  });
334
+
315
335
  if (isUnexpected(identifyResponse)) {
316
- throw new Error(identifyResponse.body.error.message);
336
+ throw new Error(identifyResponse.body.error.message);
317
337
  }
338
+
318
339
  console.log(identifyResponse.body);
319
340
  ```
320
341
 
321
342
  Finally, remove the large person group if you don't need it anymore.
322
343
 
323
- ```js
344
+ ```ts snippet:ReadmeSampleFaceRecognitionFromLargePersonGroup_Delete
345
+ import { DefaultAzureCredential } from "@azure/identity";
346
+ import FaceClient from "@azure-rest/ai-vision-face";
347
+
348
+ const endpoint = process.env["FACE_ENDPOINT"] || "<endpoint>";
349
+ const credential = new DefaultAzureCredential();
350
+ const client = FaceClient(endpoint, credential);
351
+
352
+ const largePersonGroupId = "lpg_family";
353
+
324
354
  console.log(`Delete the large person group: ${largePersonGroupId}`);
325
355
  await client.path("/largepersongroups/{largePersonGroupId}", largePersonGroupId).delete();
326
356
  ```
@@ -345,17 +375,14 @@ integrate the UI and the code into your native frontend application, please foll
345
375
 
346
376
  Here is an example to create and get the liveness detection result of a session.
347
377
 
348
- ```js
349
- import { randomUUID } from "crypto";
350
-
351
- import { AzureKeyCredential } from "@azure/core-auth";
352
-
353
- import createFaceClient, { isUnexpected } from "@azure-rest/ai-vision-face";
378
+ ```ts snippet:ReadmeSampleLivenessDetection
379
+ import { DefaultAzureCredential } from "@azure/identity";
380
+ import FaceClient, { isUnexpected } from "@azure-rest/ai-vision-face";
381
+ import { randomUUID } from "node:crypto";
354
382
 
355
383
  const endpoint = process.env["FACE_ENDPOINT"] || "<endpoint>";
356
- const apikey = process.env["FACE_APIKEY"] || "<apikey>";
357
- const credential = new AzureKeyCredential(apikey);
358
- const client = createFaceClient(endpoint, credential);
384
+ const credential = new DefaultAzureCredential();
385
+ const client = FaceClient(endpoint, credential);
359
386
 
360
387
  console.log("Create a new liveness session.");
361
388
  const createLivenessSessionResponse = await client
@@ -368,6 +395,7 @@ const createLivenessSessionResponse = await client
368
395
  authTokenTimeToLiveInSeconds: 60,
369
396
  },
370
397
  });
398
+
371
399
  if (isUnexpected(createLivenessSessionResponse)) {
372
400
  throw new Error(createLivenessSessionResponse.body.error.message);
373
401
  }
@@ -379,6 +407,7 @@ console.log("Get liveness detection results.");
379
407
  const getLivenessSessionResponse = await client
380
408
  .path("/detectLiveness/singleModal/sessions/{sessionId}", sessionId)
381
409
  .get();
410
+
382
411
  if (isUnexpected(getLivenessSessionResponse)) {
383
412
  throw new Error(getLivenessSessionResponse.body.error.message);
384
413
  }
@@ -387,18 +416,15 @@ console.log(getLivenessSessionResponse.body);
387
416
 
388
417
  Here is another example for the liveness detection with face verification.
389
418
 
390
- ```js
391
- import { randomUUID } from "crypto";
392
- import { readFileSync } from "fs";
393
-
394
- import { AzureKeyCredential } from "@azure/core-auth";
395
-
396
- import createFaceClient, { isUnexpected } from "@azure-rest/ai-vision-face";
419
+ ```ts snippet:ReadmeSampleLivenessDetectionWithVerify
420
+ import { DefaultAzureCredential } from "@azure/identity";
421
+ import FaceClient, { isUnexpected } from "@azure-rest/ai-vision-face";
422
+ import { readFileSync } from "node:fs";
423
+ import { randomUUID } from "node:crypto";
397
424
 
398
425
  const endpoint = process.env["FACE_ENDPOINT"] || "<endpoint>";
399
- const apikey = process.env["FACE_APIKEY"] || "<apikey>";
400
- const credential = new AzureKeyCredential(apikey);
401
- const client = createFaceClient(endpoint, credential);
426
+ const credential = new DefaultAzureCredential();
427
+ const client = FaceClient(endpoint, credential);
402
428
 
403
429
  console.log("Create a new liveness with verify session with verify image.");
404
430
  const createLivenessSessionResponse = await client
@@ -421,6 +447,7 @@ const createLivenessSessionResponse = await client
421
447
  },
422
448
  ],
423
449
  });
450
+
424
451
  if (isUnexpected(createLivenessSessionResponse)) {
425
452
  throw new Error(createLivenessSessionResponse.body.error.message);
426
453
  }
@@ -432,6 +459,7 @@ console.log("Get the liveness detection and verification result.");
432
459
  const getLivenessSessionResultResponse = await client
433
460
  .path("/detectLivenessWithVerify/singleModal/sessions/{sessionId}", sessionId)
434
461
  .get();
462
+
435
463
  if (isUnexpected(getLivenessSessionResultResponse)) {
436
464
  throw new Error(getLivenessSessionResultResponse.body.error.message);
437
465
  }
@@ -448,8 +476,8 @@ Error codes and messages raised by the Face service can be found in the [service
448
476
 
449
477
  Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
450
478
 
451
- ```javascript
452
- const { setLogLevel } = require("@azure/logger");
479
+ ```ts snippet:SetLogLevel
480
+ import { setLogLevel } from "@azure/logger";
453
481
 
454
482
  setLogLevel("info");
455
483
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure-rest/ai-vision-face",
3
- "version": "1.0.0-alpha.20250205.1",
3
+ "version": "1.0.0-alpha.20250206.1",
4
4
  "description": "Face API REST Client",
5
5
  "engines": {
6
6
  "node": ">=18.0.0"
@@ -8,6 +8,7 @@
8
8
  "sideEffects": false,
9
9
  "autoPublish": false,
10
10
  "tshy": {
11
+ "project": "./tsconfig.src.json",
11
12
  "exports": {
12
13
  "./package.json": "./package.json",
13
14
  ".": "./src/index.ts"
@@ -20,8 +21,7 @@
20
21
  "browser",
21
22
  "react-native"
22
23
  ],
23
- "selfLink": false,
24
- "project": "./tsconfig.src.json"
24
+ "selfLink": false
25
25
  },
26
26
  "type": "module",
27
27
  "keywords": [
@@ -35,11 +35,9 @@
35
35
  "author": "Microsoft Corporation",
36
36
  "license": "MIT",
37
37
  "files": [
38
- "dist",
38
+ "dist/",
39
39
  "README.md",
40
- "LICENSE",
41
- "review/*",
42
- "CHANGELOG.md"
40
+ "LICENSE"
43
41
  ],
44
42
  "sdk-type": "client",
45
43
  "repository": "github:Azure/azure-sdk-for-js",
@@ -58,54 +56,56 @@
58
56
  },
59
57
  "dependencies": {
60
58
  "@azure-rest/core-client": "^2.1.0",
61
- "@azure/core-auth": "^1.6.0",
62
- "@azure/core-rest-pipeline": "^1.5.0",
63
- "@azure/logger": "^1.0.0",
64
- "tslib": "^2.6.2",
59
+ "@azure/abort-controller": "^2.1.2",
60
+ "@azure/core-auth": "^1.9.0",
65
61
  "@azure/core-lro": "^3.0.0",
66
- "@azure/abort-controller": "^2.1.2"
62
+ "@azure/core-rest-pipeline": "^1.18.2",
63
+ "@azure/logger": "^1.1.4",
64
+ "tslib": "^2.8.1"
67
65
  },
68
66
  "devDependencies": {
69
- "dotenv": "^16.0.0",
67
+ "@azure-tools/test-credential": "^2.0.0",
68
+ "@azure-tools/test-recorder": ">=4.1.0-alpha <4.1.0-alphb",
69
+ "@azure-tools/test-utils-vitest": ">=1.0.0-alpha <1.0.0-alphb",
70
+ "@azure/dev-tool": ">=1.0.0-alpha <1.0.0-alphb",
71
+ "@azure/eslint-plugin-azure-sdk": ">=3.0.0-alpha <3.0.0-alphb",
72
+ "@azure/identity": "^4.6.0",
70
73
  "@types/node": "^18.0.0",
74
+ "@vitest/browser": "^3.0.3",
75
+ "@vitest/coverage-istanbul": "^3.0.3",
76
+ "dotenv": "^16.0.0",
71
77
  "eslint": "^9.9.0",
78
+ "playwright": "^1.50.1",
72
79
  "prettier": "^3.2.5",
73
- "typescript": "~5.7.2",
74
80
  "tshy": "^1.11.1",
75
- "@azure/identity": "^4.2.1",
76
- "@vitest/browser": "^3.0.3",
77
- "@vitest/coverage-istanbul": "^3.0.3",
78
- "playwright": "^1.41.2",
79
- "vitest": "^3.0.3",
80
- "@azure-tools/test-credential": "^2.0.0",
81
- "@azure-tools/test-recorder": "^4.0.0",
82
- "@azure/dev-tool": ">=1.0.0-alpha <1.0.0-alphb",
83
- "@azure/eslint-plugin-azure-sdk": ">=3.0.0-alpha <3.0.0-alphb"
81
+ "typescript": "~5.7.2",
82
+ "vitest": "^3.0.3"
84
83
  },
85
84
  "scripts": {
86
- "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
87
- "extract-api": "dev-tool run vendored rimraf review && dev-tool run extract-api",
88
- "pack": "npm pack 2>&1",
89
- "lint": "eslint package.json api-extractor.json src test",
90
- "lint:fix": "eslint package.json api-extractor.json src test --fix --fix-type [problem,suggestion]",
91
- "unit-test": "npm run unit-test:node && npm run unit-test:browser",
92
- "unit-test:browser": "npm run build:test && dev-tool run test:vitest --browser",
93
- "unit-test:node": "dev-tool run test:vitest",
94
- "integration-test": "npm run integration-test:node && npm run integration-test:browser",
95
- "integration-test:browser": "echo skipped",
96
- "integration-test:node": "echo skipped",
97
85
  "audit": "node ../../../common/scripts/rush-audit.js && dev-tool run vendored rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
86
+ "build": "npm run clean && dev-tool run build-package && dev-tool run extract-api",
98
87
  "build:samples": "echo skipped",
88
+ "build:test": "npm run clean && tshy && dev-tool run build-test",
99
89
  "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ",
90
+ "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
100
91
  "execute:samples": "echo skipped",
92
+ "extract-api": "dev-tool run vendored rimraf review && dev-tool run extract-api",
101
93
  "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ",
102
94
  "generate:client": "echo skipped",
103
- "test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
95
+ "integration-test": "npm run integration-test:node && npm run integration-test:browser",
96
+ "integration-test:browser": "echo skipped",
97
+ "integration-test:node": "dev-tool run test:vitest --esm",
98
+ "lint": "eslint package.json api-extractor.json src test",
99
+ "lint:fix": "eslint package.json api-extractor.json src test --fix --fix-type [problem,suggestion]",
104
100
  "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js",
105
- "build:test": "npm run clean && tshy && dev-tool run build-test",
106
- "build": "npm run clean && tshy && dev-tool run extract-api",
101
+ "pack": "npm pack 2>&1",
102
+ "test": "npm run clean && tshy && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser && npm run integration-test",
103
+ "test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
107
104
  "test:node": "npm run clean && tshy && npm run unit-test:node && npm run integration-test:node",
108
- "test": "npm run clean && tshy && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser && npm run integration-test"
105
+ "unit-test": "npm run unit-test:node && npm run unit-test:browser",
106
+ "unit-test:browser": "echo skipped",
107
+ "unit-test:node": "dev-tool run test:vitest",
108
+ "update-snippets": "dev-tool run update-snippets"
109
109
  },
110
110
  "//sampleConfiguration": {
111
111
  "productName": "Face API",
@@ -133,22 +133,18 @@
133
133
  "./package.json": "./package.json",
134
134
  ".": {
135
135
  "browser": {
136
- "source": "./src/index.ts",
137
136
  "types": "./dist/browser/index.d.ts",
138
137
  "default": "./dist/browser/index.js"
139
138
  },
140
139
  "react-native": {
141
- "source": "./src/index.ts",
142
140
  "types": "./dist/react-native/index.d.ts",
143
141
  "default": "./dist/react-native/index.js"
144
142
  },
145
143
  "import": {
146
- "source": "./src/index.ts",
147
144
  "types": "./dist/esm/index.d.ts",
148
145
  "default": "./dist/esm/index.js"
149
146
  },
150
147
  "require": {
151
- "source": "./src/index.ts",
152
148
  "types": "./dist/commonjs/index.d.ts",
153
149
  "default": "./dist/commonjs/index.js"
154
150
  }
@@ -156,5 +152,7 @@
156
152
  },
157
153
  "main": "./dist/commonjs/index.js",
158
154
  "types": "./dist/commonjs/index.d.ts",
159
- "module": "./dist/esm/index.js"
155
+ "module": "./dist/esm/index.js",
156
+ "browser": "./dist/browser/index.js",
157
+ "react-native": "./dist/react-native/index.js"
160
158
  }
package/CHANGELOG.md DELETED
@@ -1,45 +0,0 @@
1
- # Release History
2
-
3
- ## 1.0.0-beta.3 (Unreleased)
4
-
5
- ### Features Added
6
-
7
- ### Breaking Changes
8
-
9
- ### Bugs Fixed
10
-
11
- ### Other Changes
12
-
13
- ## 1.0.0-beta.2 (2024-10-14)
14
-
15
- This library now supports the Azure AI Face v1.2-preview.1 API.
16
-
17
- ### Features Added
18
-
19
- - Added support for latest Detect Liveness Session API
20
- - New face detection operation: [Detect From Session Image Id](https://learn.microsoft.com/rest/api/face/face-detection-operations/detect-from-session-image-id?view=rest-face-v1.2-preview.1) using `DetectFromSessionImageIdParameters`.
21
- - New liveness session operation: [Get Session Image](https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-session-image?view=rest-face-v1.2-preview.1).
22
- - New properties `enableSessionImage?: boolean`, `livenessSingleModalModel?: LivenessModel` to `CreateLivenessSessionContent`.
23
- - New model `CreateLivenessWithVerifySessionJsonContent` for liveness session operations [Create Liveness With Verify Session](https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-with-verify-session?view=rest-face-v1.2-preview.1) and [Create Liveness With Verify Session With Verify Image](https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-with-verify-session-with-verify-image?view=rest-face-v1.2-preview.1).
24
-
25
- ## 1.0.0-beta.1 (2024-05-23)
26
-
27
- This is the first preview of the Azure Face Service client library `@azure-rest/ai-vision-face` that follows the [TypeScript Azure SDK Design Guidelines](https://azure.github.io/azure-sdk/typescript_introduction.html).
28
- This library replaces the package [@azure/cognitiveservices-face](https://www.npmjs.com/package/@azure/cognitiveservices-face).
29
-
30
- This package's [documentation](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/face/ai-vision-face-rest/README.md) and [samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/face/ai-vision-face-rest/samples) demonstrate the new API.
31
-
32
- ### Features Added
33
-
34
- These are the new features not supported by the old package [@azure/cognitiveservices-face](https://www.npmjs.com/package/@azure/cognitiveservices-face).
35
-
36
- - Added support for Liveness Detection.
37
- - Added support for `Person` and `DynamicPersonGroup` operations.
38
- - Added support for face recognition with `PersonDirectory` by passing `IdentifyFromPersonDirectoryParameters` or `IdentifyFromDynamicPersonGroupParameters` to `/identify`.
39
- - Added support for authentication with Microsoft Entra ID using `DefaultAzureCredential` from `@azure/identity`.
40
-
41
- ### Breaking Changes
42
-
43
- - This library supports only the Azure AI Face v1.1-preview.1 API, whose data models are not compatible with the v1.0 API used by [@azure/cognitiveservices-face](https://www.npmjs.com/package/@azure/cognitiveservices-face).
44
- - This library follows the design of [REST client](https://devblogs.microsoft.com/azure-sdk/azure-rest-libraries-for-javascript/), which is essentially different from [@azure/cognitiveservices-face](https://www.npmjs.com/package/@azure/cognitiveservices-face).
45
- - The Snapshot operations are all removed as [the Snapshot API is no longer supported](https://azure.microsoft.com/updates/facelimitedaccess/).