1
0

Merge pull request #1 from erickahmed/main

Initial code testing completion
This commit is contained in:
Erick
2022-07-22 22:19:39 +02:00
committed by GitHub
6 changed files with 39 additions and 0 deletions
+6
View File
@@ -127,3 +127,9 @@ dmypy.json
# Pyre type checker
.pyre/
# Folder ignore
#vision-env
keys
bin
lib
Binary file not shown.

After

Width:  |  Height:  |  Size: 197 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

+8
View File
@@ -0,0 +1,8 @@
home = /usr
implementation = CPython
version_info = 3.9.7.final.0
virtualenv = 20.15.1
include-system-site-packages = false
base-prefix = /usr
base-exec-prefix = /usr
base-executable = /usr/bin/python3
+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)