From 09eab414158efaccc9bf0a4a80464412814afeff Mon Sep 17 00:00:00 2001 From: Agnel Vishal Date: Wed, 22 May 2019 03:22:05 +0530 Subject: [PATCH] Update detect.py 1) I got argument parse error when bucket_name=bucket_name is given 2)blob_list[0] gave me folder name --- vision/cloud-client/detect/detect.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vision/cloud-client/detect/detect.py b/vision/cloud-client/detect/detect.py index 8a285b785581..616fdec3ee19 100644 --- a/vision/cloud-client/detect/detect.py +++ b/vision/cloud-client/detect/detect.py @@ -704,7 +704,7 @@ def async_detect_document(gcs_source_uri, gcs_destination_uri): bucket_name = match.group(1) prefix = match.group(2) - bucket = storage_client.get_bucket(bucket_name=bucket_name) + bucket = storage_client.get_bucket(bucket_name) # List objects with the given prefix. blob_list = list(bucket.list_blobs(prefix=prefix)) @@ -715,7 +715,7 @@ def async_detect_document(gcs_source_uri, gcs_destination_uri): # Process the first output file from GCS. # Since we specified batch_size=2, the first response contains # the first two pages of the input file. - output = blob_list[0] + output = blob_list[1] json_string = output.download_as_string() response = json_format.Parse(