forked from chineseocr/chineseocr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
92779dd
commit 807f882
Showing
229 changed files
with
985 additions
and
24,523 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
|
||
|
||
## 环境部署 | ||
|
||
GPU部署 参考:setup.md | ||
GPU部署 参考:setup-cpu.md | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
基于该项目实现财务票据、表格文字的识别(将于近期公布) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,53 @@ | ||
import os | ||
opencvFlag = 'keras'##keras,opencv,darknet | ||
########################文字检测######################## | ||
##文字检测引擎 keras,opencv,darknet | ||
pwd = os.getcwd() | ||
opencvFlag = 'keras' | ||
IMGSIZE = (608,608)## yolo3 输入图像尺寸 | ||
## keras 版本anchors | ||
keras_anchors = '8,9, 8,18, 8,31, 8,59, 8,124, 8,351, 8,509, 8,605, 8,800' | ||
class_names = ['none','text',] | ||
GPU = True##OCR 是否启用GPU | ||
GPUID=0##调用GPU序号 | ||
kerasTextModel=os.path.join(pwd,"models","text.h5")##keras版本模型权重文件 | ||
|
||
############## darknet yolo ############## | ||
darknetRoot = os.path.join(os.path.curdir,"darknet")## yolo 安装目录 | ||
pwd = os.getcwd() | ||
yoloCfg = os.path.join(pwd,"models","text.cfg") | ||
yoloCfg = os.path.join(pwd,"models","text.cfg") | ||
yoloWeights = os.path.join(pwd,"models","text.weights") | ||
yoloData = os.path.join(pwd,"models","text.data") | ||
yoloData = os.path.join(pwd,"models","text.data") | ||
############## darknet yolo ############## | ||
|
||
########################文字检测######################## | ||
|
||
## GPU选择及启动GPU序号 | ||
GPU = True##OCR 是否启用GPU | ||
GPUID=0##调用GPU序号 | ||
|
||
kerasTextModel=os.path.join(pwd,"models","text.h5")##keras版本模型 | ||
##文字方向检测 | ||
## nms选择,支持cython,gpu,python | ||
nmsFlag='gpu'## cython/gpu/python | ||
|
||
|
||
|
||
##vgg文字方向检测模型 | ||
DETECTANGLE=True##是否进行文字方向检测 | ||
AngleModelPb = os.path.join(pwd,"models","Angle-model.pb") | ||
AngleModelPbtxt = os.path.join(pwd,"models","Angle-model.pbtxt") | ||
IMGSIZE = (608,608)## yolo3 输入图像尺寸 | ||
|
||
|
||
######################OCR模型###################### | ||
##是否启用LSTM crnn模型 | ||
DETECTANGLE=True##是否进行文字方向检测 | ||
LSTMFLAG = True##OCR模型是否调用LSTM层 | ||
chinsesModel = True##模型选择 True:中英文模型 False:英文模型 | ||
##OCR模型是否调用LSTM层 | ||
LSTMFLAG = True | ||
##模型选择 True:中英文模型 False:英文模型 | ||
|
||
chinsesModel = True | ||
|
||
if chinsesModel: | ||
if LSTMFLAG: | ||
ocrModel = os.path.join(pwd,"models","ocr-lstm.pth") | ||
else: | ||
ocrModel = os.path.join(pwd,"models","ocr-dense.pth") | ||
else: | ||
##纯英文模型 | ||
LSTMFLAG=True | ||
ocrModel = os.path.join(pwd,"models","ocr-english.pth") | ||
######################OCR模型###################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1 @@ | ||
from . import cython_nms | ||
try: | ||
from . import gpu_nms | ||
except: | ||
gpu_nms = cython_nms | ||
|
||
|
Oops, something went wrong.