MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/nodejs-docs-samples / main

Function main

vision/quickstart.js:22–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20// usage: node quickstart.js
21
22function main() {
23 // [START vision_quickstart]
24 async function quickstart() {
25 // Imports the Google Cloud client library
26 const vision = require('@google-cloud/vision');
27
28 // Creates a client
29 const client = new vision.ImageAnnotatorClient();
30
31 // Performs label detection on the image file
32 const [result] = await client.labelDetection('./resources/wakeupcat.jpg');
33 const labels = result.labelAnnotations;
34 console.log('Labels:');
35 labels.forEach(label => console.log(label.description));
36 }
37 quickstart();
38 // [END vision_quickstart]
39}
40
41process.on('unhandledRejection', err => {
42 console.error(err.message);

Callers 1

quickstart.jsFile · 0.70

Calls 1

quickstartFunction · 0.70

Tested by

no test coverage detected