Uh oh!
There was an error while loading. Please reload this page.
Vision: Add batch processing - #2978
Conversation
| """Batch multiple images into one request.""" | ||
| class Batch(object): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| """ | ||
| return self._images | ||
| def detect(self): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| self._annotator_client = image_annotator_client.ImageAnnotatorClient() | ||
| def annotate(self, image, features): | ||
| def annotate(self, images): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| ********************* | ||
| Multiple images can be processed with a single request by passing ``Image``s to | ||
| ``Client.batch(images)``. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| >>> batch.add_image(image_one, [face_feature, logo_feature]) | ||
| >>> batch.add_image(image_two, [logo_feature]) | ||
| >>> results = batch.detect() | ||
| >>> for face in results[0].faces: |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| self._assert_properties(properties) | ||
| class TestVisionBatchProcessing(BaseVisionTestCase): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| self._annotator_client = image_annotator_client.ImageAnnotatorClient() | ||
| def annotate(self, image, features): | ||
| def annotate(self, images): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| """Batch multiple images into one request.""" | ||
| class Batch(object): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| self._use_gax = use_gax | ||
| def batch(self): | ||
| """Batch image processing. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
daspecster
commented
Feb 6, 2017
I just wanted to check. I think everything was addressed here? |
I would still like to understand why |
daspecster
commented
Feb 9, 2017
@lukesneeringer That said, the signature change is required because multiple images need to be passed to You build multiple Alternatively I could have duplicated the |
lukesneeringer
commented
Feb 9, 2017
Okay, that is fine. |
daspecster
commented
Feb 9, 2017
Ok, I'll merge this in an hour or two. There's some other vision work that I want to get closer to finished before I rebase this into it. |
* Add Vision batch support to the surface.
* Add Vision batch support to the surface.
I wasn't sure the best way to add the context manager to
Batchsince there needs to be a result returned. I'm not sure of a good way to do that from a context manager's__exit__without attaching the results to something.Closes#2897