Repository navigation
fix(vision): remove deprecated emotion fields from face detection samples - #10400
bibliofilo wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the face detection snippets and integration tests to extract and assert headwear, under-exposed, and blurred likelihoods instead of anger, joy, and surprise. However, a critical syntax error was introduced in both DetectFaces.java and DetectFacesGcs.java due to an extra closing parenthesis after annotation.getUnderExposedLikelihood(), which will prevent compilation. The review comments correctly identify these syntax errors and provide the necessary code suggestions to resolve them.
| "headwear: %s%nunder exposed: %s%nblurred: %s%nposition: %s", | ||
| annotation.getHeadwearLikelihood(), | ||
| annotation.getUnderExposedLikelihood()), | ||
| annotation.getBlurredLikelihood(), | ||
| annotation.getBoundingPoly()); |
There was a problem hiding this comment.
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.
| "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()); |
…ctFaces.java Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Description
Removes
joyLikelihood,sorrowLikelihood,angerLikelihood, andsurpriseLikelihoodfrom face detection samples (DetectFacesGcs.javaandDetectFaces.java) and corresponding tests. Replaces the removed attributes with active likelihood fields:headwear,under exposed, andblurred.Emotion recognition attributes in Cloud Vision API Face Detection were deprecated on October 15, 2026, and permanently return
UNKNOWN.Fixes: b/592146954
Checklist
Testing
mvn clean verifyrequiredmvn -P lint checkstyle:checkrequiredmvn -P lint clean compile pmd:cpd-check spotbugs:checkadvisory onlyCompliance & Style
pom.xmlparent set to latestshared-configurationPost-Approval Actions