91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 6.17MB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2023-11-17
  • 語言: 其他
  • 標簽: 文本檢測??

資源簡介

基于darknet框架實現CTPN版本自然場景文字檢測與CNN+CTCOCR文字識別
本項目基于darknet框架實現CTPN版本自然場景文字檢測與CNN + CTCOCR文字識別
實現功能
CPU版本最短邊608時,檢測速度小于1秒;
支持darknet直接訓練CTPN(整理中);
支持darknet直接訓練CNN + CTC ocr(整理中);

資源截圖

代碼片段和文件信息

#?-*-?coding:?utf-8?-*-
“““
@author:?chineseocr
“““
import?web
web.config.debug??=?False
import?uuid
import?json
import?os
import?time
import?cv2
import?numpy?as?np
from?helper.image?import?read_url_imgbase64_to_PILget_now
from?dnn.text?import?detect_lines
from?config?import?scalemaxScaleTEXT_LINE_SCORE
render?=?web.template.render(‘templates‘?base=‘base‘)

billList?=[]
root?=?‘./test/‘
timeOutTime=5

def?job(uidurlimgStringiscutisclassbillModelip):
????now?=?get_now()
????if?url?is?not?None:
????????img=read_url_img(url)
????elif?imgString?is?not?None:
????????img=?base64_to_PIL(imgString)
????else:
????????img?=?None
????????
????if?img?is?not?None:
????????image?=?np.array(img)
????????image?=??cv2.cvtColor(image?cv2.COLOR_RGB2BGR)
????????boxesscores?=?detect_lines(imagescale=scalemaxScale=maxScale)
????????data?=[]
????????n?=?len(boxes)
????????for?i?in?range(n):
????????????box?=?boxes[i]
????????????box?=??[int(x)?for?x?in?box]
????????????if?scores[i]>TEXT_LINE_SCORE:
???????????????data.append({‘box‘:box‘prob‘:round(float(scores[i])2)‘text‘:None})
????????
????????res?=?{‘data‘:data‘errCode‘:0}
????else:
????????res?=?{‘data‘:[]‘errCode‘:3}
????return?res

????
class?TEXT:
????“““
????text?detect
????“““
????
????def?GET(self):??
????????post?=?{}
????????now?=?get_now()
????????ip?=?web.ctx.ip
????????post[‘name‘]?=?u‘‘
????????post[‘billList‘]??????=?billList
????????post[‘postName‘]??????=?‘text‘##請求地址
????????post[‘height‘]????????=?500
????????post[‘width‘]?????????=?800
????????post[‘textwidth‘]?????=?500
????????post[‘uuid‘]??????????=?uuid.uuid1().__str__()
????????post[‘url‘]???????????=?‘text‘
????????return?render.text(post)
????
????def?POST(self):?
????????post?=?{“errCode“:0“errMess“:““}
????????if?1:
????????????ip?=?web.ctx.ip
????????????data?=?web.data()
????????????data?=?json.loads(data)
????????????if?type(data)?is?dict:
????????????????uuid??????????=?data.get(‘uuid‘)
????????????????url???????????=?data.get(‘url‘)
????????????????imgString?????=?data.get(‘imgString‘)
????????????????billModel?????=?data.get(‘billModel‘““)
????????????????iscut?????????=?data.get(‘iscut‘False)##是否多票據識別
????????????????isclass???????=?data.get(‘isclass‘False)##是否自動進行票據分類
????????????????
????????????????if?‘uuid‘?is?not?None?and?(url?is?not?None?or?imgString?is?not?None):
????????????????????res?=?job(uuidurlimgStringiscutisclassbillModelip)
????????????????????post.update(res)
????????????????else:
????????????????????post[“errCode“]?=?1##參數缺失
????????????????????
????????????????
????????else:
?????????????post[“errCode“]=2
????????
????????return?json.dumps(postensure_ascii=False)
????


????
urls?=?(‘/text‘‘TEXT‘)

??
if?__name__?==?“__main__“:??
??
??????app?=?web.application(urls?globals())???
??????app.run()

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-09-29?14:22??darknet-ocr-master\
?????文件?????????137??2019-09-29?14:22??darknet-ocr-master\.gitignore
?????文件????????1620??2019-09-29?14:22??darknet-ocr-master\README.md
?????文件????????2863??2019-09-29?14:22??darknet-ocr-master\app.py
?????文件?????????390??2019-09-29?14:22??darknet-ocr-master\config.py
?????目錄???????????0??2019-09-29?14:22??darknet-ocr-master\dnn\
?????文件????????1217??2019-09-29?14:22??darknet-ocr-master\dnn\ocr.py
?????文件????????2065??2019-09-29?14:22??darknet-ocr-master\dnn\text.py
?????目錄???????????0??2019-09-29?14:22??darknet-ocr-master\helper\
?????文件?????????112??2019-09-29?14:22??darknet-ocr-master\helper\__init__.py
?????文件????????1479??2019-09-29?14:22??darknet-ocr-master\helper\detectors.py
?????文件????????6990??2019-09-29?14:22??darknet-ocr-master\helper\image.py
?????文件????????2550??2019-09-29?14:22??darknet-ocr-master\helper\text_proposal_connector.py
?????文件????????4013??2019-09-29?14:22??darknet-ocr-master\helper\text_proposal_graph_builder.py
?????目錄???????????0??2019-09-29?14:22??darknet-ocr-master\models\
?????文件????????1492??2019-09-29?14:22??darknet-ocr-master\models\text.cfg
?????文件?????????854??2019-09-29?14:22??darknet-ocr-master\ocr.cfg
?????文件??????????76??2019-09-29?14:22??darknet-ocr-master\requirements.txt
?????目錄???????????0??2019-09-29?14:22??darknet-ocr-master\static\
?????目錄???????????0??2019-09-29?14:22??darknet-ocr-master\static\css\
?????文件?????????694??2019-09-29?14:22??darknet-ocr-master\static\css\main.css
?????目錄???????????0??2019-09-29?14:22??darknet-ocr-master\static\img\
?????文件????????3897??2019-09-29?14:22??darknet-ocr-master\static\img\loading.gif
?????目錄???????????0??2019-09-29?14:22??darknet-ocr-master\static\js\
?????文件????????7512??2019-09-29?14:22??darknet-ocr-master\static\js\helps.js
?????文件???????86708??2019-09-29?14:22??darknet-ocr-master\static\js\jquery.js
?????目錄???????????0??2019-09-29?14:22??darknet-ocr-master\templates\
?????文件?????????226??2019-09-29?14:22??darknet-ocr-master\templates\base.html
?????文件????????2737??2019-09-29?14:22??darknet-ocr-master\templates\text.html
?????目錄???????????0??2019-09-29?14:22??darknet-ocr-master\test\
?????文件?????1193863??2019-09-29?14:22??darknet-ocr-master\test\bank.png
............此處省略8個文件信息

評論

共有 條評論