Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
arithmetic1728 committed Sep 24, 2020
1 parent 17c018a commit bd8dad3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
5 changes: 2 additions & 3 deletions samples/snippets/detect/beta_snippets.py
Expand Up @@ -299,7 +299,7 @@ def async_batch_annotate_images_uri(input_image_uri, output_uri):
import re

from google.cloud import storage
from google.protobuf import json_format

from google.cloud import vision_v1p4beta1 as vision
client = vision.ImageAnnotatorClient()

Expand Down Expand Up @@ -347,8 +347,7 @@ def async_batch_annotate_images_uri(input_image_uri, output_uri):
output = blob_list[0]

json_string = output.download_as_string()
response = json_format.Parse(json_string,
vision.BatchAnnotateImagesResponse())
response = vision.BatchAnnotateImagesResponse.from_json(json_string)

# Prints the actual response for the first annotate image request.
print(u'The annotation response for the first request: {}'.format(
Expand Down
5 changes: 2 additions & 3 deletions samples/snippets/detect/detect.py
Expand Up @@ -808,7 +808,7 @@ def async_detect_document(gcs_source_uri, gcs_destination_uri):
import re
from google.cloud import vision
from google.cloud import storage
from google.protobuf import json_format

# Supported mime_types are: 'application/pdf' and 'image/tiff'
mime_type = 'application/pdf'

Expand Down Expand Up @@ -860,8 +860,7 @@ def async_detect_document(gcs_source_uri, gcs_destination_uri):
output = blob_list[0]

json_string = output.download_as_string()
response = json_format.Parse(
json_string, vision.AnnotateFileResponse())
response = vision.AnnotateFileResponse.from_json(json_string)

# The actual response for the first page of the input file.
first_page_response = response.responses[0]
Expand Down
6 changes: 4 additions & 2 deletions samples/snippets/product_search/product_search.py
Expand Up @@ -76,7 +76,8 @@ def get_similar_products_file(
image, image_context=image_context)

index_time = response.product_search_results.index_time
print('Product set index time: {}').format(index_time)
print('Product set index time: ')
print(index_time)

results = response.product_search_results.results

Expand Down Expand Up @@ -136,7 +137,8 @@ def get_similar_products_uri(
image, image_context=image_context)

index_time = response.product_search_results.index_time
print('Product set index time: {}').format(index_time)
print('Product set index time: ')
print(index_time)

results = response.product_search_results.results

Expand Down
6 changes: 4 additions & 2 deletions samples/snippets/product_search/product_set_management.py
Expand Up @@ -85,7 +85,8 @@ def list_product_sets(project_id, location):
print('Product set name: {}'.format(product_set.name))
print('Product set id: {}'.format(product_set.name.split('/')[-1]))
print('Product set display name: {}'.format(product_set.display_name))
print('Product set index time: {}').format(product_set.index_time)
print('Product set index time: ')
print(product_set.index_time)
# [END vision_product_search_list_product_sets]


Expand All @@ -111,7 +112,8 @@ def get_product_set(project_id, location, product_set_id):
print('Product set name: {}'.format(product_set.name))
print('Product set id: {}'.format(product_set.name.split('/')[-1]))
print('Product set display name: {}'.format(product_set.display_name))
print('Product set index time: {}').format(product_set.index_time)
print('Product set index time: ')
print(product_set.index_time)
# [END vision_product_search_get_product_set]


Expand Down

0 comments on commit bd8dad3

Please sign in to comment.