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
aca80873
Commit
aca80873
authored
Feb 11, 2018
by
Davis King
Browse files
Added num_threads to shape_predictor_training_options.
parent
2a26521b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
tools/python/src/shape_predictor.cpp
tools/python/src/shape_predictor.cpp
+2
-0
tools/python/src/shape_predictor.h
tools/python/src/shape_predictor.h
+7
-0
No files found.
tools/python/src/shape_predictor.cpp
View file @
aca80873
...
@@ -208,6 +208,8 @@ void bind_shape_predictors(py::module &m)
...
@@ -208,6 +208,8 @@ void bind_shape_predictors(py::module &m)
e.g a padding of 0.5 would cause the algorithm to sample pixels from a box that was 2x2 pixels"
)
e.g a padding of 0.5 would cause the algorithm to sample pixels from a box that was 2x2 pixels"
)
.
def_readwrite
(
"random_seed"
,
&
type
::
random_seed
,
.
def_readwrite
(
"random_seed"
,
&
type
::
random_seed
,
"The random seed used by the internal random number generator"
)
"The random seed used by the internal random number generator"
)
.
def_readwrite
(
"num_threads"
,
&
type
::
num_threads
,
"Use this many threads/CPU cores for training."
)
.
def
(
"__str__"
,
&::
print_shape_predictor_training_options
)
.
def
(
"__str__"
,
&::
print_shape_predictor_training_options
)
.
def
(
py
::
pickle
(
&
getstate
<
type
>
,
&
setstate
<
type
>
));
.
def
(
py
::
pickle
(
&
getstate
<
type
>
,
&
setstate
<
type
>
));
}
}
...
...
tools/python/src/shape_predictor.h
View file @
aca80873
...
@@ -30,6 +30,7 @@ namespace dlib
...
@@ -30,6 +30,7 @@ namespace dlib
num_test_splits
=
20
;
num_test_splits
=
20
;
feature_pool_region_padding
=
0
;
feature_pool_region_padding
=
0
;
random_seed
=
""
;
random_seed
=
""
;
num_threads
=
0
;
}
}
bool
be_verbose
;
bool
be_verbose
;
...
@@ -43,6 +44,9 @@ namespace dlib
...
@@ -43,6 +44,9 @@ namespace dlib
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
;
// not serialized
unsigned
long
num_threads
;
};
};
inline
void
serialize
(
inline
void
serialize
(
...
@@ -110,6 +114,7 @@ namespace dlib
...
@@ -110,6 +114,7 @@ namespace dlib
<<
"num_test_splits="
<<
o
.
num_test_splits
<<
","
<<
"num_test_splits="
<<
o
.
num_test_splits
<<
","
<<
"feature_pool_region_padding="
<<
o
.
feature_pool_region_padding
<<
","
<<
"feature_pool_region_padding="
<<
o
.
feature_pool_region_padding
<<
","
<<
"random_seed="
<<
o
.
random_seed
<<
"random_seed="
<<
o
.
random_seed
<<
"num_threads="
<<
o
.
num_threads
<<
")"
;
<<
")"
;
return
sout
.
str
();
return
sout
.
str
();
}
}
...
@@ -165,6 +170,7 @@ namespace dlib
...
@@ -165,6 +170,7 @@ namespace dlib
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_param
);
trainer
.
set_lambda
(
options
.
lambda_param
);
trainer
.
set_num_test_splits
(
options
.
num_test_splits
);
trainer
.
set_num_test_splits
(
options
.
num_test_splits
);
trainer
.
set_num_threads
(
options
.
num_threads
);
if
(
options
.
be_verbose
)
if
(
options
.
be_verbose
)
{
{
...
@@ -176,6 +182,7 @@ namespace dlib
...
@@ -176,6 +182,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 "
<<
options
.
num_threads
<<
" threads."
<<
std
::
endl
;
std
::
cout
<<
"Training with lambda_param: "
<<
options
.
lambda_param
<<
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