Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleOCR
提交
c67d04ad
P
PaddleOCR
项目概览
s920243400
/
PaddleOCR
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleOCR
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleOCR
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c67d04ad
编写于
9月 23, 2020
作者:
W
wangjiawei04
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
adapt to mobile model
上级
e11b8aff
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
11 addition
and
11 deletion
+11
-11
deploy/pdserving/det_local_server.py
deploy/pdserving/det_local_server.py
+1
-1
deploy/pdserving/det_rpc_server.py
deploy/pdserving/det_rpc_server.py
+1
-1
deploy/pdserving/params.py
deploy/pdserving/params.py
+3
-3
deploy/pdserving/rec_local_server.py
deploy/pdserving/rec_local_server.py
+3
-3
deploy/pdserving/rec_rpc_server.py
deploy/pdserving/rec_rpc_server.py
+3
-3
未找到文件。
deploy/pdserving/det_local_server.py
浏览文件 @
c67d04ad
...
...
@@ -41,7 +41,7 @@ class TextDetectorHelper(TextDetector):
elif
self
.
det_algorithm
==
"EAST"
:
self
.
fetch
=
[
"sigmoid_0.tmp_0"
,
"tmp_2"
]
elif
self
.
det_algorithm
==
"DB"
:
self
.
fetch
=
[
"s
igmoid
_0.tmp_0"
]
self
.
fetch
=
[
"s
ave_infer_model/scale
_0.tmp_0"
]
def
preprocess
(
self
,
img
):
img
=
img
.
copy
()
...
...
deploy/pdserving/det_rpc_server.py
浏览文件 @
c67d04ad
...
...
@@ -41,7 +41,7 @@ class TextDetectorHelper(TextDetector):
elif
self
.
det_algorithm
==
"EAST"
:
self
.
fetch
=
[
"sigmoid_0.tmp_0"
,
"tmp_2"
]
elif
self
.
det_algorithm
==
"DB"
:
self
.
fetch
=
[
"s
igmoid
_0.tmp_0"
]
self
.
fetch
=
[
"s
ave_infer_model/scale
_0.tmp_0"
]
def
preprocess
(
self
,
img
):
im
,
ratio_list
=
self
.
preprocess_op
(
img
)
...
...
deploy/pdserving/params.py
浏览文件 @
c67d04ad
...
...
@@ -14,7 +14,7 @@ def read_params():
#params for text detector
cfg
.
det_algorithm
=
"DB"
cfg
.
det_model_dir
=
"./det_
mv
_server/"
cfg
.
det_model_dir
=
"./det_
infer
_server/"
cfg
.
det_max_side_len
=
960
#DB parmas
...
...
@@ -29,7 +29,7 @@ def read_params():
#params for text recognizer
cfg
.
rec_algorithm
=
"CRNN"
cfg
.
rec_model_dir
=
"./
ocr_rec
_server/"
cfg
.
rec_model_dir
=
"./
rec_infer
_server/"
cfg
.
rec_image_shape
=
"3, 32, 320"
cfg
.
rec_char_type
=
'ch'
...
...
@@ -41,7 +41,7 @@ def read_params():
#params for text classifier
cfg
.
use_angle_cls
=
True
cfg
.
cls_model_dir
=
"./
ocr_clas
_server/"
cfg
.
cls_model_dir
=
"./
cls_infer
_server/"
cfg
.
cls_image_shape
=
"3, 48, 192"
cfg
.
label_list
=
[
'0'
,
'180'
]
cfg
.
cls_batch_num
=
30
...
...
deploy/pdserving/rec_local_server.py
浏览文件 @
c67d04ad
...
...
@@ -36,7 +36,7 @@ class TextRecognizerHelper(TextRecognizer):
def
__init__
(
self
,
args
):
super
(
TextRecognizerHelper
,
self
).
__init__
(
args
)
if
self
.
loss_type
==
"ctc"
:
self
.
fetch
=
[
"
ctc_greedy_decoder_0.tmp_0"
,
"softmax_0
.tmp_0"
]
self
.
fetch
=
[
"
save_infer_model/scale_0.tmp_0"
,
"save_infer_model/scale_1
.tmp_0"
]
def
preprocess
(
self
,
img_list
):
img_num
=
len
(
img_list
)
...
...
@@ -83,8 +83,8 @@ class TextRecognizerHelper(TextRecognizer):
if
self
.
loss_type
==
"ctc"
:
rec_idx_batch
=
outputs
[
0
]
predict_batch
=
outputs
[
1
]
rec_idx_lod
=
args
[
"
ctc_greedy_decoder
_0.tmp_0.lod"
]
predict_lod
=
args
[
"s
oftmax_0
.tmp_0.lod"
]
rec_idx_lod
=
args
[
"
save_infer_model/scale
_0.tmp_0.lod"
]
predict_lod
=
args
[
"s
ave_infer_model/scale_1
.tmp_0.lod"
]
indices
=
args
[
"indices"
]
rec_res
=
[[
''
,
0.0
]]
*
(
len
(
rec_idx_lod
)
-
1
)
for
rno
in
range
(
len
(
rec_idx_lod
)
-
1
):
...
...
deploy/pdserving/rec_rpc_server.py
浏览文件 @
c67d04ad
...
...
@@ -35,7 +35,7 @@ class TextRecognizerHelper(TextRecognizer):
def
__init__
(
self
,
args
):
super
(
TextRecognizerHelper
,
self
).
__init__
(
args
)
if
self
.
loss_type
==
"ctc"
:
self
.
fetch
=
[
"
ctc_greedy_decoder_0.tmp_0"
,
"softmax_0
.tmp_0"
]
self
.
fetch
=
[
"
save_infer_model/scale_0.tmp_0"
,
"save_infer_model/scale_1
.tmp_0"
]
def
preprocess
(
self
,
img_list
):
img_num
=
len
(
img_list
)
...
...
@@ -88,8 +88,8 @@ class TextRecognizerHelper(TextRecognizer):
if
self
.
loss_type
==
"ctc"
:
rec_idx_batch
=
outputs
[
0
]
predict_batch
=
outputs
[
1
]
rec_idx_lod
=
args
[
"
ctc_greedy_decoder
_0.tmp_0.lod"
]
predict_lod
=
args
[
"s
oftmax_0
.tmp_0.lod"
]
rec_idx_lod
=
args
[
"
save_infer_model/scale
_0.tmp_0.lod"
]
predict_lod
=
args
[
"s
ave_infer_model/scale_1
.tmp_0.lod"
]
indices
=
args
[
"indices"
]
rec_res
=
[[
''
,
0.0
]]
*
(
len
(
rec_idx_lod
)
-
1
)
for
rno
in
range
(
len
(
rec_idx_lod
)
-
1
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录