import requests #导入requests库
import base64 #导入base64库
# API_Key='wLXiL5dy2qrO6YErbUm9dF_kr4wP7EVc'
# API_Secret = 'iEFrwgEzU_cIyrvMOSOw_vGUjNttgLhs'
#借助https://console.faceplusplus.com.cn平台来实现换脸
API_Key = '7LUPX5XQcDUYIXTu-_YMAT-mvEgIRKVQ' #你自己申请的API Key
API_Secret = '9hDv4cbZhzclm91JOP8AEwc-tTI8pxLx' ##你自己申请的API Secret
# 定义一个获取图片的人脸特征参数的函数
def find_face(imgpath): #查找人脸参数(图片位置)
url = 'https://api-cn.faceplusplus.com/facepp/v3/detect' #使用的人脸识别网站
data = {
'api_key': API_Key, 'api_secret': API_Secret, 'image_url': imgpath, 'return_landmark': 1} #相关个人账号参数等
files = {
'image_file': open(imgpath, 'rb')} #打开图片
response =
Face++ AI换脸
最新推荐文章于 2023-12-14 16:50:41 发布