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
bc11e397
Commit
bc11e397
authored
Jan 14, 2012
by
Davis King
Browse files
Just cleaned up the code a little to make it easier to follow.
parent
c56f3465
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
dlib/svm/structural_svm_object_detection_problem.h
dlib/svm/structural_svm_object_detection_problem.h
+12
-5
No files found.
dlib/svm/structural_svm_object_detection_problem.h
View file @
bc11e397
...
...
@@ -267,6 +267,9 @@ namespace dlib
// Measure the loss augmented score for the detections which hit a truth rect.
std
::
vector
<
double
>
truth_score_hits
(
truth_rects
[
idx
].
size
(),
0
);
// keep track of which truth boxes we have hit so far.
std
::
vector
<
bool
>
hit_truth_table
(
truth_rects
[
idx
].
size
(),
false
);
std
::
vector
<
rectangle
>
final_dets
;
// The point of this loop is to fill out the truth_score_hits array.
for
(
unsigned
long
i
=
0
;
i
<
dets
.
size
()
&&
final_dets
.
size
()
<
max_num_dets
;
++
i
)
...
...
@@ -284,16 +287,20 @@ namespace dlib
{
// if this is the first time we have seen a detect which hit truth_rects[truth.second]
const
double
score
=
dets
[
i
].
first
-
thresh
;
if
(
truth_score_hits
[
truth
.
second
]
==
0
)
truth_score_hits
[
truth
.
second
]
+=
score
-
loss_per_missed_target
;
if
(
hit_truth_table
[
truth
.
second
]
==
false
)
{
hit_truth_table
[
truth
.
second
]
=
true
;
truth_score_hits
[
truth
.
second
]
+=
score
;
}
else
{
truth_score_hits
[
truth
.
second
]
+=
score
+
loss_per_false_alarm
;
}
}
}
hit_truth_table
.
assign
(
hit_truth_table
.
size
(),
false
);
// keep track of which truth boxes we have hit so far.
std
::
vector
<
bool
>
hit_truth_table
(
truth_rects
[
idx
].
size
(),
false
);
final_dets
.
clear
();
// Now figure out which detections jointly maximize the loss and detection score sum. We
// need to take into account the fact that allowing a true detection in the output, while
...
...
@@ -309,7 +316,7 @@ namespace dlib
const
double
truth_match
=
truth
.
first
;
if
(
truth_match
>
match_eps
)
{
if
(
truth_score_hits
[
truth
.
second
]
>
=
0
)
if
(
truth_score_hits
[
truth
.
second
]
>
loss_per_missed_target
)
{
if
(
!
hit_truth_table
[
truth
.
second
])
{
...
...
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