forked from chineseocr/chineseocr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
31 lines (28 loc) · 1.16 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import os
opencvFlag = 'keras'##keras,opencv,darknet
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序号
darknetRoot = os.path.join(os.path.curdir,"darknet")## yolo 安装目录
pwd = os.getcwd()
yoloCfg = os.path.join(pwd,"models","text.cfg")
yoloWeights = os.path.join(pwd,"models","text.weights")
yoloData = os.path.join(pwd,"models","text.data")
kerasTextModel=os.path.join(pwd,"models","text.h5")##keras版本模型
##文字方向检测
AngleModelPb = os.path.join(pwd,"models","Angle-model.pb")
AngleModelPbtxt = os.path.join(pwd,"models","Angle-model.pbtxt")
IMGSIZE = (608,608)## yolo3 输入图像尺寸
##是否启用LSTM crnn模型
DETECTANGLE=True##是否进行文字方向检测
LSTMFLAG = True##OCR模型是否调用LSTM层
chinsesModel = True##模型选择 True:中英文模型 False:英文模型
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")