Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

Commit

Permalink
docs: updated vision detect params/examples (#1500)
Browse files Browse the repository at this point in the history
* docs: updated vision detect params/examples

* updated buffer example
  • Loading branch information
callmehiphop authored and stephenplusplus committed Aug 29, 2016
1 parent d9f8046 commit 97f6984
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ Vision.prototype.annotate = function(requests, callback) {
});
};

// jscs:disable maximumLineLength
/**
* Detect properties from an image (or images) of one or more types.
*
Expand All @@ -156,9 +157,10 @@ Vision.prototype.annotate = function(requests, callback) {
* For the response in the original format, review the `apiResponse` argument
* your callback receives.
*
* @param {string|string[]|module:storage/file|module:storage/file[]} images -
* The source image(s) to run the detection on. It can be either a local
* image path, a remote image URL, or a @google-cloud/storage File object.
* @param {string|string[]|buffer|buffer[]|module:storage/file|module:storage/file[]} images - The
* source image(s) to run the detection on. It can be either a local image
* path, a remote image URL, a Buffer, or a @google-cloud/storage File
* object.
* @param {string[]|object=} options - An array of types or a configuration
* object.
* @param {object=} options.imageContext - See an
Expand Down Expand Up @@ -210,6 +212,20 @@ Vision.prototype.annotate = function(requests, callback) {
* vision.detect(img, types, function(err, detection, apiResponse) {});
*
* //-
* // Run feature detection over a Buffer.
* //-
* var level = require('level');
* var db = level('./users-database');
*
* db.get('user-image', { encoding: 'binary' }, function(err, image) {
* if (err) {
* // Error handling omitted.
* }
*
* vision.detect(image, function(err, detection, apiResponse) {});
* });
*
* //-
* // Supply multiple images for feature detection.
* //-
* var images = [
Expand Down Expand Up @@ -519,6 +535,7 @@ Vision.prototype.detect = function(images, options, callback) {
});
});
};
// jscs:enable maximumLineLength

/**
* Run face detection against an image.
Expand Down

0 comments on commit 97f6984

Please sign in to comment.