Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: lenient vision face annotation results #9947

Merged
merged 3 commits into from Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion java-vision/README.md
Expand Up @@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.23.0</version>
<version>26.24.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
Expand Up @@ -292,7 +292,7 @@ public void detectFacesTest() throws IOException {
AnnotateImageResponse res =
requestAnnotatedImage("face_no_surprise.jpg", Type.FACE_DETECTION, false);
for (FaceAnnotation annotation : assertNotEmpty(res, res.getFaceAnnotationsList())) {
assertEquals(Likelihood.LIKELY, annotation.getAngerLikelihood());
assertThat(annotation.getAngerLikelihood()).isAnyOf(Likelihood.LIKELY, Likelihood.POSSIBLE);
assertEquals(Likelihood.VERY_UNLIKELY, annotation.getJoyLikelihood());
assertEquals(Likelihood.LIKELY, annotation.getSurpriseLikelihood());
}
Expand All @@ -303,7 +303,7 @@ public void detectFacesGcsTest() throws IOException {
AnnotateImageResponse res =
requestAnnotatedImage("face/face_no_surprise.jpg", Type.FACE_DETECTION, true);
for (FaceAnnotation annotation : assertNotEmpty(res, res.getFaceAnnotationsList())) {
assertEquals(Likelihood.LIKELY, annotation.getAngerLikelihood());
assertThat(annotation.getAngerLikelihood()).isAnyOf(Likelihood.LIKELY, Likelihood.POSSIBLE);
assertEquals(Likelihood.VERY_UNLIKELY, annotation.getJoyLikelihood());
assertEquals(Likelihood.LIKELY, annotation.getSurpriseLikelihood());
}
Expand Down