The amount of data that Vision can return can be pretty deep and processing more than one image at a time adds another level to that.
Here's my proposed approach to work with multiple images with multiple feature types.
>>>images=client.batch()
>>>foriinrange(10):
... images.add_image(client.image(source_uri='gs://%s.jpg'% (i,)))
>>>images.detect_faces()
{'0.jpg': [], '1.jpg': [],}
>>>>>># With multiple feature types.>>>features= [Feature(FeatureTypes.FACE_DETECTION, 5),
... Feature(FeatureTypes.LOGO_DETECTION, 3)]
>>>foriinrange(10):
... image=client.image(source_uri='gs://%s.jpg'% (i,))
... images.add_image(image=image, features=features)
>>>images.detect()With a context manager it could look something like this...
>>>features= [Feature(FeatureTypes.FACE_DETECTION, 5),
... Feature(FeatureTypes.LOGO_DETECTION, 3)]
>>>withclient.images() asimages:
... foriinrange(10):
... image=client.image(source_uri='gs://%s.jpg'% (i,))
... images.add_image(image=image, features=features)
... results=images.detect()
The amount of data that Vision can return can be pretty deep and processing more than one image at a time adds another level to that.
Here's my proposed approach to work with multiple images with multiple feature types.
With a context manager it could look something like this...