import io,os
# Imports the Google Cloud client library
from google.cloud import vision
# Instantiates a client (Change the line below******)
vision_client = vision.ImageAnnotatorClient('my-key.json')
# The name of the image file to annotate (Change the line below 'image_path.jpg' ******)
file_name = os.path.join(
os.path.dirname(__file__),
'image_path.jpg')
# Loads the image into memory
with io.open(file_name, 'rb') as image_file:
content = image_file.read()
image = vision_client.image(
content=content)
# Performs label detection on the image file
labels = image.detect_labels()
print('Labels:')
for label in labels:
print(label.description)
python 3.6.5 на windows
этот пример кода дает мне упоминание об ошибке в заголовке, кто-нибудь знает, как это исправить?