Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleOCR
提交
fd76c123
P
PaddleOCR
项目概览
PaddlePaddle
/
PaddleOCR
大约 1 年 前同步成功
通知
1528
Star
32962
Fork
6643
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
108
列表
看板
标记
里程碑
合并请求
7
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleOCR
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
108
Issue
108
列表
看板
标记
里程碑
合并请求
7
合并请求
7
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
fd76c123
编写于
9月 16, 2020
作者:
L
lichenxia
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
disable se & add cls params for hub serving
上级
5b5b72e6
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
21 addition
and
4 deletion
+21
-4
configs/det/det_mv3_db.yml
configs/det/det_mv3_db.yml
+3
-2
deploy/hubserving/ocr_system/params.py
deploy/hubserving/ocr_system/params.py
+8
-1
ppocr/modeling/backbones/det_mobilenet_v3.py
ppocr/modeling/backbones/det_mobilenet_v3.py
+3
-1
ppocr/modeling/heads/det_db_head.py
ppocr/modeling/heads/det_db_head.py
+7
-0
未找到文件。
configs/det/det_mv3_db.yml
浏览文件 @
fd76c123
...
@@ -24,6 +24,7 @@ Backbone:
...
@@ -24,6 +24,7 @@ Backbone:
function
:
ppocr.modeling.backbones.det_mobilenet_v3,MobileNetV3
function
:
ppocr.modeling.backbones.det_mobilenet_v3,MobileNetV3
scale
:
0.5
scale
:
0.5
model_name
:
large
model_name
:
large
disable_se
:
true
Head
:
Head
:
function
:
ppocr.modeling.heads.det_db_head,DBHead
function
:
ppocr.modeling.heads.det_db_head,DBHead
...
@@ -49,6 +50,6 @@ Optimizer:
...
@@ -49,6 +50,6 @@ Optimizer:
PostProcess
:
PostProcess
:
function
:
ppocr.postprocess.db_postprocess,DBPostProcess
function
:
ppocr.postprocess.db_postprocess,DBPostProcess
thresh
:
0.3
thresh
:
0.3
box_thresh
:
0.
7
box_thresh
:
0.
6
max_candidates
:
1000
max_candidates
:
1000
unclip_ratio
:
2.0
unclip_ratio
:
1.5
deploy/hubserving/ocr_system/params.py
浏览文件 @
fd76c123
...
@@ -10,7 +10,7 @@ class Config(object):
...
@@ -10,7 +10,7 @@ class Config(object):
def
read_params
():
def
read_params
():
cfg
=
Config
()
cfg
=
Config
()
#params for text detector
#params for text detector
cfg
.
det_algorithm
=
"DB"
cfg
.
det_algorithm
=
"DB"
cfg
.
det_model_dir
=
"./inference/ch_det_mv3_db/"
cfg
.
det_model_dir
=
"./inference/ch_det_mv3_db/"
...
@@ -38,6 +38,13 @@ def read_params():
...
@@ -38,6 +38,13 @@ def read_params():
cfg
.
rec_char_dict_path
=
"./ppocr/utils/ppocr_keys_v1.txt"
cfg
.
rec_char_dict_path
=
"./ppocr/utils/ppocr_keys_v1.txt"
cfg
.
use_space_char
=
True
cfg
.
use_space_char
=
True
#params for text classifier
cfg
.
use_angle_cls
=
False
cfg
.
cls_model_dir
=
"./inference/ch_ppocr_mobile_v1.1_cls_infer/"
cfg
.
cls_image_shape
=
"3, 48, 192"
cfg
.
label_list
=
[
'0'
,
'180'
]
cfg
.
cls_batch_num
=
30
cfg
.
use_zero_copy_run
=
False
cfg
.
use_zero_copy_run
=
False
return
cfg
return
cfg
ppocr/modeling/backbones/det_mobilenet_v3.py
浏览文件 @
fd76c123
...
@@ -79,6 +79,8 @@ class MobileNetV3():
...
@@ -79,6 +79,8 @@ class MobileNetV3():
assert
self
.
scale
in
supported_scale
,
\
assert
self
.
scale
in
supported_scale
,
\
"supported scale are {} but input scale is {}"
.
format
(
supported_scale
,
self
.
scale
)
"supported scale are {} but input scale is {}"
.
format
(
supported_scale
,
self
.
scale
)
self
.
disable_se
=
params
.
get
(
'disable_se'
,
False
)
def
__call__
(
self
,
input
):
def
__call__
(
self
,
input
):
scale
=
self
.
scale
scale
=
self
.
scale
inplanes
=
self
.
inplanes
inplanes
=
self
.
inplanes
...
@@ -232,7 +234,7 @@ class MobileNetV3():
...
@@ -232,7 +234,7 @@ class MobileNetV3():
num_groups
=
num_mid_filter
,
num_groups
=
num_mid_filter
,
use_cudnn
=
False
,
use_cudnn
=
False
,
name
=
name
+
'_depthwise'
)
name
=
name
+
'_depthwise'
)
if
use_se
:
if
use_se
and
not
self
.
disable_se
:
conv1
=
self
.
se_block
(
conv1
=
self
.
se_block
(
input
=
conv1
,
num_out_filter
=
num_mid_filter
,
name
=
name
+
'_se'
)
input
=
conv1
,
num_out_filter
=
num_mid_filter
,
name
=
name
+
'_se'
)
...
...
ppocr/modeling/heads/det_db_head.py
浏览文件 @
fd76c123
...
@@ -123,6 +123,13 @@ class DBHead(object):
...
@@ -123,6 +123,13 @@ class DBHead(object):
return
fluid
.
layers
.
reciprocal
(
1
+
fluid
.
layers
.
exp
(
-
self
.
k
*
(
x
-
y
)))
return
fluid
.
layers
.
reciprocal
(
1
+
fluid
.
layers
.
exp
(
-
self
.
k
*
(
x
-
y
)))
def
__call__
(
self
,
conv_features
,
mode
=
"train"
):
def
__call__
(
self
,
conv_features
,
mode
=
"train"
):
"""
Fuse different levels of feature map from backbone in the FPN manner.
Args:
conv_features(list): feature maps from backbone
mode(str): runtime mode, can be "train", "eval" or "test"
Return: predicts
"""
c2
,
c3
,
c4
,
c5
=
conv_features
c2
,
c3
,
c4
,
c5
=
conv_features
param_attr
=
fluid
.
initializer
.
MSRAInitializer
(
uniform
=
False
)
param_attr
=
fluid
.
initializer
.
MSRAInitializer
(
uniform
=
False
)
in5
=
fluid
.
layers
.
conv2d
(
in5
=
fluid
.
layers
.
conv2d
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录