【发布时间】:2019-10-27 12:02:29
【问题描述】:
当我运行此代码(稍后将用于在 Python 中使用 Google Vision API 检测和提取文本)时,我收到以下错误:
模块 'google.cloud.vision_v1.types' 没有 'Image' 成员 pylint(no-member)
“ImageAnnotatorClient”实例没有“text_detection”成员 pylint(no-member)
from google.cloud import vision
from google.cloud.vision import types
import os, io
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = r'C:\Users\paul\VisionAPI\key.json'
client = vision.ImageAnnotatorClient()
FILE_NAME = 'im3.jpg'
FOLDER_PATH = r'C:\Users\paul\VisionAPI\images'
with io.open(os.path.join(FOLDER_PATH , FILE_NAME), 'rb') as image_file:
content = image_file.read()
image = vision.types.Image(content=content)
response = client.text_detection(image=image)
“___ 的模块/实例没有成员”是什么意思?
【问题讨论】:
标签: google-cloud-platform pylint google-cloud-vision