第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Face Plus Plus Python API 更改參數(shù)

Face Plus Plus Python API 更改參數(shù)

繁華開滿天機 2021-06-11 14:13:42
# -*- coding: utf-8 -*-import urllib2import urllibimport timehttp_url = 'https://api-us.faceplusplus.com/facepp/v3/detect'key = ""secret = ""filepath = r"iop.jpg"boundary = '----------%s' % hex(int(time.time() * 1000))data = []data.append('--%s' % boundary)data.append('Content-Disposition: form-data; name="%s"\r\n' % 'api_key')data.append(key)data.append('--%s' % boundary)data.append('Content-Disposition: form-data; name="%s"\r\n' % 'api_secret')data.append(secret)data.append('--%s' % boundary)fr=open(filepath,'rb')data.append('Content-Disposition: form-data; name="%s"; filename="co33.jpg"' % 'image_file')data.append('Content-Type: %s\r\n' % 'application/octet-stream')data.append(fr.read())fr.close()data.append('--%s--\r\n' % boundary)http_body='\r\n'.join(data)#buld http requestreq=urllib2.Request(http_url)#headerreq.add_header('Content-Type', 'multipart/form-data; boundary=%s' % boundary)req.add_data(http_body)try:    #post data to server    resp = urllib2.urlopen(req, timeout=5)    #get response    qrcont=resp.read()    print qrcontexcept urllib2.HTTPError as e:    print e.read()我正在嘗試更改人臉識別 API 的參數(shù),但我無法這樣做。我想改變代碼def detect_image(img_path):    endpoint = 'https://api-us.faceplusplus.com'    img_file = base64.encodestring(open(img_path, 'rb').read())    try:        response = requests.post(            endpoint + '/facepp/v3/detect',            {                'api_key': API_KEY,                'api_secret': API_SECRET,                # 'image_url': img_url,                'image_base64': img_file,                'return_landmark': 1,                'return_attributes': 'headpose,eyestatus,facequality,mouthstatus,eyegaze'            }        )        # 5秒スリープ        time.sleep(5) 因為我想添加更多參數(shù),以便我獲得的信息豐富。我該怎么做呢?現(xiàn)在我只得到人臉和 face_token 的坐標。
查看完整描述

2 回答

  • 2 回答
  • 0 關注
  • 120 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號