Node.js client for Google Cloud Vision: Derive insight from images.
Permalink
Failed to load latest commit information.
.circleci chore: update CircleCI config (#253) Nov 1, 2018
.github chore: update issue templates (#244) Oct 25, 2018
.kokoro chore: use latest npm on Windows (#258) Nov 7, 2018
protos/google/cloud/vision feat: add support for product search Nov 5, 2018
samples chore(deps): update dependency @google-cloud/nodejs-repo-tools to v3 (#… Nov 10, 2018
smoke-test refactor: remove unused deps (#261) Nov 9, 2018
src feat: add support for product search Nov 5, 2018
system-test refactor: remove unused deps (#261) Nov 9, 2018
test chore: update lint configs (#257) Nov 6, 2018
.cloud-repo-tools.json docs: Vision AutoML samples (#197) Sep 27, 2018
.eslintignore chore: update eslintignore config (#264) Nov 12, 2018
.eslintrc.yml Enable prefer-const in the eslint config (#201) Sep 20, 2018
.gitignore Fix the sample tests (#187) Sep 8, 2018
.jsdoc.js Updated CI config and run synth (#181) Sep 4, 2018
.nycrc Repository Migration (#4) Nov 17, 2017
.prettierignore Repository Migration (#4) Nov 17, 2017
.prettierrc Repository Migration (#4) Nov 17, 2017
CHANGELOG.md feat: release v0.23.0 (#259) Nov 8, 2018
CODE_OF_CONDUCT.md Repository Migration (#4) Nov 17, 2017
LICENSE Repository Migration (#4) Nov 17, 2017
README.md Vision GA Samples (#52) Apr 5, 2018
codecov.yaml Update kokoro config (#214) Oct 2, 2018
greenkeeper.json repo: setup greenkeeper.json to update dependencies in samples/packag… Jun 25, 2018
package.json fix(deps): update dependency google-gax to ^0.22.0 (#265) Nov 15, 2018
renovate.json chore: ignore package-lock.json (#160) Aug 7, 2018
synth.py chore: update lint configs (#257) Nov 6, 2018

README.md

Google Cloud Platform logo

Google Cloud Vision API: Node.js Client

release level CircleCI AppVeyor codecov

Node.js idiomatic client for Vision API.

The Cloud Vision API allows developers to easily integrate vision detection features within applications, including image labeling, face and landmark detection, optical character recognition (OCR), and tagging of explicit content.

Read more about the client libraries for Cloud APIs, including the older Google APIs Client Libraries, in Client Libraries Explained.

Table of contents:

Quickstart

Before you begin

  1. Select or create a Cloud Platform project.

    Go to the projects page

  2. Enable billing for your project.

    Enable billing

  3. Enable the Google Cloud Vision API API.

    Enable the API

  4. Set up authentication with a service account so you can access the API from your local workstation.

Installing the client library

npm install --save @google-cloud/vision

Using the client library

// Imports the Google Cloud client library
const vision = require('@google-cloud/vision');

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

// Performs label detection on the image file
client
  .labelDetection('./resources/wakeupcat.jpg')
  .then(results => {
    const labels = results[0].labelAnnotations;

    console.log('Labels:');
    labels.forEach(label => console.log(label.description));
  })
  .catch(err => {
    console.error('ERROR:', err);
  });

Samples

Samples are in the samples/ directory. The samples' README.md has instructions for running the samples.

Sample Source Code Try it
Detection samples source code Open in Cloud Shell
Detection samples for Beta API source code Open in Cloud Shell

The Vision API Node.js Client API Reference documentation also contains samples.

Versioning

This library follows Semantic Versioning.

This library is considered to be in beta. This means it is expected to be mostly stable while we work toward a general availability release; however, complete stability is not guaranteed. We will address issues and requests against beta libraries with a high priority.

More Information: Google Cloud Platform Launch Stages

Contributing

Contributions welcome! See the Contributing Guide.

License

Apache Version 2.0

See LICENSE