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
yaoyuping
nnDetection
Commits
c6622682
Commit
c6622682
authored
Aug 25, 2021
by
mibaumgartner
Browse files
improve robustness
parent
537a3032
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
nndet/evaluator/det.py
nndet/evaluator/det.py
+2
-1
nndet/evaluator/detection/matching.py
nndet/evaluator/detection/matching.py
+2
-1
No files found.
nndet/evaluator/det.py
View file @
c6622682
...
@@ -96,7 +96,8 @@ class DetectionEvaluator(AbstractEvaluator):
...
@@ -96,7 +96,8 @@ class DetectionEvaluator(AbstractEvaluator):
dict: empty dict... detection metrics can only be evaluated at the end
dict: empty dict... detection metrics can only be evaluated at the end
"""
"""
if
gt_ignore
is
None
:
if
gt_ignore
is
None
:
gt_ignore
=
[
np
.
zeros
(
gt_boxes_img
.
shape
[
0
]).
reshape
(
-
1
)
for
gt_boxes_img
in
gt_boxes
]
n
=
[
0
if
gt_boxes_img
.
size
==
0
else
gt_boxes_img
.
shape
[
0
]
for
gt_boxes_img
in
gt_boxes
]
gt_ignore
=
[
np
.
zeros
(
_n
).
reshape
(
-
1
)
for
_n
in
n
]
self
.
results_list
.
extend
(
matching_batch
(
self
.
results_list
.
extend
(
matching_batch
(
self
.
iou_fn
,
self
.
iou_thresholds
,
pred_boxes
=
pred_boxes
,
pred_classes
=
pred_classes
,
self
.
iou_fn
,
self
.
iou_thresholds
,
pred_boxes
=
pred_boxes
,
pred_classes
=
pred_classes
,
...
...
nndet/evaluator/detection/matching.py
View file @
c6622682
...
@@ -197,7 +197,8 @@ def _matching_no_pred(
...
@@ -197,7 +197,8 @@ def _matching_no_pred(
dt_match
=
np
.
array
([[]]
*
len
(
iou_thresholds
))
dt_match
=
np
.
array
([[]]
*
len
(
iou_thresholds
))
dt_ignore
=
np
.
array
([[]]
*
len
(
iou_thresholds
))
dt_ignore
=
np
.
array
([[]]
*
len
(
iou_thresholds
))
gt_match
=
np
.
zeros
((
len
(
iou_thresholds
),
len
(
gt_ignore
)))
n_gt
=
0
if
gt_ignore
.
size
==
0
else
gt_ignore
.
shape
[
0
]
gt_match
=
np
.
zeros
((
len
(
iou_thresholds
),
n_gt
))
return
{
return
{
'dtMatches'
:
dt_match
,
# [T, D], where T = number of thresholds, D = number of detections
'dtMatches'
:
dt_match
,
# [T, D], where T = number of thresholds, D = number of detections
...
...
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