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
860c278e
Commit
860c278e
authored
Sep 08, 2011
by
Davis King
Browse files
Added yet more missing asserts
parent
8372b859
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
3 deletions
+21
-3
dlib/svm/structural_svm_object_detection_problem.h
dlib/svm/structural_svm_object_detection_problem.h
+20
-2
dlib/svm/structural_svm_object_detection_problem_abstract.h
dlib/svm/structural_svm_object_detection_problem_abstract.h
+1
-1
No files found.
dlib/svm/structural_svm_object_detection_problem.h
View file @
860c278e
...
...
@@ -26,15 +26,25 @@ namespace dlib
const
image_scanner_type
&
scanner
,
const
overlap_tester_type
&
overlap_tester
,
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
)
:
structural_svm_problem_threaded
<
matrix
<
double
,
0
,
1
>
>
(
num_threads
),
boxes_overlap
(
overlap_tester
),
images
(
images_
),
rects
(
rects
_
),
rects
(
truth_
rects
),
overlap_eps
(
0.5
)
{
// make sure requires clause is not broken
DLIB_ASSERT
(
is_learning_problem
(
images_
,
truth_rects
)
&&
scanner
.
get_num_detection_templates
()
>
0
,
"
\t
structural_svm_object_detection_problem::structural_svm_object_detection_problem()"
<<
"
\n\t
Invalid inputs were given to this function "
<<
"
\n\t
scanner.get_num_detection_templates(): "
<<
scanner
.
get_num_detection_templates
()
<<
"
\n\t
is_learning_problem(images_,truth_rects): "
<<
is_learning_problem
(
images_
,
truth_rects
)
<<
"
\n\t
this: "
<<
this
);
scanner_config
.
copy_configuration
(
scanner
);
max_num_dets
=
0
;
...
...
@@ -50,6 +60,14 @@ namespace dlib
double
eps
)
{
// make sure requires clause is not broken
DLIB_ASSERT
(
0
<
eps
&&
eps
<
1
,
"
\t
structural_svm_object_detection_problem::set_overlap_eps(eps)"
<<
"
\n\t
Invalid inputs were given to this function "
<<
"
\n\t
eps: "
<<
eps
<<
"
\n\t
this: "
<<
this
);
overlap_eps
=
eps
;
}
...
...
dlib/svm/structural_svm_object_detection_problem_abstract.h
View file @
860c278e
...
...
@@ -66,7 +66,7 @@ namespace dlib
);
/*!
requires
- i
mages.size() ==
truth_rects
.size(
)
- i
s_learning_problem(images,
truth_rects)
- scanner.get_num_detection_templates() > 0
ensures
- This object attempts to learn a mapping from the given images to the
...
...
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