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
OpenDAS
dlib
Commits
99d5702f
Commit
99d5702f
authored
Jul 30, 2017
by
Davis King
Browse files
Gave test_object_detection_function() an option to set how ignore box overlap is tested.
parent
cb42b8fb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
6 deletions
+21
-6
dlib/dnn/validation.h
dlib/dnn/validation.h
+3
-2
dlib/svm/cross_validate_object_detection_trainer.h
dlib/svm/cross_validate_object_detection_trainer.h
+15
-2
dlib/svm/cross_validate_object_detection_trainer_abstract.h
dlib/svm/cross_validate_object_detection_trainer_abstract.h
+3
-2
No files found.
dlib/dnn/validation.h
View file @
99d5702f
...
...
@@ -19,7 +19,8 @@ namespace dlib
const
image_array_type
&
images
,
const
std
::
vector
<
std
::
vector
<
mmod_rect
>>&
truth_dets
,
const
test_box_overlap
&
overlap_tester
=
test_box_overlap
(),
const
double
adjust_threshold
=
0
const
double
adjust_threshold
=
0
,
const
test_box_overlap
&
overlaps_ignore_tester
=
test_box_overlap
()
)
{
// make sure requires clause is not broken
...
...
@@ -62,7 +63,7 @@ namespace dlib
for
(
auto
&&
b
:
hits
)
boxes
.
push_back
(
std
::
make_pair
(
b
.
detection_confidence
,
b
.
rect
));
correct_hits
+=
impl
::
number_of_truth_hits
(
truth_boxes
,
ignore
,
boxes
,
overlap_tester
,
all_dets
,
missing_detections
);
correct_hits
+=
impl
::
number_of_truth_hits
(
truth_boxes
,
ignore
,
boxes
,
overlap_tester
,
all_dets
,
missing_detections
,
overlaps_ignore_tester
);
total_true_targets
+=
truth_boxes
.
size
();
}
...
...
dlib/svm/cross_validate_object_detection_trainer.h
View file @
99d5702f
...
...
@@ -25,7 +25,8 @@ namespace dlib
const
std
::
vector
<
std
::
pair
<
double
,
rectangle
>
>&
boxes
,
const
test_box_overlap
&
overlap_tester
,
std
::
vector
<
std
::
pair
<
double
,
bool
>
>&
all_dets
,
unsigned
long
&
missing_detections
unsigned
long
&
missing_detections
,
const
test_box_overlap
&
overlaps_ignore_tester
)
/*!
ensures
...
...
@@ -74,7 +75,7 @@ namespace dlib
for
(
unsigned
long
i
=
0
;
i
<
boxes
.
size
();
++
i
)
{
// only out put boxes if they match a truth box or are not ignored.
if
(
used
[
i
]
||
!
overlaps_any_box
(
overlap_tester
,
ignore
,
boxes
[
i
].
second
))
if
(
used
[
i
]
||
!
overlaps_any_box
(
overlap
s_ignore
_tester
,
ignore
,
boxes
[
i
].
second
))
{
all_dets
.
push_back
(
std
::
make_pair
(
boxes
[
i
].
first
,
used
[
i
]));
}
...
...
@@ -83,6 +84,18 @@ namespace dlib
return
count
;
}
inline
unsigned
long
number_of_truth_hits
(
const
std
::
vector
<
full_object_detection
>&
truth_boxes
,
const
std
::
vector
<
rectangle
>&
ignore
,
const
std
::
vector
<
std
::
pair
<
double
,
rectangle
>
>&
boxes
,
const
test_box_overlap
&
overlap_tester
,
std
::
vector
<
std
::
pair
<
double
,
bool
>
>&
all_dets
,
unsigned
long
&
missing_detections
)
{
return
number_of_truth_hits
(
truth_boxes
,
ignore
,
boxes
,
overlap_tester
,
all_dets
,
missing_detections
,
overlap_tester
);
}
// ------------------------------------------------------------------------------------
}
...
...
dlib/svm/cross_validate_object_detection_trainer_abstract.h
View file @
99d5702f
...
...
@@ -142,7 +142,8 @@ namespace dlib
const
image_array_type
&
images
,
const
std
::
vector
<
std
::
vector
<
mmod_rect
>>&
truth_dets
,
const
test_box_overlap
&
overlap_tester
=
test_box_overlap
(),
const
double
adjust_threshold
=
0
const
double
adjust_threshold
=
0
,
const
test_box_overlap
&
overlaps_ignore_tester
=
test_box_overlap
()
);
/*!
requires
...
...
@@ -159,7 +160,7 @@ namespace dlib
truth_dets[i] that are marked ignore are ignored. That is, detections
matching an ignore box do not count as a false alarm and similarly if any
ignored box in truth_dets goes undetected it does not count as a missed
detection.
detection.
To test if a box overlaps an ignore box, we use overlaps_ignore_tester.
- In particular, returns a matrix M such that:
- M(0) == the precision of the detector object. This is a number
in the range [0,1] which measures the fraction of detector outputs
...
...
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