-
Notifications
You must be signed in to change notification settings - Fork 592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: updated vision detect params/examples #1500
docs: updated vision detect params/examples #1500
Conversation
* @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 |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@stephenplusplus WDYT? |
I think we just need a different example (#1500 (comment)). Sorry that I'm struggling to come up with something specific to suggest... the only thing is that it shouldn't confuse people into thinking they have to use fs.readFile() to have an image on disk run through feature detection. |
I think that there are many sorts of buffers sources, like DBs, remote services, incoming http requests, etc., IMHO doc shouldn't describe all these sources and maybe example should be transformed to a common form of getting buffer like: getBufferFromSomewhere(function(err, buffer) {
vision.detect(buffer, types, function(err, detection, apiResponse) {});
}); |
var db = require('level')('./users-database');
db.get('user-image', { encoding: 'binary' }, function(err, img) {
if (err) {
// Error handling omitted.
}
vision.detect(img, function(err, detection, apiResponse) {});
}); |
@stephenplusplus WDYT about using @calibr's example? IIRC a lot of our customers use AWS services as well, so I think it has the added benefit of being a common use case. |
@@ -519,6 +535,7 @@ Vision.prototype.detect = function(images, options, callback) { | |||
}); | |||
}); | |||
}; | |||
// jscs:enable maximumLineLength |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@stephenplusplus @calibr updated the example, PTAL |
* docs: updated vision detect params/examples * updated buffer example
Relates to #1488 (comment)