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
2e2a1487
Commit
2e2a1487
authored
Mar 25, 2015
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed the lambda variable since it clashes with a python keyword.
parent
a16515ea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
shape_predictor.cpp
tools/python/src/shape_predictor.cpp
+4
-4
shape_predictor.h
tools/python/src/shape_predictor.h
+6
-6
No files found.
tools/python/src/shape_predictor.cpp
View file @
2e2a1487
...
...
@@ -198,8 +198,8 @@ void bind_shape_predictors()
.
add_property
(
"feature_pool_size"
,
&
type
::
feature_pool_size
,
&
type
::
feature_pool_size
,
"Number of pixels used to generate features for the random trees."
)
.
add_property
(
"lambda
"
,
&
type
::
lambda
,
&
type
::
lambda
,
.
add_property
(
"lambda
_param"
,
&
type
::
lambda_param
,
&
type
::
lambda
_param
,
"Controls how tight the feature sampling should be. Lower values enforce closer features."
)
.
add_property
(
"num_test_splits"
,
&
type
::
num_test_splits
,
&
type
::
num_test_splits
,
...
...
@@ -238,7 +238,7 @@ ensures \n\
def
(
"train_shape_predictor"
,
train_shape_predictor_on_images_py
,
(
arg
(
"images"
),
arg
(
"object_detections"
),
arg
(
"options"
)),
"requires
\n
\
- options.lambda > 0
\n
\
- options.lambda
_param
> 0
\n
\
- 0 < options.nu <= 1
\n
\
- options.feature_pool_region_padding >= 0
\n
\
- len(images) == len(object_detections)
\n
\
...
...
@@ -253,7 +253,7 @@ ensures \n\
def
(
"train_shape_predictor"
,
train_shape_predictor
,
(
arg
(
"dataset_filename"
),
arg
(
"predictor_output_filename"
),
arg
(
"options"
)),
"requires
\n
\
- options.lambda > 0
\n
\
- options.lambda
_param
> 0
\n
\
- 0 < options.nu <= 1
\n
\
- options.feature_pool_region_padding >= 0
\n
\
ensures
\n
\
...
...
tools/python/src/shape_predictor.h
View file @
2e2a1487
...
...
@@ -26,7 +26,7 @@ namespace dlib
nu
=
0
.
1
;
oversampling_amount
=
20
;
feature_pool_size
=
400
;
lambda
=
0
.
1
;
lambda
_param
=
0
.
1
;
num_test_splits
=
20
;
feature_pool_region_padding
=
0
;
random_seed
=
""
;
...
...
@@ -39,7 +39,7 @@ namespace dlib
double
nu
;
unsigned
long
oversampling_amount
;
unsigned
long
feature_pool_size
;
double
lambda
;
double
lambda
_param
;
unsigned
long
num_test_splits
;
double
feature_pool_region_padding
;
std
::
string
random_seed
;
...
...
@@ -71,8 +71,8 @@ namespace dlib
const
shape_predictor_training_options
&
options
)
{
if
(
options
.
lambda
<=
0
)
throw
error
(
"Invalid lambda
value given to train_shape_predictor(), lambda
must be > 0."
);
if
(
options
.
lambda
_param
<=
0
)
throw
error
(
"Invalid lambda
_param value given to train_shape_predictor(), lambda_param
must be > 0."
);
if
(
!
(
0
<
options
.
nu
&&
options
.
nu
<=
1
))
throw
error
(
"Invalid nu value given to train_shape_predictor(). It is required that 0 < nu <= 1."
);
if
(
options
.
feature_pool_region_padding
<
0
)
...
...
@@ -94,7 +94,7 @@ namespace dlib
trainer
.
set_oversampling_amount
(
options
.
oversampling_amount
);
trainer
.
set_feature_pool_size
(
options
.
feature_pool_size
);
trainer
.
set_feature_pool_region_padding
(
options
.
feature_pool_region_padding
);
trainer
.
set_lambda
(
options
.
lambda
);
trainer
.
set_lambda
(
options
.
lambda
_param
);
trainer
.
set_num_test_splits
(
options
.
num_test_splits
);
if
(
options
.
be_verbose
)
...
...
@@ -107,7 +107,7 @@ namespace dlib
std
::
cout
<<
"Training with oversampling amount: "
<<
options
.
oversampling_amount
<<
std
::
endl
;
std
::
cout
<<
"Training with feature pool size: "
<<
options
.
feature_pool_size
<<
std
::
endl
;
std
::
cout
<<
"Training with feature pool region padding: "
<<
options
.
feature_pool_region_padding
<<
std
::
endl
;
std
::
cout
<<
"Training with lambda
: "
<<
options
.
lambda
<<
std
::
endl
;
std
::
cout
<<
"Training with lambda
_param: "
<<
options
.
lambda_param
<<
std
::
endl
;
std
::
cout
<<
"Training with "
<<
options
.
num_test_splits
<<
" split tests."
<<
std
::
endl
;
trainer
.
be_verbose
();
}
...
...
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