将 FacePlusPlus API 与 python 结合使用



我收到以下错误。

'error_message': 'BAD_ARGUMENTS

当我执行这个 python 代码时。

import requests
import json
response = requests.post(
'https://api-us.faceplusplus.com/facepp/v3/detect',
{
'api_key': "******",
'api_secret': "********",
# 'image_url': img_url,
'image_base64': 'iop.jpg',
'return_landmark': 1,
'return_attributes': 
'headpose,eyestatus,facequality,mouthstatus,eyegaze'
}
)
print(response.json())

我已经坚持了很长时间,不知道错误是什么。我检查了网站,它说'解析一些参数时出错。此错误可能是由非法类型或参数长度引起的。 但不知道该怎么办。

image_base64参数应该是图像文件的内容,base64编码(例如,一个很长的字符串(。

最新更新