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

Function detectLandmarksGCS

vision/detect.js:136–158  ·  view source on GitHub ↗
(bucketName, fileName)

Source from the content-addressed store, hash-verified

134}
135
136async function detectLandmarksGCS(bucketName, fileName) {
137 // [START vision_landmark_detection_gcs]
138 // Imports the Google Cloud client libraries
139 const vision = require('@google-cloud/vision');
140
141 // Creates a client
142 const client = new vision.ImageAnnotatorClient();
143
144 /**
145 * TODO(developer): Uncomment the following lines before running the sample.
146 */
147 // const bucketName = 'Bucket where the file resides, e.g. my-bucket';
148 // const fileName = 'Path to file within bucket, e.g. path/to/image.png';
149
150 // Performs landmark detection on the gcs file
151 const [result] = await client.landmarkDetection(
152 `gs://${bucketName}/${fileName}`
153 );
154 const landmarks = result.landmarkAnnotations;
155 console.log('Landmarks:');
156 landmarks.forEach(landmark => console.log(landmark));
157 // [END vision_landmark_detection_gcs]
158}
159
160async function detectText(fileName) {
161 // [START vision_text_detection]

Callers 1

detect.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected