-
Notifications
You must be signed in to change notification settings - Fork 642
vision: support ImageContext in detect requests #1342
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
Conversation
ImageContext allows the user to provide "hints" about the content of the image to the Vision API. See https://cloud.google.com/vision/reference/rest/v1/images/annotate#ImageContext.
|
Thank you for this! I think it would be nice to have a test added. It would basically look like this one: https://github.com/okofish/gcloud-node/blob/f5e92621e67bb339de704e500eeff8e8971bed00/test/vision/index.js#L314. |
lib/vision/index.js
Outdated
| * `logos`, `properties`, `safeSearch`, `text`. | ||
| * @param {boolean=} options.verbose - Use verbose mode, which returns a less- | ||
| * simplistic representation of the annotation (default: `false`). | ||
| * @param {object=} options.imageContext - An `ImageContext`. See an |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
OK, I alphabetized the doc lines and added a test. |
| features: { | ||
| type: 'LABEL_DETECTION' | ||
| }, | ||
| imageContext: imageContext |
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.
|
Thanks for making the updates. Just waiting for Travis to finish running the tests, then I'll merge it in. |
|
Changes Unknown when pulling 2f59a47 on okofish:master into * on GoogleCloudPlatform:master*. |
|
Changes Unknown when pulling 7c3208e on okofish:master into * on GoogleCloudPlatform:master*. |
|
Thanks again! |
|
No problem, glad to help out! |
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
* Add descriptions for some query parameters * Eliminate the extra space * Add a description to all the alias parameters * Add documentation for property parameters * Add descriptions for the aggregation argument * Add property params to these objects * Add descriptions for data types * Fix the broken links * Add documentation for the addExcludeFromIndexes * Buffer description * Add a description for entity filters * Add parameters documentation for the `and` and `or * Add descriptions for the filter object * Add some parameter documentation for the client * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Add support for ImageContext "hints" in the
detectfunction, removing the need to construct an AnnotateImageRequest if you want to use this functionality.No tests were added because this doesn't seem to be a "testable" feature, but let me know if I should.