如果從網路下載到本地,再識別,再洗掉不合格的,浪費了下載資源和洗掉的時間。
能先按圖片鏈接去識別,合格了再下載嗎?
圖片識別,目前只能分別男女,年齡,美麗的打分相當不靠譜 ,
有更好的辦法嗎?
目前我的方法如下:
from aip import AipFace
APP_ID = "xxx"
API_KEY = "xxx"
SECRET_KEY = "xxx"
imageType = "BASE64"
options = {}
options["face_field"] = "gender,beauty"
options["face_type"] = "LIVE"
aipFace = AipFace(APP_ID, API_KEY, SECRET_KEY)
result = aipFace.detect(get_file_content(os.path.join(file_path, file_list)), imageType, options)
error_code = result['error_code']
if error_code == 222202:
# 沒有人臉
continue
if error_code == 223110:
# 人臉太多
continue
if error_code == 223114:
# 人臉模糊
continue
try:
sex_type = result['result']['face_list'][-1]['gender']['type']
# 只要美女圖片
if sex_type == 'male':
continue
beauty = result['result']['face_list'][-1]['beauty']
new_beauty = round(beauty / 10, 1)
if new_beauty >=0。6
這個是下載下來再判斷的,直接用鏈接的就不知道怎么弄了,
求指教!
uj5u.com熱心網友回復:
看樣子不好搞!轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/18217.html
上一篇:匯編語言
下一篇:Python 爬蟲 小白求助
