python - 通过 python 使用 FacePlusPlus API

标签 python image-processing face

我收到以下错误。

'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 编码(例如,一个很长的字符串)。

关于python - 通过 python 使用 FacePlusPlus API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52424021/

相关文章:

python - 通过 OpenCV 将 MTCNN 与网络摄像头配合使用

typescript - 为什么我不能在 ThreeJS Typescript 项目中创建 Face3

python - 如何将目录导入为python模块

python - 使用 Python 使用 Google、Facebook 或 Twitter 帐户登录网站

python - 为什么我计算数字阶乘的算法的时间复杂度是 O(n^2) 而不是预期的 O(n)?

image - 如何组合一幅图像的相位和不同图像的大小?

opencv - 奇/偶迭代是什么意思?

python - 使用 Python/PIL 比较(相似)图像

image - 如何在 MATLAB 中创建复古图像?

math - 绘制带有 3D 顶点的 2D 面