<strike id="ca4is"><em id="ca4is"></em></strike>
  • <sup id="ca4is"></sup>
    • <s id="ca4is"><em id="ca4is"></em></s>
      <option id="ca4is"><cite id="ca4is"></cite></option>
    • 二維碼
      企資網

      掃一掃關注

      當前位置: 首頁 » 企資快訊 » 匯總 » 正文

      Python借助于AI來實現驗證碼識別_內含p

      放大字體  縮小字體 發布日期:2022-02-01 11:55:14    作者:微生江純    瀏覽次數:8
      導讀

      借助于AI工具來實現驗證碼識別,內含python3示例驗證碼識別得場景十分常見感謝主要討論作為普通開發者(缺乏/沒有Ai學術(教育/實踐)背景)得前提下,來低成本快速實現驗證碼識別① 2000多本Python電子書(主流和

      借助于AI工具來實現驗證碼識別,內含python3示例

      驗證碼識別得場景十分常見
      感謝主要討論作為普通開發者(缺乏/沒有Ai學術(教育/實踐)背景)得前提下,來低成本快速實現驗證碼識別

      ① 2000多本Python電子書(主流和經典得書籍應該都有了)

      ② Python標準庫資料(蕞全中文版)

      ③ 項目源碼(四五十個有趣且經典得練手項目及源碼)

      ④ Python基礎入門、爬蟲、web開發、大數據分析方面得視頻(適合小白學習)

      ⑤ Python學習路線圖(告別不入流得學習)

      私信小編01即可獲取大量Python學習資源


      本次測試得驗證碼主要有兩種
      1. 無干擾得純數字驗證碼


      2. 有干擾得數字加字母驗證碼




      1. 百度AI大腦

      ai.baidu/tech/ocr/general


      下邊我用python3來示例在

      console.bce.baidu/ai/?fromai=1#/ai/ocr/app/list

      這里新建應用


      記錄appid, apikey, secret key


      復制代碼 隱藏代碼import requests import base64import shortuuidfrom pprint import pprint#填上自己得app 信息appid = ""key = ""secret = ""def Token(): host = 'aip.baidubce/oauth/2.0/token?grant_type=client_credentials&client_id={}&client_secret={}'.format(key, secret) response = requests.get(host) # if response: # pprint(response.json()) return response.json()['access_token']token = Token()request_url = "aip.baidubce/rest/2.0/ocr/v1/general_basic"f = open('./code/code.png', 'rb')img = base64.b64encode(f.read())params = {"image":img,"language_type":"CHN_ENG"}# access_token = '[調用鑒權接口獲取得token]'request_url = request_url + "?access_token=" + tokenheaders = {'content-type': 'application/x-www-form-urlencoded'}response = requests.post(request_url, data=params, headers=headers)pprint (response.json())





      2 騰訊AI

      ai.qq/product/ocr.shtml#common


      騰訊ocr示例在這里新建應用

      ai.qq/console/application/create-app


      記錄以上app信息 APP_,APP_Key

      復制代碼 隱藏代碼import base64, hashlib, json, random, string, timefrom urllib import parseimport requestsfrom pprint import pprint# 填寫app信息app_id = ""app_key = ""def GetAccessToken(formdata, app_key): dic = sorted(formdata.items(), key=lambda d: d[0]) sign = parse.urlencode(dic) + '&app_key=' + app_key m = hashlib.md5() m.update(sign.encode('utf8')) return m.hexdigest().upper()def RecogniseGeneral(app_id, time_stamp, nonce_str, image, app_key): host = 'api.ai.qq/fcgi-bin/ocr/ocr_generalocr' formdata = {'app_id': app_id, 'time_stamp': time_stamp, 'nonce_str': nonce_str, 'image': image} app_key = app_key sign = GetAccessToken(formdata=formdata, app_key=app_key) formdata['sign'] = sign try: r = requests.post(url=host, data=formdata, timeout=20) except requests.exceptions.ReadTimeout: r = requests.post(url=host, data=formdata, timeout=20) if (r.status_code == 200): return r.json() else: print(r.text)def Recognise(img_path): with open(file=img_path, mode='rb') as file: base64_data = base64.b64encode(file.read()) nonce = ''.join(random.sample(string.digits + string.ascii_letters, 32)) stamp = int(time.time()) recognise = RecogniseGeneral(app_id=app_id, time_stamp=stamp, nonce_str=nonce, image=base64_data, app_key=app_key) # for k, v in recognise.items(): # print(k, v) return recogniseimg_path = "./code/code.png"response = Recognise(img_path)pprint(response)code = response['data']['item_list'][0]['itemstring'].replace(" ", "")print(code)

       
      (文/微生江純)
      免責聲明
      本文僅代表作發布者:微生江純個人觀點,本站未對其內容進行核實,請讀者僅做參考,如若文中涉及有違公德、觸犯法律的內容,一經發現,立即刪除,需自行承擔相應責任。涉及到版權或其他問題,請及時聯系我們刪除處理郵件:weilaitui@qq.com。
       

      Copyright ? 2016 - 2025 - 企資網 48903.COM All Rights Reserved 粵公網安備 44030702000589號

      粵ICP備16078936號

      微信

      關注
      微信

      微信二維碼

      WAP二維碼

      客服

      聯系
      客服

      聯系客服:

      在線QQ: 303377504

      客服電話: 020-82301567

      E_mail郵箱: weilaitui@qq.com

      微信公眾號: weishitui

      客服001 客服002 客服003

      工作時間:

      周一至周五: 09:00 - 18:00

      反饋

      用戶
      反饋

      午夜久久久久久网站,99久久www免费,欧美日本日韩aⅴ在线视频,东京干手机福利视频
        <strike id="ca4is"><em id="ca4is"></em></strike>
      • <sup id="ca4is"></sup>
        • <s id="ca4is"><em id="ca4is"></em></s>
          <option id="ca4is"><cite id="ca4is"></cite></option>
        • 主站蜘蛛池模板: 亚洲av永久无码| 免费无码专区毛片高潮喷水| 中文字幕丰满伦子无码| 神宫寺奈绪jul055在线播放| 天天摸天天做天天爽天天弄| 亚洲第一页综合图片自拍| 亚洲宅男精品一区在线观看| 草莓在线观看视频| 日韩久久无码免费毛片软件| 可播放的欧美男男videos| chinese帅哥18kt| 欧美在线性爱视频| 国产区精品一区二区不卡中文| 一级黄色片免费| 欧美黑人巨大videos精品| 国产成人高清亚洲一区久久| 中文字幕成人在线| 狠狠色噜噜狠狠狠狠色吗综合| 我的好妈妈6中字在线观看韩国| 免费一级欧美大片在线观看| 668溜溜吧成人影院| 日本高清va在线播放| 免费毛片a线观看| 羞羞视频在线观看入口| 日产乱码卡1卡2卡三免费| 伊人情人综合网| 日本zzzzwww大片免费| 成人做受视频试看60秒| 亚洲成a人片在线观看久| 请与我同眠未删减未遮挡小说| 女人18毛片一级毛片在线| 亚洲aⅴ男人的天堂在线观看| 美女羞羞免费视频网站| 国产青草亚洲香蕉精品久久| 亚洲熟妇av一区二区三区宅男 | 久久网免费视频| 精品国产系列在线观看| 国产精品igao视频网| 丁香狠狠色婷婷久久综合| 欧美国产日本高清不卡| 听了下面湿透的娇喘音频|