Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
paddle_dbnet
Commits
456bcc3f
Commit
456bcc3f
authored
May 10, 2022
by
HinGwenWoong
Browse files
Fix re-reco will clear all key message
parent
7ee76192
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
PPOCRLabel/PPOCRLabel.py
PPOCRLabel/PPOCRLabel.py
+17
-3
No files found.
PPOCRLabel/PPOCRLabel.py
View file @
456bcc3f
...
@@ -1149,7 +1149,10 @@ class MainWindow(QMainWindow):
...
@@ -1149,7 +1149,10 @@ class MainWindow(QMainWindow):
for
box
in
self
.
result_dic
:
for
box
in
self
.
result_dic
:
trans_dic
=
{
"label"
:
box
[
1
][
0
],
"points"
:
box
[
0
],
"difficult"
:
False
}
trans_dic
=
{
"label"
:
box
[
1
][
0
],
"points"
:
box
[
0
],
"difficult"
:
False
}
if
self
.
kie_mode
:
if
self
.
kie_mode
:
trans_dic
.
update
({
"key_cls"
:
"None"
})
if
len
(
box
)
==
3
:
trans_dic
.
update
({
"key_cls"
:
box
[
2
]})
else
:
trans_dic
.
update
({
"key_cls"
:
"None"
})
if
trans_dic
[
"label"
]
==
""
and
mode
==
'Auto'
:
if
trans_dic
[
"label"
]
==
""
and
mode
==
'Auto'
:
continue
continue
shapes
.
append
(
trans_dic
)
shapes
.
append
(
trans_dic
)
...
@@ -2047,6 +2050,7 @@ class MainWindow(QMainWindow):
...
@@ -2047,6 +2050,7 @@ class MainWindow(QMainWindow):
rec_flag
=
0
rec_flag
=
0
for
shape
in
self
.
canvas
.
shapes
:
for
shape
in
self
.
canvas
.
shapes
:
box
=
[[
int
(
p
.
x
()),
int
(
p
.
y
())]
for
p
in
shape
.
points
]
box
=
[[
int
(
p
.
x
()),
int
(
p
.
y
())]
for
p
in
shape
.
points
]
kie_cls
=
shape
.
key_cls
if
len
(
box
)
>
4
:
if
len
(
box
)
>
4
:
box
=
self
.
gen_quad_from_poly
(
np
.
array
(
box
))
box
=
self
.
gen_quad_from_poly
(
np
.
array
(
box
))
...
@@ -2062,17 +2066,27 @@ class MainWindow(QMainWindow):
...
@@ -2062,17 +2066,27 @@ class MainWindow(QMainWindow):
if
shape
.
line_color
==
DEFAULT_LOCK_COLOR
:
if
shape
.
line_color
==
DEFAULT_LOCK_COLOR
:
shape
.
label
=
result
[
0
][
0
]
shape
.
label
=
result
[
0
][
0
]
result
.
insert
(
0
,
box
)
result
.
insert
(
0
,
box
)
if
self
.
kie_mode
:
result
.
append
(
kie_cls
)
self
.
result_dic_locked
.
append
(
result
)
self
.
result_dic_locked
.
append
(
result
)
else
:
else
:
result
.
insert
(
0
,
box
)
result
.
insert
(
0
,
box
)
if
self
.
kie_mode
:
result
.
append
(
kie_cls
)
self
.
result_dic
.
append
(
result
)
self
.
result_dic
.
append
(
result
)
else
:
else
:
print
(
'Can not recognise the box'
)
print
(
'Can not recognise the box'
)
if
shape
.
line_color
==
DEFAULT_LOCK_COLOR
:
if
shape
.
line_color
==
DEFAULT_LOCK_COLOR
:
shape
.
label
=
result
[
0
][
0
]
shape
.
label
=
result
[
0
][
0
]
self
.
result_dic_locked
.
append
([
box
,
(
self
.
noLabelText
,
0
)])
if
self
.
kie_mode
:
self
.
result_dic_locked
.
append
([
box
,
(
self
.
noLabelText
,
0
),
kie_cls
])
else
:
self
.
result_dic_locked
.
append
([
box
,
(
self
.
noLabelText
,
0
)])
else
:
else
:
self
.
result_dic
.
append
([
box
,
(
self
.
noLabelText
,
0
)])
if
self
.
kie_mode
:
self
.
result_dic
.
append
([
box
,
(
self
.
noLabelText
,
0
),
kie_cls
])
else
:
self
.
result_dic
.
append
([
box
,
(
self
.
noLabelText
,
0
)])
try
:
try
:
if
self
.
noLabelText
==
shape
.
label
or
result
[
1
][
0
]
==
shape
.
label
:
if
self
.
noLabelText
==
shape
.
label
or
result
[
1
][
0
]
==
shape
.
label
:
print
(
'label no change'
)
print
(
'label no change'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment