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
cf8e0529
Commit
cf8e0529
authored
Sep 08, 2011
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improved the spec
parent
12e6f8ee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
10 deletions
+43
-10
structural_svm_object_detection_problem_abstract.h
dlib/svm/structural_svm_object_detection_problem_abstract.h
+43
-10
No files found.
dlib/svm/structural_svm_object_detection_problem_abstract.h
View file @
cf8e0529
...
@@ -22,21 +22,38 @@ namespace dlib
...
@@ -22,21 +22,38 @@ namespace dlib
{
{
/*!
/*!
REQUIREMENTS ON image_scanner_type
REQUIREMENTS ON image_scanner_type
image_scanner_type must be an instance of the scan_image_pyramid
image_scanner_type must be an implementation of
templated defined in dlib/image_processing/scan_image_pyramid_abstract.h
dlib/image_processing/scan_image_pyramid_abstract.h
or an object with a compatible interface.
REQUIREMENTS ON overlap_tester_type
REQUIREMENTS ON overlap_tester_type
overlap_tester_type must be a
type with an interface compatible
overlap_tester_type must be a
n implementation of the test_box_overlap
with test_box_overlap
.
object defined in dlib/image_processing/box_overlap_testing_abstract.h
.
REQUIREMENTS ON image_array_type
REQUIREMENTS ON image_array_type
image_array_type must be a
dlib/array/array_kernel_abstract.h object
image_array_type must be a
n implementation of dlib/array/array_kernel_abstract.h
which contains object types which
be accepted by image_scanner_type::load().
and it must contain objects which can
be accepted by image_scanner_type::load().
WHAT THIS OBJECT REPRESENTS
WHAT THIS OBJECT REPRESENTS
This object is a tool for learning the parameter vector needed to use
This object is a tool for learning the parameter vector needed to use
a scan_image_pyramid object.
a scan_image_pyramid object.
It learns the parameter vector by formulating the problem as a structural
SVM problem. The general approach is similar to the method discussed in
Learning to Localize Objects with Structured Output Regression by
Matthew B. Blaschko and Christoph H. Lampert. However, the method has
been extended to datasets with multiple, potentially overlapping, objects
per image and the measure of loss is different from what is described in
the paper.
In particular, the loss is the number of false detections plus the number
of missed targets. A detection is considered a false detection if it doesn't
overlap with any of the ground truth rectangles or if it is a duplicate
detection of a truth rectangle. A detection "misses a target" if it doesn't
overlap with the truth rectangle for any target. Finally, for the purposes
of calculating loss, overlap is determined using the following formula,
rectangles A and B overlap if and only if:
A.intersect(B).area()/(A+B).area() > get_overlap_eps()
!*/
!*/
public
:
public
:
...
@@ -44,13 +61,26 @@ namespace dlib
...
@@ -44,13 +61,26 @@ namespace dlib
const
image_scanner_type
&
scanner
,
const
image_scanner_type
&
scanner
,
const
overlap_tester_type
&
overlap_tester
,
const
overlap_tester_type
&
overlap_tester
,
const
image_array_type
&
images
,
const
image_array_type
&
images
,
const
std
::
vector
<
std
::
vector
<
rectangle
>
>&
rects
,
const
std
::
vector
<
std
::
vector
<
rectangle
>
>&
truth_
rects
,
unsigned
long
num_threads
=
2
unsigned
long
num_threads
=
2
);
);
/*!
/*!
requires
requires
- images.size() == rects.size()
- images.size() ==
truth_
rects.size()
- scanner.num_detection_templates() > 0
- scanner.num_detection_templates() > 0
ensures
- This object attempts to learn a mapping from the given images to the
object locations given in truth_rects. In particular, it attempts to
learn to predict truth_rects[i] based on images[i].
Or in other words, this object can be used to learn a parameter vector, w, such that
an object_detector declared as:
object_detector<image_scanner_type,overlap_tester_type> detector(scanner,overlap_tester,w)
results in a detector object which attempts to compute the following mapping:
truth_rects[i] == detector(images[i])
- #get_overlap_eps() == 0.5
- This object will use num_threads threads during the optimization
procedure. You should set this parameter equal to the number of
available processing cores on your machine.
!*/
!*/
void
set_overlap_eps
(
void
set_overlap_eps
(
...
@@ -58,7 +88,7 @@ namespace dlib
...
@@ -58,7 +88,7 @@ namespace dlib
);
);
/*!
/*!
requires
requires
-
eps > 0
-
0 < eps < 1
ensures
ensures
- #get_overlap_eps() == eps
- #get_overlap_eps() == eps
!*/
!*/
...
@@ -66,6 +96,9 @@ namespace dlib
...
@@ -66,6 +96,9 @@ namespace dlib
double
get_overlap_eps
(
double
get_overlap_eps
(
)
const
;
)
const
;
/*!
/*!
ensures
- returns the amount of overlap necessary for a detection to be considered
as overlapping with a ground truth rectangle.
!*/
!*/
};
};
...
...
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