Skip to content

Commit 4db80be

Browse files
authored
Fix response output for Detect Labels (#199)
Before, this was dumping an object via console.log Now, this properly prints just the label description
1 parent 1bc7f0a commit 4db80be

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vision/samples/detect.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function detectLabels(fileName) {
102102
.then(results => {
103103
const labels = results[0].labelAnnotations;
104104
console.log('Labels:');
105-
labels.forEach(label => console.log(label));
105+
labels.forEach(label => console.log(label.description));
106106
})
107107
.catch(err => {
108108
console.error('ERROR:', err);
@@ -130,7 +130,7 @@ function detectLabelsGCS(bucketName, fileName) {
130130
.then(results => {
131131
const labels = results[0].labelAnnotations;
132132
console.log('Labels:');
133-
labels.forEach(label => console.log(label));
133+
labels.forEach(label => console.log(label.description));
134134
})
135135
.catch(err => {
136136
console.error('ERROR:', err);

0 commit comments

Comments
 (0)