i'm trying to use google vision to detect text from a batch of 15 documents at once, i want it to be don't Asynchronously.
unfortunately the time it takes for client.async_batch_annotate_images() function, is the same as client.batch_annotate_images() function, which is the same time it takes if i iterate over the list of features with client.document_text_detection()
i am not sure why the response takes so much time, and maybe i am doing something wrong, i would love to get your expert opinion on this.
for example, that is how i extract the text using batch annotate images
def batch_ocr_images():
client = vision.ImageAnnotatorClient()
requests = []
features = [vision.Feature(type_=vision.Feature.Type.DOCUMENT_TEXT_DETECTION)]
for image_file in images_files:
with io.open(image_file, 'rb') as image_data:
content = image_data.read()
image = vision.Image(content=content)
request = vision.AnnotateImageRequest(image=image, features=features)
requests.append(request)
client.batch_annotate_images(requests=requests)
is this how it should work asynchronously? because it works the same speed as it does when i iterate over the images and scan one image at a time.
thanks in advance, Yaniv