Skip to content

Commit

Permalink
docs(samples): move automl samples to nodejs-automl (#332)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkwlui authored and JustinBeckwith committed Mar 3, 2019
1 parent f7d46e7 commit f94900a
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 64 deletions.
7 changes: 0 additions & 7 deletions packages/google-cloud-vision/.cloud-repo-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@
"file": "detect.v1p1beta1.js",
"docs_link": "https://cloud.google.com/vision/docs",
"usage": "node detect.v1p1beta1.js --help"
},
{
"id": "detect.v1p1beta1.js",
"name": "Detection samples for Beta API",
"file": ".automl/automlVisionDataset.js",
"docs_link": "https://cloud.google.com/vision/docs",
"usage": "node automlVisionDataset.js --help"
}
]
}
92 changes: 36 additions & 56 deletions packages/google-cloud-vision/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,80 +8,46 @@
[![npm version](https://img.shields.io/npm/v/@google-cloud/vision.svg)](https://www.npmjs.org/package/@google-cloud/vision)
[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-vision/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-vision)

> Node.js idiomatic client for [Vision API][product-docs].
The [Cloud Vision API](https://cloud.google.com/vision/docs) 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.


* [Vision API Node.js Client API Reference][client-docs]
* [github.com/googleapis/nodejs-vision](https://github.com/googleapis/nodejs-vision)
* [Vision API Documentation][product-docs]

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

[explained]: https://cloud.google.com/apis/docs/client-libraries-explained

**Table of contents:**

* [Quickstart](#quickstart)
* [Before you begin](#before-you-begin)
* [Installing the client library](#installing-the-client-library)
* [Using the client library](#using-the-client-library)
* [Using the client library](#using-the-client-library)
* [Samples](#samples)
* [Versioning](#versioning)
* [Contributing](#contributing)
* [License](#license)

## Quickstart

### Before you begin

1. Select or create a Cloud Platform project.

[Go to the projects page][projects]
## Using the client library

1. Enable billing for your project.
1. [Select or create a Cloud Platform project][projects].

[Enable billing][billing]
1. [Enable billing for your project][billing].

1. Enable the Google Cloud Vision API API.

[Enable the API][enable_api]
1. [Enable the Google Cloud Vision API API][enable_api].

1. [Set up authentication with a service account][auth] so you can access the
API from your local workstation.

[projects]: https://console.cloud.google.com/project
[billing]: https://support.google.com/cloud/answer/6293499#enable-billing
[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=vision.googleapis.com
[auth]: https://cloud.google.com/docs/authentication/getting-started

### Installing the client library
1. Install the client library:

npm install --save @google-cloud/vision
npm install --save @google-cloud/vision

### Using the client library
1. Try an example:

```javascript
// 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);
});
async function quickstart() {
// 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
const [result] = await client.labelDetection('./resources/wakeupcat.jpg');
const labels = result.labelAnnotations;
console.log('Labels:');
labels.forEach(label => console.log(label.description));
}
```

## Samples
Expand Down Expand Up @@ -120,7 +86,21 @@ Apache Version 2.0

See [LICENSE](https://github.com/googleapis/nodejs-vision/blob/master/LICENSE)

## What's Next

* [Vision API Documentation][product-docs]
* [Vision API Node.js Client API Reference][client-docs]
* [github.com/googleapis/nodejs-vision](https://github.com/googleapis/nodejs-vision)

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

[explained]: https://cloud.google.com/apis/docs/client-libraries-explained

[client-docs]: https://cloud.google.com/nodejs/docs/reference/vision/latest/
[product-docs]: https://cloud.google.com/vision/docs
[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png

[projects]: https://console.cloud.google.com/project
[billing]: https://support.google.com/cloud/answer/6293499#enable-billing
[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=vision.googleapis.com
[auth]: https://cloud.google.com/docs/authentication/getting-started
1 change: 0 additions & 1 deletion packages/google-cloud-vision/samples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"test": "mocha system-test --timeout 600000"
},
"dependencies": {
"@google-cloud/automl": "^0.1.3",
"@google-cloud/vision": "^0.25.0",
"mathjs": "^5.0.4",
"natural": "^0.6.1",
Expand Down

0 comments on commit f94900a

Please sign in to comment.