Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleOCR
提交
f8fb8a7b
P
PaddleOCR
项目概览
PaddlePaddle
/
PaddleOCR
1 年多 前同步成功
通知
1531
Star
32963
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看板
未验证
提交
f8fb8a7b
编写于
8月 29, 2022
作者:
D
Double_V
提交者:
GitHub
8月 29, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #7406 from LDOUBLEV/dygraph
fix cml
上级
64ae2a87
f630700a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
26 addition
and
37 deletion
+26
-37
configs/det/ch_PP-OCRv2/ch_PP-OCRv2_det_cml.yml
configs/det/ch_PP-OCRv2/ch_PP-OCRv2_det_cml.yml
+0
-1
configs/det/ch_PP-OCRv3/ch_PP-OCRv3_det_cml.yml
configs/det/ch_PP-OCRv3/ch_PP-OCRv3_det_cml.yml
+20
-30
ppocr/losses/basic_loss.py
ppocr/losses/basic_loss.py
+6
-6
未找到文件。
configs/det/ch_PP-OCRv2/ch_PP-OCRv2_det_cml.yml
浏览文件 @
f8fb8a7b
...
@@ -191,7 +191,6 @@ Eval:
...
@@ -191,7 +191,6 @@ Eval:
channel_first
:
False
channel_first
:
False
-
DetLabelEncode
:
# Class handling label
-
DetLabelEncode
:
# Class handling label
-
DetResizeForTest
:
-
DetResizeForTest
:
# image_shape: [736, 1280]
-
NormalizeImage
:
-
NormalizeImage
:
scale
:
1./255.
scale
:
1./255.
mean
:
[
0.485
,
0.456
,
0.406
]
mean
:
[
0.485
,
0.456
,
0.406
]
...
...
configs/det/ch_PP-OCRv3/ch_PP-OCRv3_det_cml.yml
浏览文件 @
f8fb8a7b
...
@@ -24,6 +24,7 @@ Architecture:
...
@@ -24,6 +24,7 @@ Architecture:
model_type
:
det
model_type
:
det
Models
:
Models
:
Student
:
Student
:
pretrained
:
model_type
:
det
model_type
:
det
algorithm
:
DB
algorithm
:
DB
Transform
:
null
Transform
:
null
...
@@ -40,6 +41,7 @@ Architecture:
...
@@ -40,6 +41,7 @@ Architecture:
name
:
DBHead
name
:
DBHead
k
:
50
k
:
50
Student2
:
Student2
:
pretrained
:
model_type
:
det
model_type
:
det
algorithm
:
DB
algorithm
:
DB
Transform
:
null
Transform
:
null
...
@@ -91,14 +93,11 @@ Loss:
...
@@ -91,14 +93,11 @@ Loss:
-
[
"
Student"
,
"
Student2"
]
-
[
"
Student"
,
"
Student2"
]
maps_name
:
"
thrink_maps"
maps_name
:
"
thrink_maps"
weight
:
1.0
weight
:
1.0
# act: None
model_name_pairs
:
[
"
Student"
,
"
Student2"
]
model_name_pairs
:
[
"
Student"
,
"
Student2"
]
key
:
maps
key
:
maps
-
DistillationDBLoss
:
-
DistillationDBLoss
:
weight
:
1.0
weight
:
1.0
model_name_list
:
[
"
Student"
,
"
Student2"
]
model_name_list
:
[
"
Student"
,
"
Student2"
]
# key: maps
# name: DBLoss
balance_loss
:
true
balance_loss
:
true
main_loss_type
:
DiceLoss
main_loss_type
:
DiceLoss
alpha
:
5
alpha
:
5
...
@@ -197,6 +196,7 @@ Train:
...
@@ -197,6 +196,7 @@ Train:
drop_last
:
false
drop_last
:
false
batch_size_per_card
:
8
batch_size_per_card
:
8
num_workers
:
4
num_workers
:
4
Eval
:
Eval
:
dataset
:
dataset
:
name
:
SimpleDataSet
name
:
SimpleDataSet
...
@@ -204,31 +204,21 @@ Eval:
...
@@ -204,31 +204,21 @@ Eval:
label_file_list
:
label_file_list
:
-
./train_data/icdar2015/text_localization/test_icdar2015_label.txt
-
./train_data/icdar2015/text_localization/test_icdar2015_label.txt
transforms
:
transforms
:
-
DecodeImage
:
-
DecodeImage
:
# load image
img_mode
:
BGR
img_mode
:
BGR
channel_first
:
false
channel_first
:
False
-
DetLabelEncode
:
null
-
DetLabelEncode
:
# Class handling label
-
DetResizeForTest
:
null
-
DetResizeForTest
:
-
NormalizeImage
:
-
NormalizeImage
:
scale
:
1./255.
scale
:
1./255.
mean
:
mean
:
[
0.485
,
0.456
,
0.406
]
-
0.485
std
:
[
0.229
,
0.224
,
0.225
]
-
0.456
order
:
'
hwc'
-
0.406
-
ToCHWImage
:
std
:
-
KeepKeys
:
-
0.229
keep_keys
:
[
'
image'
,
'
shape'
,
'
polys'
,
'
ignore_tags'
]
-
0.224
-
0.225
order
:
hwc
-
ToCHWImage
:
null
-
KeepKeys
:
keep_keys
:
-
image
-
shape
-
polys
-
ignore_tags
loader
:
loader
:
shuffle
:
f
alse
shuffle
:
F
alse
drop_last
:
f
alse
drop_last
:
F
alse
batch_size_per_card
:
1
batch_size_per_card
:
1
# must be 1
num_workers
:
2
num_workers
:
2
\ No newline at end of file
ppocr/losses/basic_loss.py
浏览文件 @
f8fb8a7b
...
@@ -60,19 +60,19 @@ class KLJSLoss(object):
...
@@ -60,19 +60,19 @@ class KLJSLoss(object):
],
"mode can only be one of ['kl', 'KL', 'js', 'JS']"
],
"mode can only be one of ['kl', 'KL', 'js', 'JS']"
self
.
mode
=
mode
self
.
mode
=
mode
def
__call__
(
self
,
p1
,
p2
,
reduction
=
"mean"
):
def
__call__
(
self
,
p1
,
p2
,
reduction
=
"mean"
,
eps
=
1e-5
):
if
self
.
mode
.
lower
()
==
'kl'
:
if
self
.
mode
.
lower
()
==
'kl'
:
loss
=
paddle
.
multiply
(
p2
,
loss
=
paddle
.
multiply
(
p2
,
paddle
.
log
((
p2
+
1e-5
)
/
(
p1
+
1e-5
)
+
1e-5
))
paddle
.
log
((
p2
+
eps
)
/
(
p1
+
eps
)
+
eps
))
loss
+=
paddle
.
multiply
(
loss
+=
paddle
.
multiply
(
p1
,
p1
,
paddle
.
log
((
p1
+
1e-5
)
/
(
p2
+
1e-5
)
+
1e-5
))
paddle
.
log
((
p1
+
eps
)
/
(
p2
+
eps
)
+
eps
))
loss
*=
0.5
loss
*=
0.5
elif
self
.
mode
.
lower
()
==
"js"
:
elif
self
.
mode
.
lower
()
==
"js"
:
loss
=
paddle
.
multiply
(
loss
=
paddle
.
multiply
(
p2
,
paddle
.
log
((
2
*
p2
+
1e-5
)
/
(
p1
+
p2
+
1e-5
)
+
1e-5
))
p2
,
paddle
.
log
((
2
*
p2
+
eps
)
/
(
p1
+
p2
+
eps
)
+
eps
))
loss
+=
paddle
.
multiply
(
loss
+=
paddle
.
multiply
(
p1
,
paddle
.
log
((
2
*
p1
+
1e-5
)
/
(
p1
+
p2
+
1e-5
)
+
1e-5
))
p1
,
paddle
.
log
((
2
*
p1
+
eps
)
/
(
p1
+
p2
+
eps
)
+
eps
))
loss
*=
0.5
loss
*=
0.5
else
:
else
:
raise
ValueError
(
raise
ValueError
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录