How to use the @google-cloud/vision.v1p3beta1.ImageAnnotatorClient function in @google-cloud/vision

To help you get started, we’ve selected a few @google-cloud/vision examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github googleapis / nodejs-vision / samples / detect.v1p3beta1.js View on Github external
async function detectHandwritingGCS(uri) {
  // [START vision_handwritten_ocr_gcs_beta]
  // Imports the Google Cloud client libraries
  const vision = require('@google-cloud/vision').v1p3beta1;
  const fs = require('fs');

  // Creates a client
  const client = new vision.ImageAnnotatorClient();

  /**
   * TODO(developer): Uncomment the following line before running the sample.
   */
  // const uri = `gs://bucket/bucketImage.png`;

  const request = {
    image: {
      content: fs.readFileSync(uri),
    },
    feature: {
      languageHints: ['en-t-i0-handwrit'],
    },
  };

  const [result] = await client.documentTextDetection(request);
github googleapis / nodejs-vision / samples / detect.v1p3beta1.js View on Github external
async function detectHandwritingOCR(fileName) {
  // [START vision_handwritten_ocr_beta]
  // Imports the Google Cloud client libraries
  const vision = require('@google-cloud/vision').v1p3beta1;
  const fs = require('fs');

  // Creates a client
  const client = new vision.ImageAnnotatorClient();

  /**
   * TODO(developer): Uncomment the following line before running the sample.
   */
  // const fileName = `/path/to/localImage.png`;

  const request = {
    image: {
      content: fs.readFileSync(fileName),
    },
    feature: {
      languageHints: ['en-t-i0-handwrit'],
    },
  };

  const [result] = await client.documentTextDetection(request);