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
a27bd4d5
Unverified
Commit
a27bd4d5
authored
Jan 07, 2021
by
dyning
Committed by
GitHub
Jan 07, 2021
Browse files
Merge pull request #1678 from littletomatodonkey/dyg/fix_space_eval
fix space eval
parents
eb1d69a5
f5008a0a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
ppocr/metrics/rec_metric.py
ppocr/metrics/rec_metric.py
+2
-0
No files found.
ppocr/metrics/rec_metric.py
View file @
a27bd4d5
...
...
@@ -26,6 +26,8 @@ class RecMetric(object):
all_num
=
0
norm_edit_dis
=
0.0
for
(
pred
,
pred_conf
),
(
target
,
_
)
in
zip
(
preds
,
labels
):
pred
=
pred
.
replace
(
" "
,
""
)
target
=
target
.
replace
(
" "
,
""
)
norm_edit_dis
+=
Levenshtein
.
distance
(
pred
,
target
)
/
max
(
len
(
pred
),
len
(
target
))
if
pred
==
target
:
...
...
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