Convert Google Vision API response to JSON

前端 未结 2 1113
遇见更好的自我
遇见更好的自我 2021-01-12 07:54

Task:

  • Convert Google Vision API response to JSON

Problem:

  • The return value from the API call is
2条回答
  •  长情又很酷
    2021-01-12 08:18

    That library returns plain protobuf objects, which can be serialized to JSON using:

    from google.protobuf.json_format import MessageToJson
    serialized = MessageToJson(original)
    

    This worked for me.

提交回复
热议问题