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
a3a3d579
Unverified
Commit
a3a3d579
authored
May 09, 2022
by
Evezerest
Committed by
GitHub
May 09, 2022
Browse files
Merge pull request #6186 from Evezerest/dygraph
Fix a bug of kie as null
parents
0e0e33df
02621d3f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
PPOCRLabel/PPOCRLabel.py
PPOCRLabel/PPOCRLabel.py
+3
-3
No files found.
PPOCRLabel/PPOCRLabel.py
View file @
a3a3d579
...
@@ -1471,7 +1471,7 @@ class MainWindow(QMainWindow):
...
@@ -1471,7 +1471,7 @@ class MainWindow(QMainWindow):
# box['ratio'] of the shapes saved in lockedShapes contains the ratio of the
# box['ratio'] of the shapes saved in lockedShapes contains the ratio of the
# four corner coordinates of the shapes to the height and width of the image
# four corner coordinates of the shapes to the height and width of the image
for
box
in
self
.
canvas
.
lockedShapes
:
for
box
in
self
.
canvas
.
lockedShapes
:
key_cls
=
None
if
not
self
.
kie_mode
else
box
[
'key_cls'
]
key_cls
=
'
None
'
if
not
self
.
kie_mode
else
box
[
'key_cls'
]
if
self
.
canvas
.
isInTheSameImage
:
if
self
.
canvas
.
isInTheSameImage
:
shapes
.
append
((
box
[
'transcription'
],
[[
s
[
0
]
*
width
,
s
[
1
]
*
height
]
for
s
in
box
[
'ratio'
]],
shapes
.
append
((
box
[
'transcription'
],
[[
s
[
0
]
*
width
,
s
[
1
]
*
height
]
for
s
in
box
[
'ratio'
]],
DEFAULT_LOCK_COLOR
,
key_cls
,
box
[
'difficult'
]))
DEFAULT_LOCK_COLOR
,
key_cls
,
box
[
'difficult'
]))
...
@@ -1480,7 +1480,7 @@ class MainWindow(QMainWindow):
...
@@ -1480,7 +1480,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
.
get
(
'key_cls'
,
'None'
)
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
)
...
@@ -2266,7 +2266,7 @@ class MainWindow(QMainWindow):
...
@@ -2266,7 +2266,7 @@ class MainWindow(QMainWindow):
rec_res
=
self
.
ocr
.
ocr
(
patch
,
det
=
False
,
rec
=
True
,
cls
=
False
)
rec_res
=
self
.
ocr
.
ocr
(
patch
,
det
=
False
,
rec
=
True
,
cls
=
False
)
text
=
rec_res
[
0
][
0
]
text
=
rec_res
[
0
][
0
]
if
text
!=
''
:
if
text
!=
''
:
texts
+=
text
+
(
'
'
if
text
[
0
].
isalpha
()
else
''
)
# add space between english word
texts
+=
text
+
(
''
if
text
[
0
].
isalpha
()
else
'
'
)
# add space between english word
probs
+=
rec_res
[
0
][
1
]
probs
+=
rec_res
[
0
][
1
]
probs
=
probs
/
len
(
bboxes
)
probs
=
probs
/
len
(
bboxes
)
result
=
[(
texts
.
strip
(),
probs
)]
result
=
[(
texts
.
strip
(),
probs
)]
...
...
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