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
9e04c09f
Commit
9e04c09f
authored
May 05, 2022
by
HinGwenWoong
Browse files
Fix kie mode will crash when it has no `kie_cls` in label info
parent
cb9a8c4b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
PPOCRLabel/PPOCRLabel.py
PPOCRLabel/PPOCRLabel.py
+2
-2
No files found.
PPOCRLabel/PPOCRLabel.py
View file @
9e04c09f
...
@@ -1439,7 +1439,7 @@ class MainWindow(QMainWindow):
...
@@ -1439,7 +1439,7 @@ class MainWindow(QMainWindow):
DEFAULT_LOCK_COLOR
,
key_cls
,
box
[
'difficult'
]))
DEFAULT_LOCK_COLOR
,
key_cls
,
box
[
'difficult'
]))
if
imgidx
in
self
.
PPlabel
.
keys
():
if
imgidx
in
self
.
PPlabel
.
keys
():
for
box
in
self
.
PPlabel
[
imgidx
]:
for
box
in
self
.
PPlabel
[
imgidx
]:
key_cls
=
None
if
not
self
.
kie_mode
else
box
[
'key_cls'
]
key_cls
=
None
if
not
self
.
kie_mode
else
box
.
get
(
'key_cls'
,
'None'
)
shapes
.
append
((
box
[
'transcription'
],
box
[
'points'
],
None
,
key_cls
,
box
.
get
(
'difficult'
,
False
)))
shapes
.
append
((
box
[
'transcription'
],
box
[
'points'
],
None
,
key_cls
,
box
.
get
(
'difficult'
,
False
)))
self
.
loadLabels
(
shapes
)
self
.
loadLabels
(
shapes
)
...
@@ -1584,7 +1584,7 @@ class MainWindow(QMainWindow):
...
@@ -1584,7 +1584,7 @@ class MainWindow(QMainWindow):
for
image
,
info
in
label_dict
.
items
():
for
image
,
info
in
label_dict
.
items
():
for
box
in
info
:
for
box
in
info
:
if
"key_cls"
not
in
box
:
if
"key_cls"
not
in
box
:
continue
box
.
update
({
"key_cls"
:
"None"
})
self
.
existed_key_cls_set
.
add
(
box
[
"key_cls"
])
self
.
existed_key_cls_set
.
add
(
box
[
"key_cls"
])
if
len
(
self
.
existed_key_cls_set
)
>
0
:
if
len
(
self
.
existed_key_cls_set
)
>
0
:
for
key_text
in
self
.
existed_key_cls_set
:
for
key_text
in
self
.
existed_key_cls_set
:
...
...
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