You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So client.images() is like a batch? Why not name it as such? What is the equivalent backend method that you'd be using? (Or would you just be sending N requests?)
SGTM. As for the interface of the batch, you should check out the datastore batch / accompanying docs. It commits on __exit__, but we also document an explicit public interface people can use to add mutations to the batch and to manually commit or rollback the batch (rollback is datastore transaction specific).
Is there a benefit to running batch if we are asking for the same feature. Would I expect performance increase by running batch versus looping through N requests?
Activity
dhermes commentedon Dec 28, 2016
So
client.images()is like a batch? Why not name it as such? What is the equivalent backend method that you'd be using? (Or would you just be sendingNrequests?)daspecster commentedon Dec 28, 2016
It will actually be one request with
Nvision request objects, so I could change it tobatch().The GAPIC method is called
batch_annotate_images.dhermes commentedon Dec 28, 2016
SGTM. As for the interface of the batch, you should check out the datastore batch / accompanying docs. It commits on
__exit__, but we also document an explicit public interface people can use to add mutations to the batch and to manually commit or rollback the batch (rollback is datastore transaction specific).tseaver commentedon Dec 28, 2016
I definitely like having the context manager be "sugar" over an explicit imperative surface.
bw4sz commentedon Jun 16, 2017
Is there a benefit to running batch if we are asking for the same feature. Would I expect performance increase by running batch versus looping through N requests?
daspecster commentedon Jun 16, 2017
@bw4sz yes, batching only makes one large request rather than multiple smaller requests, so it should be faster.
See: https://cloud.google.com/vision/docs/reference/rpc/google.cloud.vision.v1#google.cloud.vision.v1.ImageAnnotator.BatchAnnotateImages
bw4sz commentedon Jun 17, 2017
daspecster commentedon Jun 19, 2017
It looks like the max number of images per request(which may be a soft limit?) is 16.
@lukesneeringer could probably confirm this for you though.
cbg44 commentedon Mar 30, 2019
the limit is 100 per request.