From 4db80beeeb2106f629638d0e789e230c0a12a313 Mon Sep 17 00:00:00 2001 From: Rebecca Taylor Date: Tue, 18 Sep 2018 10:50:31 -0700 Subject: [PATCH] Fix response output for Detect Labels (#199) Before, this was dumping an object via console.log Now, this properly prints just the label description --- vision/samples/detect.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vision/samples/detect.js b/vision/samples/detect.js index 4332f73063..398c040d95 100644 --- a/vision/samples/detect.js +++ b/vision/samples/detect.js @@ -102,7 +102,7 @@ function detectLabels(fileName) { .then(results => { const labels = results[0].labelAnnotations; console.log('Labels:'); - labels.forEach(label => console.log(label)); + labels.forEach(label => console.log(label.description)); }) .catch(err => { console.error('ERROR:', err); @@ -130,7 +130,7 @@ function detectLabelsGCS(bucketName, fileName) { .then(results => { const labels = results[0].labelAnnotations; console.log('Labels:'); - labels.forEach(label => console.log(label)); + labels.forEach(label => console.log(label.description)); }) .catch(err => { console.error('ERROR:', err);