Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleOCR
提交
c5b040b3
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看板
提交
c5b040b3
编写于
7月 26, 2022
作者:
qq_25193841
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/dygraph' into dygraph
上级
69df224c
76012cc4
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
39 addition
and
4 deletion
+39
-4
PPOCRLabel/libs/canvas.py
PPOCRLabel/libs/canvas.py
+7
-0
PPOCRLabel/libs/shape.py
PPOCRLabel/libs/shape.py
+3
-2
configs/rec/rec_r45_abinet.yml
configs/rec/rec_r45_abinet.yml
+1
-1
configs/rec/rec_vitstr_none_ce.yml
configs/rec/rec_vitstr_none_ce.yml
+1
-1
ppstructure/table/predict_table.py
ppstructure/table/predict_table.py
+14
-0
test_tipc/benchmark_train.sh
test_tipc/benchmark_train.sh
+13
-0
未找到文件。
PPOCRLabel/libs/canvas.py
浏览文件 @
c5b040b3
...
...
@@ -624,6 +624,13 @@ class Canvas(QWidget):
pal
.
setColor
(
self
.
backgroundRole
(),
QColor
(
232
,
232
,
232
,
255
))
self
.
setPalette
(
pal
)
# adaptive BBOX label & index font size
if
self
.
pixmap
:
h
,
w
=
self
.
pixmap
.
size
().
height
(),
self
.
pixmap
.
size
().
width
()
fontszie
=
int
(
max
(
h
,
w
)
/
48
)
for
s
in
self
.
shapes
:
s
.
fontsize
=
fontszie
p
.
end
()
def
fillDrawing
(
self
):
...
...
PPOCRLabel/libs/shape.py
浏览文件 @
c5b040b3
...
...
@@ -66,6 +66,7 @@ class Shape(object):
self
.
NEAR_VERTEX
:
(
4
,
self
.
P_ROUND
),
self
.
MOVE_VERTEX
:
(
1.5
,
self
.
P_SQUARE
),
}
self
.
fontsize
=
8
self
.
_closed
=
False
...
...
@@ -156,7 +157,7 @@ class Shape(object):
min_y
=
min
(
min_y
,
point
.
y
())
if
min_x
!=
sys
.
maxsize
and
min_y
!=
sys
.
maxsize
:
font
=
QFont
()
font
.
setPointSize
(
8
)
font
.
setPointSize
(
self
.
fontsize
)
font
.
setBold
(
True
)
painter
.
setFont
(
font
)
if
self
.
label
is
None
:
...
...
@@ -174,7 +175,7 @@ class Shape(object):
min_y
=
min
(
min_y
,
point
.
y
())
if
min_x
!=
sys
.
maxsize
and
min_y
!=
sys
.
maxsize
:
font
=
QFont
()
font
.
setPointSize
(
8
)
font
.
setPointSize
(
self
.
fontsize
)
font
.
setBold
(
True
)
painter
.
setFont
(
font
)
text
=
''
...
...
configs/rec/rec_r45_abinet.yml
浏览文件 @
c5b040b3
...
...
@@ -8,7 +8,7 @@ Global:
# evaluation is run every 2000 iterations
eval_batch_step
:
[
0
,
2000
]
cal_metric_during_train
:
True
pretrained_model
:
pretrained_model
:
./pretrain_models/abinet_vl_pretrained
checkpoints
:
save_inference_dir
:
use_visualdl
:
False
...
...
configs/rec/rec_vitstr_none_ce.yml
浏览文件 @
c5b040b3
...
...
@@ -81,7 +81,7 @@ Train:
Eval
:
dataset
:
name
:
LMDBDataSet
data_dir
:
./train_data/data_lmdb_release/evalua
it
on/
data_dir
:
./train_data/data_lmdb_release/evalua
ti
on/
transforms
:
-
DecodeImage
:
# load image
img_mode
:
BGR
...
...
ppstructure/table/predict_table.py
浏览文件 @
c5b040b3
...
...
@@ -129,11 +129,25 @@ class TableSystem(object):
def
rebuild_table
(
self
,
structure_res
,
dt_boxes
,
rec_res
):
pred_structures
,
pred_bboxes
=
structure_res
dt_boxes
,
rec_res
=
self
.
filter_ocr_result
(
pred_bboxes
,
dt_boxes
,
rec_res
)
matched_index
=
self
.
match_result
(
dt_boxes
,
pred_bboxes
)
pred_html
,
pred
=
self
.
get_pred_html
(
pred_structures
,
matched_index
,
rec_res
)
return
pred_html
,
pred
def
filter_ocr_result
(
self
,
pred_bboxes
,
dt_boxes
,
rec_res
):
y1
=
pred_bboxes
[:,
1
::
2
].
min
()
new_dt_boxes
=
[]
new_rec_res
=
[]
for
box
,
rec
in
zip
(
dt_boxes
,
rec_res
):
if
np
.
max
(
box
[
1
::
2
])
<
y1
:
continue
new_dt_boxes
.
append
(
box
)
new_rec_res
.
append
(
rec
)
return
new_dt_boxes
,
new_rec_res
def
match_result
(
self
,
dt_boxes
,
pred_bboxes
):
matched
=
{}
for
i
,
gt_box
in
enumerate
(
dt_boxes
):
...
...
test_tipc/benchmark_train.sh
浏览文件 @
c5b040b3
...
...
@@ -21,6 +21,18 @@ function func_parser_params(){
echo
${
tmp
}
}
function
set_dynamic_epoch
(){
string
=
$1
num
=
$2
_str
=
${
string
:1:6
}
IFS
=
"C"
arr
=(
${
_str
}
)
M
=
${
arr
[0]
}
P
=
${
arr
[1]
}
ep
=
`
expr
$num
\*
$M
\*
$P
`
echo
$ep
}
function
func_sed_params
(){
filename
=
$1
line
=
$2
...
...
@@ -143,6 +155,7 @@ else
precision
=
"amp"
fi
epoch
=
$(
set_dynamic_epoch
$device_num
$epoch
)
fp_items_list
=(
$precision
)
batch_size_list
=(
$batch_size
)
device_num_list
=(
$device_num
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录