Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleOCR
提交
c0b4cefd
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看板
提交
c0b4cefd
编写于
12月 09, 2020
作者:
L
LDOUBLEV
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix comments and transform to transforms
上级
5f2f08a0
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
13 addition
and
8 deletion
+13
-8
configs/det/ch_ppocr_v1.1/ch_det_mv3_db.yml
configs/det/ch_ppocr_v1.1/ch_det_mv3_db.yml
+0
-0
configs/det/ch_ppocr_v1.1/ch_det_res18_db.yml
configs/det/ch_ppocr_v1.1/ch_det_res18_db.yml
+1
-1
ppocr/modeling/architectures/base_model.py
ppocr/modeling/architectures/base_model.py
+1
-1
ppocr/modeling/backbones/det_mobilenet_v3.py
ppocr/modeling/backbones/det_mobilenet_v3.py
+3
-2
ppocr/modeling/transforms/__init__.py
ppocr/modeling/transforms/__init__.py
+0
-0
ppocr/modeling/transforms/tps.py
ppocr/modeling/transforms/tps.py
+0
-0
ppocr/postprocess/db_postprocess.py
ppocr/postprocess/db_postprocess.py
+8
-4
未找到文件。
configs/det/ch_det_mv3_db.yml
→
configs/det/ch_
ppocr_v1.1/ch_
det_mv3_db.yml
浏览文件 @
c0b4cefd
文件已移动
configs/det/ch_det_res18_db.yml
→
configs/det/ch_
ppocr_v1.1/ch_
det_res18_db.yml
浏览文件 @
c0b4cefd
...
...
@@ -10,7 +10,7 @@ Global:
# if pretrained_model is saved in static mode, load_static_weights must set to True
load_static_weights
:
True
cal_metric_during_train
:
False
pretrained_model
:
./pretrain_models/
MobileNetV3_large_x0_5
_pretrained
pretrained_model
:
./pretrain_models/
ResNet18_vd
_pretrained
checkpoints
:
#./output/det_db_0.001_DiceLoss_256_pp_config_2.0b_4gpu/best_accuracy
save_inference_dir
:
use_visualdl
:
False
...
...
ppocr/modeling/architectures/base_model.py
浏览文件 @
c0b4cefd
...
...
@@ -16,7 +16,7 @@ from __future__ import division
from
__future__
import
print_function
from
paddle
import
nn
from
ppocr.modeling.transform
import
build_transform
from
ppocr.modeling.transform
s
import
build_transform
from
ppocr.modeling.backbones
import
build_backbone
from
ppocr.modeling.necks
import
build_neck
from
ppocr.modeling.heads
import
build_head
...
...
ppocr/modeling/backbones/det_mobilenet_v3.py
浏览文件 @
c0b4cefd
...
...
@@ -111,6 +111,7 @@ class MobileNetV3(nn.Layer):
i
=
0
inplanes
=
make_divisible
(
inplanes
*
scale
)
for
(
k
,
exp
,
c
,
se
,
nl
,
s
)
in
cfg
:
se
=
se
and
not
self
.
disable_se
if
s
==
2
and
i
>
2
:
self
.
out_channels
.
append
(
inplanes
)
self
.
stages
.
append
(
nn
.
Sequential
(
*
block_list
))
...
...
@@ -231,7 +232,7 @@ class ResidualUnit(nn.Layer):
if_act
=
True
,
act
=
act
,
name
=
name
+
"_depthwise"
)
if
self
.
if_se
and
not
self
.
disable_se
:
if
self
.
if_se
:
self
.
mid_se
=
SEModule
(
mid_channels
,
name
=
name
+
"_se"
)
self
.
linear_conv
=
ConvBNLayer
(
in_channels
=
mid_channels
,
...
...
@@ -246,7 +247,7 @@ class ResidualUnit(nn.Layer):
def
forward
(
self
,
inputs
):
x
=
self
.
expand_conv
(
inputs
)
x
=
self
.
bottleneck_conv
(
x
)
if
self
.
if_se
and
not
self
.
disable_se
:
if
self
.
if_se
:
x
=
self
.
mid_se
(
x
)
x
=
self
.
linear_conv
(
x
)
if
self
.
if_shortcut
:
...
...
ppocr/modeling/transform/__init__.py
→
ppocr/modeling/transform
s
/__init__.py
浏览文件 @
c0b4cefd
文件已移动
ppocr/modeling/transform/tps.py
→
ppocr/modeling/transform
s
/tps.py
浏览文件 @
c0b4cefd
文件已移动
ppocr/postprocess/db_postprocess.py
浏览文件 @
c0b4cefd
...
...
@@ -33,13 +33,14 @@ class DBPostProcess(object):
box_thresh
=
0.7
,
max_candidates
=
1000
,
unclip_ratio
=
2.0
,
use_dilation
=
False
,
**
kwargs
):
self
.
thresh
=
thresh
self
.
box_thresh
=
box_thresh
self
.
max_candidates
=
max_candidates
self
.
unclip_ratio
=
unclip_ratio
self
.
min_size
=
3
self
.
dilation_kernel
=
np
.
array
([[
1
,
1
],
[
1
,
1
]])
self
.
dilation_kernel
=
None
if
not
use_dilation
else
[[
1
,
1
],
[
1
,
1
]]
def
boxes_from_bitmap
(
self
,
pred
,
_bitmap
,
dest_width
,
dest_height
):
'''
...
...
@@ -140,9 +141,12 @@ class DBPostProcess(object):
boxes_batch
=
[]
for
batch_index
in
range
(
pred
.
shape
[
0
]):
height
,
width
=
shape_list
[
batch_index
]
mask
=
cv2
.
dilate
(
np
.
array
(
segmentation
[
batch_index
]).
astype
(
np
.
uint8
),
self
.
dilation_kernel
)
if
self
.
dilation_kernel
is
not
None
:
mask
=
cv2
.
dilate
(
np
.
array
(
segmentation
[
batch_index
]).
astype
(
np
.
uint8
),
self
.
dilation_kernel
)
else
:
mask
=
segmentation
[
batch_index
]
boxes
,
scores
=
self
.
boxes_from_bitmap
(
pred
[
batch_index
],
mask
,
width
,
height
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录