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

Function detectLandmarks

vision/detect.js:116–134  ·  view source on GitHub ↗
(fileName)

Source from the content-addressed store, hash-verified

114}
115
116async function detectLandmarks(fileName) {
117 // [START vision_landmark_detection]
118 const vision = require('@google-cloud/vision');
119
120 // Creates a client
121 const client = new vision.ImageAnnotatorClient();
122
123 /**
124 * TODO(developer): Uncomment the following line before running the sample.
125 */
126 // const fileName = 'Local image file, e.g. /path/to/image.png';
127
128 // Performs landmark detection on the local file
129 const [result] = await client.landmarkDetection(fileName);
130 const landmarks = result.landmarkAnnotations;
131 console.log('Landmarks:');
132 landmarks.forEach(landmark => console.log(landmark));
133 // [END vision_landmark_detection]
134}
135
136async function detectLandmarksGCS(bucketName, fileName) {
137 // [START vision_landmark_detection_gcs]

Callers 1

detect.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected