Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I tried running a basic code to run on Pycharm by adding google-cloud-vision in the Interpreter Setting. But all I'm getting is 'Process finished with exit code 0'. What am I doing wrong?

import os, io
from google.cloud import vision_v1
from google.cloud.vision_v1 import types

credential_path = r'C:UsersilianPycharmProjectspythonProject2vision_api.json'  #change folder
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = credential_path



client = vision_v1.ImageAnnotatorClient()

FILE_NAME = 'test.png'
FOLDER_PATH = r'C:UsersilianPycharmProjectspythonProject2'

with io.open(os.path.join(FOLDER_PATH, FILE_NAME), 'rb') as image_file:
    content = image_file.read()

image = vision_v1.types.Image(content = content)

response = client.text_detection(image=image)
question from:https://stackoverflow.com/questions/65932788/why-doesnt-google-vision-api-work-with-my-code

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.1k views
Welcome To Ask or Share your Answers For Others

1 Answer

Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...