diff --git a/packages/vision/src/index.js b/packages/vision/src/index.js index 497ec39f412..065c5d27259 100644 --- a/packages/vision/src/index.js +++ b/packages/vision/src/index.js @@ -960,12 +960,19 @@ Vision.prototype.detectCrops = function(images, options, callback) { * // }, * // confidence: 56.748849, * // anger: false, + * // angerLikelihood: 1, * // blurred: false, + * // blurredLikelihood: 1, * // headwear: false, + * // headwearLikelihood: 1, * // joy: false, + * // joyLikelihood: 1, * // sorrow: false, + * // sorrowLikelihood: 1, * // surprise: false, - * // underExposed: false + * // surpriseLikelihood: 1, + * // underExposed: false, + * // underExposedLikelihood: 1 * // } * // ] * }); @@ -1916,6 +1923,8 @@ Vision.formatFaceAnnotation_ = function(faceAnnotation) { formattedFaceAnnotation[shortenedProp] = Vision.gteLikelihood_(LIKELY, faceAnnotation[prop]); + + formattedFaceAnnotation[prop] = Vision.likelihood[faceAnnotation[prop]]; } } diff --git a/packages/vision/test/index.js b/packages/vision/test/index.js index 4c0821b5220..2693336fefd 100644 --- a/packages/vision/test/index.js +++ b/packages/vision/test/index.js @@ -1474,15 +1474,23 @@ describe('Vision', function() { confidence: faceAnnotation.detectionConfidence * 100, anger: true, + angerLikelihood: 3, blurred: true, + blurredLikelihood: 3, headwear: true, + headwearLikelihood: 3, joy: true, + joyLikelihood: 3, sorrow: true, + sorrowLikelihood: 3, surprise: true, + surpriseLikelihood: 3, underExposed: true, + underExposedLikelihood: 3, // Checks that *any* property that ends in `Likelihood` is shortened. - nonExistent: true + nonExistent: true, + nonExistentLikelihood: 3 }; var formatted = Vision.formatFaceAnnotation_(faceAnnotation);