Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const vision = require('@google-cloud/vision');
- // Creates a client
- const client = new vision.ImageAnnotatorClient();
- /**
- * TODO(developer): Uncomment the following line before running the sample.
- */
- const fileName = '/Tickets/leclerc.jpg';
- // Performs text detection on the local file
- const [result] = await client.textDetection(fileName);
- const detections = result.textAnnotations;
- console.log('Text:');
- detections.forEach(text => console.log(text));
- const detectLocalFile = async function() {
- const [result] = await client.textDetection(fileName);
- {...}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement