(templateBase64, targetBase64, access_token)
return response.json()['result']['merge_image']
换脸术
    :param templateBase64: 模板图片
    :param targetBase64: 目标图片
    :param access_token: access_token
    :return: 换脸后的 base64
换脸术
    :param templateBase64: 模板图片
    :param targetBase64: 目标图片
    :param access_token: access_token
    :return: 换脸后的 base64
换脸术 : param templateBase64 : 模板图片 : param targetBase64 : 目标图片 : param access_token : access_token : return : 换脸后的 base64
def faceFusion(templateBase64, targetBase64, access_token):
    '''
    换脸术
    :param templateBase64: 模板图片
    :param targetBase64: 目标图片
    :param access_token: access_token
    :return: 换脸后的 base64
    '''
    request_url = "https://aip.baidubce.com/rest/2.0/face/v1/merge"

    params = "{\"image_template\":{\"image\":\"" + templateBase64 + "\",\"image_type\":\"BASE64\",\"quality_control\":\"NONE\"},\"image_target\":{\"image\":\"" + targetBase64 + "\",\"image_type\":\"BASE64\",\"quality_control\":\"NONE\"}}"

    request_url = request_url + "?access_token=" + access_token
    headers = {'content-type': 'application/json'}
    response = requests.post(request_url, data=params, headers=headers)
    if response:
        print (response.json())
    return response.json()['result']['merge_image']
def faceFusion ( templateBase64 , targetBase64 , access_token ) : request_url = "https://aip.baidubce.com/rest/2.0/face/v1/merge" params = "{\"image_template\":{\"image\":\"" + templateBase64 + "\",\"image_type\":\"BASE64\",\"quality_control\":\"NONE\"},\"image_target\":{\"image\":\"" + targetBase64 + "\",\"image_type\":\"BASE64\",\"quality_control\":\"NONE\"}}" request_url = request_url + "?access_token=" + access_token headers = { 'content-type' : 'application/json' } response = requests . post ( request_url , data = params , headers = headers ) if response : print ( response . json ( ) ) return response . json ( ) [ 'result' ] [ 'merge_image' ]