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
aca80873
Commit
aca80873
authored
Feb 11, 2018
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added num_threads to shape_predictor_training_options.
parent
2a26521b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
shape_predictor.cpp
tools/python/src/shape_predictor.cpp
+2
-0
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)
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
,
"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
(
py
::
pickle
(
&
getstate
<
type
>
,
&
setstate
<
type
>
));
}
...
...
tools/python/src/shape_predictor.h
View file @
aca80873
...
...
@@ -30,6 +30,7 @@ namespace dlib
num_test_splits
=
20
;
feature_pool_region_padding
=
0
;
random_seed
=
""
;
num_threads
=
0
;
}
bool
be_verbose
;
...
...
@@ -43,6 +44,9 @@ namespace dlib
unsigned
long
num_test_splits
;
double
feature_pool_region_padding
;
std
::
string
random_seed
;
// not serialized
unsigned
long
num_threads
;
};
inline
void
serialize
(
...
...
@@ -110,6 +114,7 @@ namespace dlib
<<
"num_test_splits="
<<
o
.
num_test_splits
<<
","
<<
"feature_pool_region_padding="
<<
o
.
feature_pool_region_padding
<<
","
<<
"random_seed="
<<
o
.
random_seed
<<
"num_threads="
<<
o
.
num_threads
<<
")"
;
return
sout
.
str
();
}
...
...
@@ -165,6 +170,7 @@ namespace dlib
trainer
.
set_feature_pool_region_padding
(
options
.
feature_pool_region_padding
);
trainer
.
set_lambda
(
options
.
lambda_param
);
trainer
.
set_num_test_splits
(
options
.
num_test_splits
);
trainer
.
set_num_threads
(
options
.
num_threads
);
if
(
options
.
be_verbose
)
{
...
...
@@ -176,6 +182,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 "
<<
options
.
num_threads
<<
" threads."
<<
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