Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ public static void detectFaces(String filePath) throws IOException {
// For full list of available annotations, see http://g.co/cloud/vision/docs
for (FaceAnnotation annotation : res.getFaceAnnotationsList()) {
System.out.format(
"anger: %s%njoy: %s%nsurprise: %s%nposition: %s",
annotation.getAngerLikelihood(),
annotation.getJoyLikelihood(),
annotation.getSurpriseLikelihood(),
"headwear: %s%nunder exposed: %s%nblurred: %s%nposition: %s",
annotation.getHeadwearLikelihood(),
annotation.getUnderExposedLikelihood(),
annotation.getBlurredLikelihood(),
annotation.getBoundingPoly());
Comment thread
bibliofilo marked this conversation as resolved.
Resolved
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ public static void detectFacesGcs(String gcsPath) throws IOException {
// For full list of available annotations, see http://g.co/cloud/vision/docs
for (FaceAnnotation annotation : res.getFaceAnnotationsList()) {
System.out.format(
"anger: %s%njoy: %s%nsurprise: %s%nposition: %s",
annotation.getAngerLikelihood(),
annotation.getJoyLikelihood(),
annotation.getSurpriseLikelihood(),
"headwear: %s%nunder exposed: %s%nblurred: %s%nposition: %s",
annotation.getHeadwearLikelihood(),
annotation.getUnderExposedLikelihood()),
annotation.getBlurredLikelihood(),
annotation.getBoundingPoly());
Comment on lines +69 to 73

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

There is a syntax error due to an extra closing parenthesis after annotation.getUnderExposedLikelihood(). This will cause a compilation failure. Please remove the extra parenthesis.

Suggested change
"headwear: %s%nunder exposed: %s%nblurred: %s%nposition: %s",
annotation.getHeadwearLikelihood(),
annotation.getUnderExposedLikelihood()),
annotation.getBlurredLikelihood(),
annotation.getBoundingPoly());
"headwear: %s%nunder exposed: %s%nblurred: %s%nposition: %s",
annotation.getHeadwearLikelihood(),
annotation.getUnderExposedLikelihood(),
annotation.getBlurredLikelihood(),
annotation.getBoundingPoly());

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, applied.

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ public void testFaces() throws Exception {

// Assert
String got = bout.toString();
assertThat(got).contains("anger:");
assertThat(got).contains("joy:");
assertThat(got).contains("surprise:");
assertThat(got).contains("headwear:");
assertThat(got).contains("under exposed:");
assertThat(got).contains("blurred:");
assertThat(got).contains("position:");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ public void testFaces() throws Exception {

// Assert
String got = bout.toString();
assertThat(got).contains("anger:");
assertThat(got).contains("joy:");
assertThat(got).contains("surprise:");
assertThat(got).contains("headwear:");
assertThat(got).contains("under exposed:");
assertThat(got).contains("blurred:");
assertThat(got).contains("position:");
}
}