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
9ea8a47c
Commit
9ea8a47c
authored
Dec 18, 2021
by
WenmuZhou
Browse files
support eval in less det resule
parent
a5dbd8bb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
ppstructure/vqa/helper/eval_with_label_end2end.py
ppstructure/vqa/helper/eval_with_label_end2end.py
+6
-5
No files found.
ppstructure/vqa/helper/eval_with_label_end2end.py
View file @
9ea8a47c
...
...
@@ -15,13 +15,12 @@
import
os
import
re
import
sys
# import Polygon
import
shapely
from
shapely.geometry
import
Polygon
import
numpy
as
np
from
collections
import
defaultdict
import
operator
import
editdistance
import
Levenshtein
import
argparse
import
json
import
copy
...
...
@@ -95,7 +94,7 @@ def ed(args, str1, str2):
if
args
.
ignore_case
:
str1
=
str1
.
lower
()
str2
=
str2
.
lower
()
return
edit
distance
.
eval
(
str1
,
str2
)
return
Levenshtein
.
distance
(
str1
,
str2
)
def
convert_bbox_to_polygon
(
bbox
):
...
...
@@ -115,7 +114,9 @@ def eval_e2e(args):
# pred
dt_results
=
parse_ser_results_fp
(
args
.
pred_json_path
,
"pred"
,
args
.
ignore_background
)
assert
set
(
gt_results
.
keys
())
==
set
(
dt_results
.
keys
())
# print(gt_results.keys())
# print(dt_results.keys())
# assert set(gt_results.keys()) == set(dt_results.keys())
iou_thresh
=
args
.
iou_thres
num_gt_chars
=
0
...
...
@@ -124,7 +125,7 @@ def eval_e2e(args):
hit
=
0
ed_sum
=
0
for
img_name
in
g
t_results
:
for
img_name
in
d
t_results
:
gt_info
=
gt_results
[
img_name
]
gt_count
+=
len
(
gt_info
)
...
...
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