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

Function picToText

translate/hybridGlossaries.js:46–53  ·  view source on GitHub ↗

* Detects text in an image file * * ARGS * inputFile: path to image file * RETURNS * string of text detected in the input image

(inputFile)

Source from the content-addressed store, hash-verified

44 * string of text detected in the input image
45 **/
46 async function picToText(inputFile) {
47 // Creates a client
48 const client = new vision.ImageAnnotatorClient();
49
50 // Performs text detection on the local file
51 const [result] = await client.textDetection(inputFile);
52 return result.fullTextAnnotation.text;
53 }
54 // [END translate_hybrid_vision]
55
56 // [START translate_hybrid_create_glossary]

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected