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
a5082f7a
Commit
a5082f7a
authored
Feb 22, 2014
by
Davis King
Browse files
Made the track association testing functions smarter about how they evaluate
the quality of a track association function.
parent
ea60f622
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
dlib/svm/cross_validate_track_association_trainer.h
dlib/svm/cross_validate_track_association_trainer.h
+12
-3
No files found.
dlib/svm/cross_validate_track_association_trainer.h
View file @
a5082f7a
...
@@ -29,16 +29,25 @@ namespace dlib
...
@@ -29,16 +29,25 @@ namespace dlib
typedef
typename
detection_type
::
track_type
track_type
;
typedef
typename
detection_type
::
track_type
track_type
;
using
namespace
impl
;
using
namespace
impl
;
dlib
::
rand
rnd
;
std
::
vector
<
track_type
>
tracks
;
std
::
vector
<
track_type
>
tracks
;
std
::
map
<
label_type
,
unsigned
long
>
track_idx
;
// tracks[track_idx[id]] == track with ID id.
std
::
map
<
label_type
,
unsigned
long
>
track_idx
;
// tracks[track_idx[id]] == track with ID id.
for
(
unsigned
long
j
=
0
;
j
<
samples
.
size
();
++
j
)
for
(
unsigned
long
j
=
0
;
j
<
samples
.
size
();
++
j
)
{
{
total_dets
+=
samples
[
j
].
size
();
std
::
vector
<
labeled_detection
<
detection_type
,
label_type
>
>
dets
=
samples
[
j
];
std
::
vector
<
long
>
assignments
=
f
(
get_unlabeled_dets
(
samples
[
j
]),
tracks
);
// Shuffle the order of the detections so we can be sure that there isn't
// anything funny going on like the detections always coming in the same
// order relative to their labels and the association function just gets
// lucky by picking the same assignment ordering every time. So this way
// we know the assignment function really is doing something rather than
// just being lucky.
randomize_samples
(
dets
,
rnd
);
total_dets
+=
dets
.
size
();
std
::
vector
<
long
>
assignments
=
f
(
get_unlabeled_dets
(
dets
),
tracks
);
std
::
vector
<
bool
>
updated_track
(
tracks
.
size
(),
false
);
std
::
vector
<
bool
>
updated_track
(
tracks
.
size
(),
false
);
// now update all the tracks with the detections that associated to them.
// now update all the tracks with the detections that associated to them.
const
std
::
vector
<
labeled_detection
<
detection_type
,
label_type
>
>&
dets
=
samples
[
j
];
for
(
unsigned
long
k
=
0
;
k
<
assignments
.
size
();
++
k
)
for
(
unsigned
long
k
=
0
;
k
<
assignments
.
size
();
++
k
)
{
{
// If the detection is associated to tracks[assignments[k]]
// If the detection is associated to tracks[assignments[k]]
...
...
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