Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
99d5702f
Commit
99d5702f
authored
Jul 31, 2017
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gave test_object_detection_function() an option to set how ignore box overlap is tested.
parent
cb42b8fb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
6 deletions
+21
-6
validation.h
dlib/dnn/validation.h
+3
-2
cross_validate_object_detection_trainer.h
dlib/svm/cross_validate_object_detection_trainer.h
+15
-2
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