获取token
# encoding:utf-8
import requests
# client_id 为官网获取的AK, client_secret 为官网获取的SK
host = 'https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id=填入你的AK&client_secret=填入你的SK'
response = requests.get(host)
if response:
print(response.json())
进行人脸对比(即识别)
# encoding:utf-8
import requests
'''
将图片经过base64编码
'''
import base64
def img_to_base