1
0

Folder rearrangement

This commit is contained in:
Erick
2022-07-22 22:12:44 +02:00
parent d821a0f313
commit 2b55890f60
5 changed files with 1 additions and 1 deletions
+25
View File
@@ -0,0 +1,25 @@
import io
import os
# Imports the Google Cloud client library
from google.cloud import vision
# Instantiates a client
client = vision.ImageAnnotatorClient()
# The name of the image file to annotate
file_name = os.path.abspath('images/mmr.jpg')
# Loads the image into memory
with io.open(file_name, 'rb') as image_file:
content = image_file.read()
image = vision.Image(content=content)
# Performs label detection on the image file
response = client.label_detection(image=image)
labels = response.label_annotations
print('Labels:')
for label in labels:
print(label.description)