Google Vision API出现问题-对象本地化无法正常工作

时间:2019-04-26 01:12:27

标签: api ocr google-vision

我正在处理下图。尝试通过运行以下代码来识别瓶子的坐标:

from google.cloud import vision
from google.protobuf.json_format import MessageToJson
from google.protobuf.json_format import MessageToDict    

def localize_objects(self, path):

    client = vision.ImageAnnotatorClient()

    with open(path, 'rb') as image_file:
        content = image_file.read()

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

    objects = client.object_localization(image=image)
    serialized_obj = MessageToDict(objects)

    return json.loads(json.dumps(serialized_obj))

尽管,在打印serialized_objobjects时返回无。我做错了还是Google API的限制? 我也尝试过使用 pytesseract ,但它也不起作用。

enter image description here

0 个答案:

没有答案