py之调用百度api实现人脸检测是和识别

import requests
import base64
import json
import os



import ssl
print(ssl.OPENSSL_VERSION)
print(ssl._ssl.__file__)


class CbaiduUnit(object):
    def __init__(self):
        # self.AK = "	bf7BKUMl28G66PZ2HIGIfrTq"
        # self.SK = "tDjlbO6B95rYGduvZ7XCclFbwnHCwIP5"
        self.AK = "xigqalHdIwnu2CPNwTjBEXBZ"
        self.SK = "YCvQ57YfqEAWWwicViHsSl4cRpBWrg1x"

    def get_access_token(self):
        host =  'https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id={}&client_secret={}'.format(self.AK,self.SK)
        response = requests.get(host)

        if response:
            print("-------------")
            print(response.json()["access_token"

你可能感兴趣的:(python实战,javascript,c语言)