首页 版块 访问AI主站 注册 发帖
yagyag26
6
积分 积分商城
0
获赞
【吐槽有奖】人脸服务应该怎样,你说了算!
Ta的回复 :#python 3.7 运行程序出现以下错误 from aip import AipFace import base64 import json """ 你的 APPID AK SK """ APP_ID = '11740970' API_KEY = 'G9IFPKBGEXLIDFAFDeXqO4he' SECRET_KEY = '4QK5urH969eSsYXA0WBCGbSs8qHWFkPQ' client = AipFace(APP_ID, API_KEY, SECRET_KEY) #tt = client.groupAdd("new11") #tt = client.getVersion() image = base64.b64encode(open('22.jpg', 'rb').read()) imageType = "BASE64" """ 调用人脸检测 """ tt = client.detect(image, imageType)   出现以下错误: <aip.face.AipFace object at 0x02012F90> Traceback (most recent call last): File "F:\python\face1.py", line 34, in <module> tt = client.detect(image, imageType) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\aip\face.py", line 66, in detect return self._request(self.__detectUrl, json.dumps(data, ensure_ascii=False), { File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\json\__init__.py", line 238, in dumps **kw).encode(obj) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\json\encoder.py", line 199, in encode chunks = self.iterencode(o, _one_shot=True) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\json\encoder.py", line 257, in iterencode return _iterencode(o, 0) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\json\encoder.py", line 179, in default raise TypeError(f'Object of type {o.__class__.__name__} ' TypeError: Object of type bytes is not JSON serializable
16
切换版块
智能客服