提交 daabebc9 编写于 作者: W wenlihaoyu

Merge branch 'app' of https://github.com/chineseocr/chineseocr into app

......@@ -56,13 +56,13 @@ keras 转darknet
python tools/keras_to_darknet.py -cfg_path models/text.cfg -weights_path models/text.h5 -output_path models/text.weights
```
## 编译语言模型
## 编译语言模型(可选)
``` Bash
git clone --recursive https://github.com/parlance/ctcdecode.git
cd ctcdecode
pip install .
```
## 下载语言模型
## 下载语言模型 (可选)
``` Bash
wget https://deepspeech.bj.bcebos.com/zh_lm/zh_giga.no_cna_cmn.prune01244.klm
mv zh_giga.no_cna_cmn.prune01244.klm chineseocr/models/
......
......@@ -11,6 +11,10 @@ import uuid
from PIL import Image
web.config.debug = True
filelock='file.lock'
if os.path.exists(filelock):
os.remove(filelock)
render = web.template.render('templates', base='base')
from config import *
from apphelper.image import union_rbox,adjust_box_to_origin,base64_to_PIL
......@@ -121,7 +125,7 @@ class OCR:
t = time.time()
data = web.data()
uidJob = uuid.uuid1().__str__()
filelock='file.lock'
data = json.loads(data)
billModel = data.get('billModel','')
textAngle = data.get('textAngle',False)##文字检测
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册