* Detects text in an image file * * ARGS * inputFile: path to image file * RETURNS * string of text detected in the input image
(inputFile)
| 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] |