我正在处理下图。尝试通过运行以下代码来识别瓶子的坐标:
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_obj
或objects
时返回无。我做错了还是Google API的限制?
我也尝试过使用 pytesseract ,但它也不起作用。