Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. const vision = require('@google-cloud/vision');
  2.  
  3. // Creates a client
  4. const client = new vision.ImageAnnotatorClient();
  5.  
  6. /**
  7. * TODO(developer): Uncomment the following line before running the sample.
  8. */
  9. const fileName = '/Tickets/leclerc.jpg';
  10.  
  11. // Performs text detection on the local file
  12. const [result] = await client.textDetection(fileName);
  13. const detections = result.textAnnotations;
  14. console.log('Text:');
  15. detections.forEach(text => console.log(text));
  16.  
  17. const detectLocalFile = async function() {
  18. const [result] = await client.textDetection(fileName);
  19. {...}
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement