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