Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
70f2d88
remove all and regen
leevicms Jun 10, 2025
61c2b30
add back the handwritten code and the fix detect faces sample
leevicms Jun 11, 2025
642ba3a
fix detect faces async and async face client
leevicms Jun 11, 2025
ee8a531
fix detect liveness sample
leevicms Jun 11, 2025
7b0ef08
fix clients for large face and person operations
leevicms Jun 12, 2025
8b4232a
fix all samples
leevicms Jun 12, 2025
988323f
fix all the test to compile
leevicms Jun 12, 2025
b8c1d0b
push all
leevicms Jun 16, 2025
6e785cd
fix code style
leevicms Jun 18, 2025
fef664a
clean up
leevicms Jun 20, 2025
d92166a
UPDATE THE README
leevicms Jun 20, 2025
17f5948
polish samples
leevicms Jun 20, 2025
f545ece
increase version
leevicms Jun 27, 2025
9e2b940
update recordings
leevicms Jun 27, 2025
fcabcbb
record tests
leevicms Jun 27, 2025
197a4c7
update change log
leevicms Jun 27, 2025
fd17a4f
Merge branch 'main' into gen-all-delete
leevicms Jun 27, 2025
b9ada2b
change version
leevicms Jun 30, 2025
d33e572
Merge branch 'main' into gen-all-delete
leevicms Jun 30, 2025
448ca90
change version to beta
leevicms Jul 2, 2025
699e997
change version
leevicms Jul 2, 2025
483ee60
add a blank line
leevicms Jul 2, 2025
82face8
correct spelling
leevicms Jul 2, 2025
217b213
try fix the analyze
leevicms Jul 2, 2025
8720a15
Merge branch 'main' into gen-all-delete
leevicms Jul 2, 2025
9c1ba03
update change logs
leevicms Jul 2, 2025
135a480
remove feature added
leevicms Jul 2, 2025
5d19f07
regen
leevicms Jul 3, 2025
c00b61d
fix build
leevicms Jul 3, 2025
0f8401a
update snippet
leevicms Jul 3, 2025
b31233b
remove todo
leevicms Jul 7, 2025
d06d4c8
update readme
leevicms Jul 7, 2025
6701ea3
add back changes
leevicms Jul 8, 2025
b5b29dc
Merge branch 'main' into gen-all-delete
leevicms Jul 8, 2025
78728c7
apply api review for liveness
leevicms Jul 8, 2025
2e7a245
REVERT
leevicms Jul 8, 2025
88ba1da
change `content` to `options`
leevicms Jul 17, 2025
1cdef08
change version
leevicms Jul 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,13 @@
"riskiq"
]
},
{
"filename": "sdk/face/**",
"words": [
"Fcomputer",
"Fcontext"
]
},
{
"filename": "**/pom.xml",
"patterns": [
Expand Down
19 changes: 14 additions & 5 deletions sdk/face/azure-ai-vision-face/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
# Release History

## 1.0.0-beta.3 (Unreleased)
## 1.0.0-beta.3 (2025-07-11)

### Features Added

### Breaking Changes

### Bugs Fixed
- Change the default service API version to `v1.2`
- Removed `CreateLivenessSessionResult` and use `LivenessSession` for liveness session creation and get session.
- Unified `CreateLivenessWithVerifySession` and require the verify image when creating a liveness with verify session.
- Update model `LivenessSession`, `CreateLivenessSessionOptions`, and `CreateLivenessWithVerifySessionContent`.
- Removed `LivenessSessionAudit`
- Removed `GetLivenessSessions` and `GetLivenessWithVerifySessions`
- Removed `PersonDirectory` operations

### Other Changes

- Removed FaceClient customizations
- Liveness
- Added `LivenessSessionAttempt`

## 1.0.0-beta.2 (2024-10-23)

- Added support for the Large Face List and Large Person Group:
Expand All @@ -18,12 +27,12 @@
- Added models for supporting Large Face List and Large Person Group.
- Added support for latest Detect Liveness Session API:
- Added operations `GetSessionImage` and `DetectFromSessionImage` to `FaceSessionClient`.
- Added properties `EnableSessionImage ` and `LivenessSingleModalModel` to model `CreateLivenessSessionContent`.
- Added properties `EnableSessionImage ` and `LivenessSingleModalModel` to model `CreateLivenessSessionOptions`.
- Added model `CreateLivenessWithVerifySessionContent`.

### Breaking Changes

- Changed the parameter of `CreateLivenessWithVerifySession` from model `CreateLivenessSessionContent` to `CreateLivenessWithVerifySessionContent`.
- Changed the parameter of `CreateLivenessWithVerifySession` from model `CreateLivenessSessionOptions` to `CreateLivenessWithVerifySessionContent`.

### Other Changes

Expand Down
76 changes: 45 additions & 31 deletions sdk/face/azure-ai-vision-face/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ Once completed, set the values of the client ID, tenant ID, and client secret of
//variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET
String endpoint = "https://<my-custom-subdomain>.cognitiveservices.azure.com/";
FaceClient client = new FaceClientBuilder()
.endpoint(endpoint)
.credential(new DefaultAzureCredentialBuilder().build())
.buildClient();
.endpoint(endpoint)
.credential(new DefaultAzureCredentialBuilder().build())
.buildClient();
```

#### Create the client with AzureKeyCredential
Expand All @@ -117,9 +117,9 @@ To use an API key as the `credential` parameter, pass the key as a string into a
String endpoint = "https://<my-custom-subdomain>.cognitiveservices.azure.com/";
String accountKey = "<api_key>";
FaceClient client = new FaceClientBuilder()
.endpoint(endpoint)
.credential(new KeyCredential(accountKey))
.buildClient();
.endpoint(endpoint)
.credential(new KeyCredential(accountKey))
.buildClient();
```

## Key concepts
Expand Down Expand Up @@ -158,19 +158,19 @@ Detect faces and analyze them from an binary data. The latest model is the most

```java com.azure.ai.vision.face.readme.detectFace
FaceClient client = new FaceClientBuilder()
.endpoint(endpoint)
.credential(new KeyCredential(accountKey))
.buildClient();
.endpoint(endpoint)
.credential(new KeyCredential(accountKey))
.buildClient();

String imagePathString = Resources.TEST_IMAGE_PATH_DETECT_SAMPLE_IMAGE;
Path path = Paths.get(imagePathString);
BinaryData imageData = BinaryData.fromFile(path);
List<FaceAttributeType> attributeTypes = Arrays.asList(
FaceAttributeType.ModelDetection03.HEAD_POSE, FaceAttributeType.ModelDetection03.MASK, FaceAttributeType.ModelRecognition04.QUALITY_FOR_RECOGNITION);
FaceAttributeType.HEAD_POSE, FaceAttributeType.MASK, FaceAttributeType.QUALITY_FOR_RECOGNITION);

List<FaceDetectionResult> results = client.detect(
imageData, FaceDetectionModel.DETECTION_03, FaceRecognitionModel.RECOGNITION_04, true,
attributeTypes, true, true, 120);
imageData, FaceDetectionModel.DETECTION_03, FaceRecognitionModel.RECOGNITION_04, true,
attributeTypes, true, true, 120);

for (int i = 0, size = results.size(); i < size; i++) {
System.out.println("----- Detection result: #" + i + " -----");
Expand Down Expand Up @@ -201,48 +201,62 @@ Here is an example to create and get the liveness detection result of a session.
```java com.azure.ai.vision.face.readme.createLivenessSessionAndGetResult
System.out.println("Create a liveness session.");
FaceSessionClient sessionClient = new FaceSessionClientBuilder()
.endpoint(endpoint)
.credential(new KeyCredential(accountKey))
.buildClient();
.endpoint(endpoint)
.credential(new KeyCredential(accountKey))
.buildClient();

String deviceCorrelationId = UUID.randomUUID().toString();
CreateLivenessSessionContent parameters = new CreateLivenessSessionContent(LivenessOperationMode.PASSIVE)
.setDeviceCorrelationId(deviceCorrelationId)
.setSendResultsToClient(false);
CreateLivenessSessionOptions parameters = new CreateLivenessSessionOptions(LivenessOperationMode.PASSIVE)
.setDeviceCorrelationId(deviceCorrelationId);

CreateLivenessSessionResult createLivenessSessionResult = sessionClient.createLivenessSession(parameters);
LivenessSession createLivenessSessionResult = sessionClient.createLivenessSession(parameters);
String sessionId = createLivenessSessionResult.getSessionId();
System.out.println("Result: " + sessionId);

System.out.println("Get the liveness detection result.");
LivenessSession session = sessionClient.getLivenessSessionResult(sessionId);
System.out.println("Result: " + session.getResult().getResponse().getBody().getLivenessDecision());
if (session.getResults() != null
&& session.getResults().getAttempts() != null
&& !session.getResults().getAttempts().isEmpty()) {

if (session.getResults().getAttempts().get(0).getResult() != null) {
FaceLivenessDecision decision = session.getResults().getAttempts().get(0).getResult().getLivenessDecision();
System.out.println("First Attempt Result: " + decision);
}
}
```

Here is another example for the liveness detection with face verification.
```java com.azure.ai.vision.face.readme.createLivenessWithVerifySessionAndGetResult
System.out.println("Create a liveness session.");
FaceSessionClient sessionClient = new FaceSessionClientBuilder()
.endpoint(endpoint)
.credential(new KeyCredential(accountKey))
.buildClient();
.endpoint(endpoint)
.credential(new KeyCredential(accountKey))
.buildClient();

String deviceCorrelationId = UUID.randomUUID().toString();
CreateLivenessWithVerifySessionContent parameters = new CreateLivenessWithVerifySessionContent(LivenessOperationMode.PASSIVE)
.setDeviceCorrelationId(deviceCorrelationId)
.setSendResultsToClient(false);
Path path = Paths.get(imagePathString);
BinaryData verifyImage = BinaryData.fromFile(path);
VerifyImageFileDetails verifyImageFileDetails = new VerifyImageFileDetails(verifyImage);
CreateLivenessWithVerifySessionContent parameters = new CreateLivenessWithVerifySessionContent(LivenessOperationMode.PASSIVE, verifyImageFileDetails)
.setDeviceCorrelationId(deviceCorrelationId);

CreateLivenessWithVerifySessionResult createLivenessSessionResult = sessionClient
.createLivenessWithVerifySession(parameters, verifyImage);
String sessionId = createLivenessSessionResult.getSessionId();
LivenessWithVerifySession livenessWithVerifySessionResults = sessionClient.createLivenessWithVerifySession(parameters);
String sessionId = livenessWithVerifySessionResults.getSessionId();
System.out.println("Result: " + sessionId);

System.out.println("Get the liveness detection result.");
LivenessWithVerifySession session = sessionClient.getLivenessWithVerifySessionResult(sessionId);
LivenessResponseBody response = session.getResult().getResponse().getBody();
System.out.println("Result: " + response.getLivenessDecision() + ", Verify result:" + response.getVerifyResult());
if (session.getResults() != null && session.getResults().getAttempts() != null
&& !session.getResults().getAttempts().isEmpty()) {
LivenessWithVerifySessionAttempt attempt = session.getResults().getAttempts().get(0);
if (attempt.getResult() != null) {
FaceLivenessDecision livenessDecision = attempt.getResult().getLivenessDecision();
LivenessWithVerifyOutputs verifyOutputs = attempt.getResult().getVerifyResult();
System.out.println("Result: " + livenessDecision + ", Verify result:"
+ (verifyOutputs != null ? verifyOutputs.toString() : "null"));
}
}
```

## Troubleshooting
Expand Down
2 changes: 1 addition & 1 deletion sdk/face/azure-ai-vision-face/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo" : "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath" : "java",
"TagPrefix" : "java/face/azure-ai-vision-face",
"Tag" : "java/face/azure-ai-vision-face_7aba032dc1"
"Tag" : "java/face/azure-ai-vision-face_4d5356423f"
}
21 changes: 0 additions & 21 deletions sdk/face/azure-ai-vision-face/customization/pom.xml

This file was deleted.

This file was deleted.

Loading