我无法从API调用中解析此JSON响应,我想提取板值(KA40M9202).
api_response = api_instance.recognize_bytes(params,...,...,...,...)
pprint (api_response)
Run Code Online (Sandbox Code Playgroud)
打印以下内容
{'results': [{'candidates': [{'confidence': 70.61698913574219,
'matches_template': 0,
'plate': 'KA40M9202'},
{'confidence': 65.3728256225586,
'matches_template': 0,
'plate': 'KA30M9202'},
{'confidence': 65.3718490600586,
'matches_template': 0,
'plate': 'KA10M9202'}],
'matches_template': 0,
'plate': 'KA40M9202',
'processing_time_ms': 39.60576629638672,
}
Run Code Online (Sandbox Code Playgroud)
在调用时json.loads(),会显示错误
jsonstr = json.loads(api_response)
Run Code Online (Sandbox Code Playgroud)
错误的消息
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
TypeError: expected string or buffer
Run Code Online (Sandbox Code Playgroud)