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
3a91295e
Commit
3a91295e
authored
Jun 13, 2017
by
Joachim
Browse files
Merge branch 'master' of
https://github.com/davisking/dlib
parents
22164e5d
75f66582
Changes
122
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
1273 additions
and
1226 deletions
+1273
-1226
dlib/gui_widgets/base_widgets.h
dlib/gui_widgets/base_widgets.h
+15
-14
dlib/gui_widgets/drawable.h
dlib/gui_widgets/drawable.h
+5
-3
dlib/gui_widgets/fonts.cpp
dlib/gui_widgets/fonts.cpp
+5
-3
dlib/gui_widgets/fonts.h
dlib/gui_widgets/fonts.h
+6
-5
dlib/gui_widgets/nativefont.h
dlib/gui_widgets/nativefont.h
+3
-3
dlib/gui_widgets/widgets.cpp
dlib/gui_widgets/widgets.cpp
+14
-12
dlib/gui_widgets/widgets.h
dlib/gui_widgets/widgets.h
+21
-20
dlib/image_loader/jpeg_loader.h
dlib/image_loader/jpeg_loader.h
+2
-2
dlib/image_loader/png_loader.h
dlib/image_loader/png_loader.h
+3
-2
dlib/image_processing.h
dlib/image_processing.h
+1
-0
dlib/image_processing/shape_predictor.h
dlib/image_processing/shape_predictor.h
+0
-741
dlib/image_processing/shape_predictor_abstract.h
dlib/image_processing/shape_predictor_abstract.h
+3
-321
dlib/image_processing/shape_predictor_trainer.h
dlib/image_processing/shape_predictor_trainer.h
+759
-0
dlib/image_processing/shape_predictor_trainer_abstract.h
dlib/image_processing/shape_predictor_trainer_abstract.h
+334
-0
dlib/iosockstream/iosockstream.h
dlib/iosockstream/iosockstream.h
+6
-5
dlib/logger/logger_kernel_1.cpp
dlib/logger/logger_kernel_1.cpp
+1
-1
dlib/logger/logger_kernel_1.h
dlib/logger/logger_kernel_1.h
+11
-10
dlib/matrix/lapack/gees.h
dlib/matrix/lapack/gees.h
+4
-4
dlib/matrix/matrix_blas_bindings.h
dlib/matrix/matrix_blas_bindings.h
+44
-44
dlib/matrix/matrix_trsm.h
dlib/matrix/matrix_trsm.h
+36
-36
No files found.
dlib/gui_widgets/base_widgets.h
View file @
3a91295e
...
...
@@ -4,6 +4,9 @@
#ifndef DLIB_BASE_WIDGETs_
#define DLIB_BASE_WIDGETs_
#include <cctype>
#include <memory>
#include "base_widgets_abstract.h"
#include "drawable.h"
#include "../gui_core.h"
...
...
@@ -17,9 +20,7 @@
#include "../image_transforms/assign_image.h"
#include "../array.h"
#include "style.h"
#include "../smart_pointers.h"
#include "../unicode.h"
#include <cctype>
#include "../any.h"
...
...
@@ -586,7 +587,7 @@ namespace dlib
class
tooltip_window
:
public
base_window
{
public:
tooltip_window
(
const
shared_ptr
_thread_safe
<
font
>&
f
)
:
base_window
(
false
,
true
),
pad
(
3
),
mfont
(
f
)
tooltip_window
(
const
std
::
shared_ptr
<
font
>&
f
)
:
base_window
(
false
,
true
),
pad
(
3
),
mfont
(
f
)
{
}
...
...
@@ -594,7 +595,7 @@ namespace dlib
rectangle
rect_all
;
rectangle
rect_text
;
const
unsigned
long
pad
;
const
shared_ptr
_thread_safe
<
font
>
mfont
;
const
std
::
shared_ptr
<
font
>
mfont
;
void
set_text
(
const
std
::
string
&
str
...
...
@@ -694,7 +695,7 @@ namespace dlib
};
friend
struct
data
;
s
coped
_ptr
<
data
>
stuff
;
s
td
::
unique
_ptr
<
data
>
stuff
;
...
...
@@ -777,7 +778,7 @@ namespace dlib
)
const
;
void
set_main_font
(
const
shared_ptr
_thread_safe
<
font
>&
f
const
std
::
shared_ptr
<
font
>&
f
);
void
show
(
...
...
@@ -952,7 +953,7 @@ namespace dlib
any_function
<
void
(
button
&
)
>
button_down_handler_self
;
any_function
<
void
(
bool
,
button
&
)
>
button_up_handler_self
;
s
coped
_ptr
<
button_style
>
style
;
s
td
::
unique
_ptr
<
button_style
>
style
;
protected:
...
...
@@ -1415,7 +1416,7 @@ namespace dlib
timer
<
scroll_bar
>
top_filler_timer
;
timer
<
scroll_bar
>
bottom_filler_timer
;
long
delayed_pos
;
s
coped
_ptr
<
scroll_bar_style
>
style
;
s
td
::
unique
_ptr
<
scroll_bar_style
>
style
;
// restricted functions
scroll_bar
(
scroll_bar
&
);
// copy constructor
...
...
@@ -1623,7 +1624,7 @@ namespace dlib
private:
dlib
::
ustring
text
;
const
shared_ptr
_thread_safe
<
font
>
f
;
const
std
::
shared_ptr
<
font
>
f
;
any_function
<
void
()
>
action
;
unichar
hotkey
;
point
underline_p1
;
...
...
@@ -1801,7 +1802,7 @@ namespace dlib
private:
dlib
::
ustring
text
;
const
shared_ptr
_thread_safe
<
font
>
f
;
const
std
::
shared_ptr
<
font
>
f
;
any_function
<
void
()
>
action
;
unichar
hotkey
;
point
underline_p1
;
...
...
@@ -1925,7 +1926,7 @@ namespace dlib
{
auto_mutex
M
(
wm
);
bool
t
=
true
;
s
coped
_ptr
<
menu_item
>
item
(
new
menu_item_type
(
new_item
));
s
td
::
unique
_ptr
<
menu_item
>
item
(
new
menu_item_type
(
new_item
));
items
.
push_back
(
item
);
item_enabled
.
push_back
(
t
);
...
...
@@ -2135,7 +2136,7 @@ namespace dlib
rectangle
win_rect
;
unsigned
long
left_width
;
unsigned
long
middle_width
;
array
<
s
coped
_ptr
<
menu_item
>
>
items
;
array
<
s
td
::
unique
_ptr
<
menu_item
>
>
items
;
array
<
bool
>
item_enabled
;
array
<
rectangle
>
left_rects
;
array
<
rectangle
>
middle_rects
;
...
...
@@ -2356,7 +2357,7 @@ namespace dlib
scroll_bar
vsb
;
scroll_bar
hsb
;
s
coped
_ptr
<
scrollable_region_style
>
style
;
s
td
::
unique
_ptr
<
scrollable_region_style
>
style
;
// restricted functions
zoomable_region
(
zoomable_region
&
);
// copy constructor
...
...
@@ -2576,7 +2577,7 @@ namespace dlib
bool
mouse_drag_enabled_
;
bool
user_is_dragging_mouse
;
point
drag_origin
;
s
coped
_ptr
<
scrollable_region_style
>
style
;
s
td
::
unique
_ptr
<
scrollable_region_style
>
style
;
};
...
...
dlib/gui_widgets/drawable.h
View file @
3a91295e
...
...
@@ -4,6 +4,8 @@
#ifndef DLIB_DRAWABLe_
#define DLIB_DRAWABLe_
#include <memory>
#include "drawable_abstract.h"
#include "../gui_core.h"
#include "../set.h"
...
...
@@ -344,7 +346,7 @@ namespace dlib
}
virtual
void
set_main_font
(
const
shared_ptr
_thread_safe
<
font
>&
f
const
std
::
shared_ptr
<
font
>&
f
)
{
auto_mutex
M
(
m
);
...
...
@@ -352,7 +354,7 @@ namespace dlib
parent
.
invalidate_rectangle
(
rect
);
}
const
shared_ptr
_thread_safe
<
font
>
main_font
(
const
std
::
shared_ptr
<
font
>
main_font
(
)
const
{
auto_mutex
M
(
m
);
...
...
@@ -420,7 +422,7 @@ namespace dlib
bool
enabled
;
const
long
&
lastx
;
const
long
&
lasty
;
shared_ptr
_thread_safe
<
font
>
mfont
;
std
::
shared_ptr
<
font
>
mfont
;
void
enable_events
(
...
...
dlib/gui_widgets/fonts.cpp
View file @
3a91295e
...
...
@@ -5,11 +5,13 @@
#include "fonts.h"
#include "../serialize.h"
#include <fstream>
#include <memory>
#include <sstream>
#include "../serialize.h"
#include "../base64.h"
#include "../compress_stream.h"
#include <fstream>
#include "../tokenizer.h"
#include "nativefont.h"
...
...
@@ -657,7 +659,7 @@ namespace dlib
// ----------------------------------------------------------------------------------------
const
shared_ptr
_thread_safe
<
font
>
get_native_font
(
const
std
::
shared_ptr
<
font
>
get_native_font
(
)
{
return
nativefont
::
native_font
::
get_font
();
...
...
dlib/gui_widgets/fonts.h
View file @
3a91295e
...
...
@@ -4,16 +4,17 @@
#ifndef DLIB_FONTs_
#define DLIB_FONTs_
#include <memory>
#include <string>
#include "fonts_abstract.h"
#include "../gui_core.h"
#include <string>
#include "../algs.h"
#include "../serialize.h"
#include "../unicode.h"
#include "../array.h"
#include "../array2d.h"
#include "../threads.h"
#include "../smart_pointers_thread_safe.h"
namespace
dlib
{
...
...
@@ -483,7 +484,7 @@ namespace dlib
// ----------------------------------------------------------------------------------------
const
shared_ptr
_thread_safe
<
font
>
get_native_font
();
const
std
::
shared_ptr
<
font
>
get_native_font
();
// ----------------------------------------------------------------------------------------
...
...
@@ -500,11 +501,11 @@ namespace dlib
public:
static
const
shared_ptr
_thread_safe
<
font
>&
get_font
(
static
const
std
::
shared_ptr
<
font
>&
get_font
(
)
{
static
mutex
m
;
static
shared_ptr
_thread_safe
<
font
>
f
;
static
std
::
shared_ptr
<
font
>
f
;
auto_mutex
M
(
m
);
if
(
f
.
get
()
==
0
)
f
.
reset
(
new
default_font
);
...
...
dlib/gui_widgets/nativefont.h
View file @
3a91295e
...
...
@@ -7,10 +7,10 @@
#include "../gui_widgets.h"
#include "../unicode.h"
#include "../smart_pointers_thread_safe.h"
#include "../uintn.h"
#include <map>
#include <memory>
#include <stdio.h>
#include <string.h>
...
...
@@ -546,10 +546,10 @@ namespace nativefont
return
(
*
this
)[
ch
].
width
()
>
0
;
}
static
const
dlib
::
shared_ptr
_thread_safe
<
font
>&
get_font
(
static
const
std
::
shared_ptr
<
font
>&
get_font
(
)
{
static
dlib
::
shared_ptr
_thread_safe
<
font
>
f
(
new
native_font
);
static
std
::
shared_ptr
<
font
>
f
(
new
native_font
);
return
f
;
}
...
...
dlib/gui_widgets/widgets.cpp
View file @
3a91295e
...
...
@@ -3,8 +3,10 @@
#ifndef DLIB_WIDGETs_CPP_
#define DLIB_WIDGETs_CPP_
#include "widgets.h"
#include <algorithm>
#include <memory>
#include "widgets.h"
#include "../string.h"
namespace
dlib
...
...
@@ -160,7 +162,7 @@ namespace dlib
void
toggle_button
::
set_main_font
(
const
shared_ptr
_thread_safe
<
font
>&
f
const
std
::
shared_ptr
<
font
>&
f
)
{
auto_mutex
M
(
m
);
...
...
@@ -309,7 +311,7 @@ namespace dlib
void
label
::
set_main_font
(
const
shared_ptr
_thread_safe
<
font
>&
f
const
std
::
shared_ptr
<
font
>&
f
)
{
auto_mutex
M
(
m
);
...
...
@@ -638,7 +640,7 @@ namespace dlib
void
text_field
::
set_main_font
(
const
shared_ptr
_thread_safe
<
font
>&
f
const
std
::
shared_ptr
<
font
>&
f
)
{
auto_mutex
M
(
m
);
...
...
@@ -1745,7 +1747,7 @@ namespace dlib
void
tabbed_display
::
set_main_font
(
const
shared_ptr
_thread_safe
<
font
>&
f
const
std
::
shared_ptr
<
font
>&
f
)
{
auto_mutex
M
(
m
);
...
...
@@ -1887,7 +1889,7 @@ namespace dlib
void
named_rectangle
::
set_main_font
(
const
shared_ptr
_thread_safe
<
font
>&
f
const
std
::
shared_ptr
<
font
>&
f
)
{
auto_mutex
M
(
m
);
...
...
@@ -2065,7 +2067,7 @@ namespace dlib
void
mouse_tracker
::
set_main_font
(
const
shared_ptr
_thread_safe
<
font
>&
f
const
std
::
shared_ptr
<
font
>&
f
)
{
auto_mutex
M
(
m
);
...
...
@@ -2270,7 +2272,7 @@ namespace dlib
template
<
typename
S
>
void
list_box
<
S
>::
set_main_font
(
const
shared_ptr
_thread_safe
<
font
>&
f
const
std
::
shared_ptr
<
font
>&
f
)
{
auto_mutex
M
(
m
);
...
...
@@ -3000,7 +3002,7 @@ namespace dlib
const
std
::
string
old_path
=
path
;
const
long
old_cur_dir
=
cur_dir
;
s
coped
_ptr
<
toggle_button
>
new_btn
(
new
toggle_button
(
*
this
));
s
td
::
unique
_ptr
<
toggle_button
>
new_btn
(
new
toggle_button
(
*
this
));
new_btn
->
set_name
(
folder_name
);
new_btn
->
set_click_handler
(
*
this
,
&
box_win
::
on_path_button_click
);
...
...
@@ -3009,7 +3011,7 @@ namespace dlib
{
while
(
sob
.
size
()
>
(
unsigned
long
)(
cur_dir
+
1
))
{
s
coped
_ptr
<
toggle_button
>
junk
;
s
td
::
unique
_ptr
<
toggle_button
>
junk
;
sob
.
remove
(
cur_dir
+
1
,
junk
);
}
}
...
...
@@ -3300,7 +3302,7 @@ namespace dlib
void
menu_bar
::
set_main_font
(
const
shared_ptr
_thread_safe
<
font
>&
f
const
std
::
shared_ptr
<
font
>&
f
)
{
auto_mutex
M
(
m
);
...
...
@@ -4916,7 +4918,7 @@ namespace dlib
void
text_box
::
set_main_font
(
const
shared_ptr
_thread_safe
<
font
>&
f
const
std
::
shared_ptr
<
font
>&
f
)
{
auto_mutex
M
(
m
);
...
...
dlib/gui_widgets/widgets.h
View file @
3a91295e
...
...
@@ -4,13 +4,18 @@
#ifndef DLIB_WIDGETs_
#define DLIB_WIDGETs_
#include <cctype>
#include <memory>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include "../algs.h"
#include "widgets_abstract.h"
#include "drawable.h"
#include "../gui_core.h"
#include "fonts.h"
#include <string>
#include <sstream>
#include "../timer.h"
#include "base_widgets.h"
#include "../member_function_pointer.h"
...
...
@@ -19,14 +24,10 @@
#include "../sequence.h"
#include "../dir_nav.h"
#include "../queue.h"
#include "../smart_pointers.h"
#include "style.h"
#include "../string.h"
#include "../misc_api.h"
#include <cctype>
#include <vector>
#include "../any.h"
#include <set>
#include "../image_processing/full_object_detection.h"
#ifdef _MSC_VER
...
...
@@ -93,7 +94,7 @@ namespace dlib
)
const
;
void
set_main_font
(
const
shared_ptr
_thread_safe
<
font
>&
f
const
std
::
shared_ptr
<
font
>&
f
);
private:
...
...
@@ -213,7 +214,7 @@ namespace dlib
);
void
set_main_font
(
const
shared_ptr
_thread_safe
<
font
>&
f
const
std
::
shared_ptr
<
font
>&
f
);
void
set_pos
(
...
...
@@ -291,7 +292,7 @@ namespace dlib
any_function
<
void
()
>
event_handler
;
any_function
<
void
(
toggle_button
&
)
>
event_handler_self
;
s
coped
_ptr
<
toggle_button_style
>
style
;
s
td
::
unique
_ptr
<
toggle_button_style
>
style
;
protected:
...
...
@@ -478,7 +479,7 @@ namespace dlib
);
void
set_main_font
(
const
shared_ptr
_thread_safe
<
font
>&
f
const
std
::
shared_ptr
<
font
>&
f
);
int
next_free_user_event_number
(
...
...
@@ -654,7 +655,7 @@ namespace dlib
any_function
<
void
()
>
enter_key_handler
;
any_function
<
void
()
>
focus_lost_handler
;
s
coped
_ptr
<
text_field_style
>
style
;
s
td
::
unique
_ptr
<
text_field_style
>
style
;
timer
<
text_field
>
t
;
...
...
@@ -866,7 +867,7 @@ namespace dlib
);
void
set_main_font
(
const
shared_ptr
_thread_safe
<
font
>&
f
const
std
::
shared_ptr
<
font
>&
f
);
int
next_free_user_event_number
(
...
...
@@ -1050,7 +1051,7 @@ namespace dlib
any_function
<
void
()
>
enter_key_handler
;
any_function
<
void
()
>
focus_lost_handler
;
s
coped
_ptr
<
text_box_style
>
style
;
s
td
::
unique
_ptr
<
text_box_style
>
style
;
timer
<
text_box
>
t
;
...
...
@@ -1262,7 +1263,7 @@ namespace dlib
);
void
set_main_font
(
const
shared_ptr
_thread_safe
<
font
>&
f
const
std
::
shared_ptr
<
font
>&
f
);
void
fit_to_contents
(
...
...
@@ -1381,7 +1382,7 @@ namespace dlib
);
void
set_main_font
(
const
shared_ptr
_thread_safe
<
font
>&
f
const
std
::
shared_ptr
<
font
>&
f
);
protected:
...
...
@@ -1440,7 +1441,7 @@ namespace dlib
);
void
set_main_font
(
const
shared_ptr
_thread_safe
<
font
>&
f
const
std
::
shared_ptr
<
font
>&
f
);
protected:
...
...
@@ -1795,7 +1796,7 @@ namespace dlib
)
const
;
void
set_main_font
(
const
shared_ptr
_thread_safe
<
font
>&
f
const
std
::
shared_ptr
<
font
>&
f
);
private:
...
...
@@ -1827,7 +1828,7 @@ namespace dlib
any_function
<
void
(
unsigned
long
)
>
single_click_event_handler
;
unsigned
long
last_selected
;
s
coped
_ptr
<
list_box_style
>
style
;
s
td
::
unique
_ptr
<
list_box_style
>
style
;
// restricted functions
list_box
(
list_box
&
);
// copy constructor
...
...
@@ -1926,7 +1927,7 @@ namespace dlib
int
cur_dir
;
any_function
<
void
(
const
std
::
string
&
)
>
event_handler
;
sequence
<
s
coped
_ptr
<
toggle_button
>
>::
kernel_2a_c
sob
;
sequence
<
s
td
::
unique
_ptr
<
toggle_button
>
>::
kernel_2a_c
sob
;
};
}
...
...
@@ -2041,7 +2042,7 @@ namespace dlib
void
set_pos
(
long
,
long
){}
void
set_main_font
(
const
shared_ptr
_thread_safe
<
font
>&
f
const
std
::
shared_ptr
<
font
>&
f
);
void
set_number_of_menus
(
...
...
dlib/image_loader/jpeg_loader.h
View file @
3a91295e
...
...
@@ -3,12 +3,12 @@
#ifndef DLIB_JPEG_IMPORT
#define DLIB_JPEG_IMPORT
#include <vector>
#include "jpeg_loader_abstract.h"
#include "../smart_pointers.h"
#include "image_loader.h"
#include "../pixel.h"
#include "../dir_nav.h"
#include <vector>
namespace
dlib
{
...
...
dlib/image_loader/png_loader.h
View file @
3a91295e
...
...
@@ -3,8 +3,9 @@
#ifndef DLIB_PNG_IMPORT
#define DLIB_PNG_IMPORT
#include <memory>
#include "png_loader_abstract.h"
#include "../smart_pointers.h"
#include "image_loader.h"
#include "../pixel.h"
#include "../dir_nav.h"
...
...
@@ -193,7 +194,7 @@ namespace dlib
unsigned
height_
,
width_
;
unsigned
bit_depth_
;
int
color_type_
;
s
coped
_ptr
<
LibpngData
>
ld_
;
s
td
::
unique
_ptr
<
LibpngData
>
ld_
;
};
// ----------------------------------------------------------------------------------------
...
...
dlib/image_processing.h
View file @
3a91295e
...
...
@@ -20,6 +20,7 @@
#include "image_processing/remove_unobtainable_rectangles.h"
#include "image_processing/scan_fhog_pyramid.h"
#include "image_processing/shape_predictor.h"
#include "image_processing/shape_predictor_trainer.h"
#include "image_processing/correlation_tracker.h"
#endif // DLIB_IMAGE_PROCESSInG_H_h_
...
...
dlib/image_processing/shape_predictor.h
View file @
3a91295e
This diff is collapsed.
Click to expand it.
dlib/image_processing/shape_predictor_abstract.h
View file @
3a91295e
...
...
@@ -25,9 +25,9 @@ namespace dlib
and eyes, tip of the nose, and so forth.
To create useful instantiations of this object you need to use the
shape_predictor_trainer object defined
below to train a shape_predictor
using a set of training images, each annotated with shapes you want to
predict.
shape_predictor_trainer object defined
in the
shape_predictor_trainer_abstract.h file to train a shape_predictor using a
set of training images, each annotated with shapes you want to
predict.
THREAD SAFETY
No synchronization is required when using this object. In particular, a
...
...
@@ -119,324 +119,6 @@ namespace dlib
provides serialization support
!*/
// ----------------------------------------------------------------------------------------
class
shape_predictor_trainer
{
/*!
WHAT THIS OBJECT REPRESENTS
This object is a tool for training shape_predictors based on annotated training
images. Its implementation uses the algorithm described in:
One Millisecond Face Alignment with an Ensemble of Regression Trees
by Vahid Kazemi and Josephine Sullivan, CVPR 2014
!*/
public:
shape_predictor_trainer
(
);
/*!
ensures
- #get_cascade_depth() == 10
- #get_tree_depth() == 4
- #get_num_trees_per_cascade_level() == 500
- #get_nu() == 0.1
- #get_oversampling_amount() == 20
- #get_feature_pool_size() == 400
- #get_lambda() == 0.1
- #get_num_test_splits() == 20
- #get_feature_pool_region_padding() == 0
- #get_random_seed() == ""
- #get_num_threads() == 0
- This object will not be verbose
!*/
unsigned
long
get_cascade_depth
(
)
const
;
/*!
ensures
- returns the number of cascades created when you train a model. This
means that the total number of trees in the learned model is equal to
get_cascade_depth()*get_num_trees_per_cascade_level().
!*/
void
set_cascade_depth
(
unsigned
long
depth
);
/*!
requires
- depth > 0
ensures
- #get_cascade_depth() == depth
!*/
unsigned
long
get_tree_depth
(
)
const
;
/*!
ensures
- returns the depth of the trees used in the cascade. In particular, there
are pow(2,get_tree_depth()) leaves in each tree.
!*/
void
set_tree_depth
(
unsigned
long
depth
);
/*!
requires
- depth > 0
ensures
- #get_tree_depth() == depth
!*/
unsigned
long
get_num_trees_per_cascade_level
(
)
const
;
/*!
ensures
- returns the number of trees created for each cascade. This means that
the total number of trees in the learned model is equal to
get_cascade_depth()*get_num_trees_per_cascade_level().
!*/
void
set_num_trees_per_cascade_level
(
unsigned
long
num
);
/*!
requires
- num > 0
ensures
- #get_num_trees_per_cascade_level() == num
!*/
double
get_nu
(
)
const
;
/*!
ensures
- returns the regularization parameter. Larger values of this parameter
will cause the algorithm to fit the training data better but may also
cause overfitting.
!*/
void
set_nu
(
double
nu
);
/*!
requires
- 0 < nu <= 1
ensures
- #get_nu() == nu
!*/
std
::
string
get_random_seed
(
)
const
;
/*!
ensures
- returns the random seed used by the internal random number generator.
Since this algorithm is a random forest style algorithm it relies on a
random number generator for generating the trees. So each setting of the
random seed will produce slightly different outputs.
!*/
void
set_random_seed
(
const
std
::
string
&
seed
);
/*!
ensures
- #get_random_seed() == seed
!*/
unsigned
long
get_oversampling_amount
(
)
const
;
/*!
ensures
- You give annotated images to this object as training examples. You
can effectively increase the amount of training data by adding in each
training example multiple times but with a randomly selected deformation
applied to it. That is what this parameter controls. That is, if you
supply N training samples to train() then the algorithm runs internally
with N*get_oversampling_amount() training samples. So the bigger this
parameter the better (excepting that larger values make training take
longer). In terms of the Kazemi paper, this parameter is the number of
randomly selected initial starting points sampled for each training
example.
!*/
void
set_oversampling_amount
(
unsigned
long
amount
);
/*!
requires
- amount > 0
ensures
- #get_oversampling_amount() == amount
!*/
unsigned
long
get_feature_pool_size
(
)
const
;
/*!
ensures
- At each level of the cascade we randomly sample get_feature_pool_size()
pixels from the image. These pixels are used to generate features for
the random trees. So in general larger settings of this parameter give
better accuracy but make the algorithm run slower.
!*/
void
set_feature_pool_size
(
unsigned
long
size
);
/*!
requires
- size > 1
ensures
- #get_feature_pool_size() == size
!*/
double
get_feature_pool_region_padding
(
)
const
;
/*!
ensures
- When we randomly sample the pixels for the feature pool we do so in a box
fit around the provided training landmarks. By default, this box is the
tightest box that contains the landmarks (i.e. this is what happens when
get_feature_pool_region_padding()==0). However, you can expand or shrink
the size of the pixel sampling region by setting a different value of
get_feature_pool_region_padding().
To explain this precisely, for a padding of 0 we say that the pixels are
sampled from a box of size 1x1. The padding value is added to each side
of the box. So a padding of 0.5 would cause the algorithm to sample
pixels from a box that was 2x2, effectively multiplying the area pixels
are sampled from by 4. Similarly, setting the padding to -0.2 would
cause it to sample from a box 0.6x0.6 in size.
!*/
void
set_feature_pool_region_padding
(
double
padding
);
/*!
ensures
- #get_feature_pool_region_padding() == padding
!*/
double
get_lambda
(
)
const
;
/*!
ensures
- To decide how to split nodes in the regression trees the algorithm looks
at pairs of pixels in the image. These pixel pairs are sampled randomly
but with a preference for selecting pixels that are near each other.
get_lambda() controls this "nearness" preference. In particular, smaller
values of get_lambda() will make the algorithm prefer to select pixels
close together and larger values of get_lambda() will make it care less
about picking nearby pixel pairs.
Note that this is the inverse of how it is defined in the Kazemi paper.
For this object, you should think of lambda as "the fraction of the
bounding box will we traverse to find a neighboring pixel". Nominally,
this is normalized between 0 and 1. So reasonable settings of lambda are
values in the range 0 < lambda < 1.
!*/
void
set_lambda
(
double
lambda
);
/*!
requires
- lambda > 0
ensures
- #get_lambda() == lambda
!*/
unsigned
long
get_num_test_splits
(
)
const
;
/*!
ensures
- When generating the random trees we randomly sample get_num_test_splits()
possible split features at each node and pick the one that gives the best
split. Larger values of this parameter will usually give more accurate
outputs but take longer to train.
!*/
void
set_num_test_splits
(
unsigned
long
num
);
/*!
requires
- num > 0
ensures
- #get_num_test_splits() == num
!*/
unsigned
long
get_num_threads
(
)
const
;
/*!
ensures
- When running training process, it is possible to make some parts of it parallel
using CPU threads with #parallel_for() extension and creating #thread_pool internally
When get_num_threads() == 0, trainer will not create threads and all processing will
be done in the calling thread
!*/
void
set_num_threads
(
unsigned
long
num
);
/*!
requires
- num >= 0
ensures
- #get_num_threads() == num
!*/
void
be_verbose
(
);
/*!
ensures
- This object will print status messages to standard out so that a
user can observe the progress of the algorithm.
!*/
void
be_quiet
(
);
/*!
ensures
- This object will not print anything to standard out
!*/
template
<
typename
image_array
>
shape_predictor
train
(
const
image_array
&
images
,
const
std
::
vector
<
std
::
vector
<
full_object_detection
>
>&
objects
)
const
;
/*!
requires
- image_array is a dlib::array of image objects where each image object
implements the interface defined in dlib/image_processing/generic_image.h
- images.size() == objects.size()
- images.size() > 0
- for some i: objects[i].size() != 0
(i.e. there has to be at least one full_object_detection in the training set)
- for all valid p, there must exist i and j such that:
objects[i][j].part(p) != OBJECT_PART_NOT_PRESENT.
(i.e. You can't define a part that is always set to OBJECT_PART_NOT_PRESENT.)
- for all valid i,j,k,l:
- objects[i][j].num_parts() == objects[k][l].num_parts()
(i.e. all objects must agree on the number of parts)
- objects[i][j].num_parts() > 0
ensures
- This object will try to learn to predict the locations of an object's parts
based on the object bounding box (i.e. full_object_detection::get_rect())
and the image pixels in that box. That is, we will try to learn a
shape_predictor, SP, such that:
SP(images[i], objects[i][j].get_rect()) == objects[i][j]
This learned SP object is then returned.
- Not all parts are required to be observed for all objects. So if you
have training instances with missing parts then set the part positions
equal to OBJECT_PART_NOT_PRESENT and this algorithm will basically ignore
those missing parts.
!*/
};
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
...
dlib/image_processing/shape_predictor_trainer.h
0 → 100644
View file @
3a91295e
This diff is collapsed.
Click to expand it.
dlib/image_processing/shape_predictor_trainer_abstract.h
0 → 100644
View file @
3a91295e
// Copyright (C) 2014 Davis E. King (davis@dlib.net)
// License: Boost Software License See LICENSE.txt for the full license.
#undef DLIB_SHAPE_PREDICToR_TRAINER_ABSTRACT_H_
#ifdef DLIB_SHAPE_PREDICToR_TRAINER_ABSTRACT_H_
#include "shape_predictor_abstract.h"
namespace
dlib
{
// ----------------------------------------------------------------------------------------
class
shape_predictor_trainer
{
/*!
WHAT THIS OBJECT REPRESENTS
This object is a tool for training shape_predictors based on annotated training
images. Its implementation uses the algorithm described in:
One Millisecond Face Alignment with an Ensemble of Regression Trees
by Vahid Kazemi and Josephine Sullivan, CVPR 2014
!*/
public:
shape_predictor_trainer
(
);
/*!
ensures
- #get_cascade_depth() == 10
- #get_tree_depth() == 4
- #get_num_trees_per_cascade_level() == 500
- #get_nu() == 0.1
- #get_oversampling_amount() == 20
- #get_feature_pool_size() == 400
- #get_lambda() == 0.1
- #get_num_test_splits() == 20
- #get_feature_pool_region_padding() == 0
- #get_random_seed() == ""
- #get_num_threads() == 0
- This object will not be verbose
!*/
unsigned
long
get_cascade_depth
(
)
const
;
/*!
ensures
- returns the number of cascades created when you train a model. This
means that the total number of trees in the learned model is equal to
get_cascade_depth()*get_num_trees_per_cascade_level().
!*/
void
set_cascade_depth
(
unsigned
long
depth
);
/*!
requires
- depth > 0
ensures
- #get_cascade_depth() == depth
!*/
unsigned
long
get_tree_depth
(
)
const
;
/*!
ensures
- returns the depth of the trees used in the cascade. In particular, there
are pow(2,get_tree_depth()) leaves in each tree.
!*/
void
set_tree_depth
(
unsigned
long
depth
);
/*!
requires
- depth > 0
ensures
- #get_tree_depth() == depth
!*/
unsigned
long
get_num_trees_per_cascade_level
(
)
const
;
/*!
ensures
- returns the number of trees created for each cascade. This means that
the total number of trees in the learned model is equal to
get_cascade_depth()*get_num_trees_per_cascade_level().
!*/
void
set_num_trees_per_cascade_level
(
unsigned
long
num
);
/*!
requires
- num > 0
ensures
- #get_num_trees_per_cascade_level() == num
!*/
double
get_nu
(
)
const
;
/*!
ensures
- returns the regularization parameter. Larger values of this parameter
will cause the algorithm to fit the training data better but may also
cause overfitting.
!*/
void
set_nu
(
double
nu
);
/*!
requires
- 0 < nu <= 1
ensures
- #get_nu() == nu
!*/
std
::
string
get_random_seed
(
)
const
;
/*!
ensures
- returns the random seed used by the internal random number generator.
Since this algorithm is a random forest style algorithm it relies on a
random number generator for generating the trees. So each setting of the
random seed will produce slightly different outputs.
!*/
void
set_random_seed
(
const
std
::
string
&
seed
);
/*!
ensures
- #get_random_seed() == seed
!*/
unsigned
long
get_oversampling_amount
(
)
const
;
/*!
ensures
- You give annotated images to this object as training examples. You
can effectively increase the amount of training data by adding in each
training example multiple times but with a randomly selected deformation
applied to it. That is what this parameter controls. That is, if you
supply N training samples to train() then the algorithm runs internally
with N*get_oversampling_amount() training samples. So the bigger this
parameter the better (excepting that larger values make training take
longer). In terms of the Kazemi paper, this parameter is the number of
randomly selected initial starting points sampled for each training
example.
!*/
void
set_oversampling_amount
(
unsigned
long
amount
);
/*!
requires
- amount > 0
ensures
- #get_oversampling_amount() == amount
!*/
unsigned
long
get_feature_pool_size
(
)
const
;
/*!
ensures
- At each level of the cascade we randomly sample get_feature_pool_size()
pixels from the image. These pixels are used to generate features for
the random trees. So in general larger settings of this parameter give
better accuracy but make the algorithm run slower.
!*/
void
set_feature_pool_size
(
unsigned
long
size
);
/*!
requires
- size > 1
ensures
- #get_feature_pool_size() == size
!*/
double
get_feature_pool_region_padding
(
)
const
;
/*!
ensures
- When we randomly sample the pixels for the feature pool we do so in a box
fit around the provided training landmarks. By default, this box is the
tightest box that contains the landmarks (i.e. this is what happens when
get_feature_pool_region_padding()==0). However, you can expand or shrink
the size of the pixel sampling region by setting a different value of
get_feature_pool_region_padding().
To explain this precisely, for a padding of 0 we say that the pixels are
sampled from a box of size 1x1. The padding value is added to each side
of the box. So a padding of 0.5 would cause the algorithm to sample
pixels from a box that was 2x2, effectively multiplying the area pixels
are sampled from by 4. Similarly, setting the padding to -0.2 would
cause it to sample from a box 0.6x0.6 in size.
!*/
void
set_feature_pool_region_padding
(
double
padding
);
/*!
ensures
- #get_feature_pool_region_padding() == padding
!*/
double
get_lambda
(
)
const
;
/*!
ensures
- To decide how to split nodes in the regression trees the algorithm looks
at pairs of pixels in the image. These pixel pairs are sampled randomly
but with a preference for selecting pixels that are near each other.
get_lambda() controls this "nearness" preference. In particular, smaller
values of get_lambda() will make the algorithm prefer to select pixels
close together and larger values of get_lambda() will make it care less
about picking nearby pixel pairs.
Note that this is the inverse of how it is defined in the Kazemi paper.
For this object, you should think of lambda as "the fraction of the
bounding box will we traverse to find a neighboring pixel". Nominally,
this is normalized between 0 and 1. So reasonable settings of lambda are
values in the range 0 < lambda < 1.
!*/
void
set_lambda
(
double
lambda
);
/*!
requires
- lambda > 0
ensures
- #get_lambda() == lambda
!*/
unsigned
long
get_num_test_splits
(
)
const
;
/*!
ensures
- When generating the random trees we randomly sample get_num_test_splits()
possible split features at each node and pick the one that gives the best
split. Larger values of this parameter will usually give more accurate
outputs but take longer to train.
!*/
void
set_num_test_splits
(
unsigned
long
num
);
/*!
requires
- num > 0
ensures
- #get_num_test_splits() == num
!*/
unsigned
long
get_num_threads
(
)
const
;
/*!
ensures
- When running training process, it is possible to make some parts of it parallel
using CPU threads with #parallel_for() extension and creating #thread_pool internally
When get_num_threads() == 0, trainer will not create threads and all processing will
be done in the calling thread
!*/
void
set_num_threads
(
unsigned
long
num
);
/*!
requires
- num >= 0
ensures
- #get_num_threads() == num
!*/
void
be_verbose
(
);
/*!
ensures
- This object will print status messages to standard out so that a
user can observe the progress of the algorithm.
!*/
void
be_quiet
(
);
/*!
ensures
- This object will not print anything to standard out
!*/
template
<
typename
image_array
>
shape_predictor
train
(
const
image_array
&
images
,
const
std
::
vector
<
std
::
vector
<
full_object_detection
>
>&
objects
)
const
;
/*!
requires
- image_array is a dlib::array of image objects where each image object
implements the interface defined in dlib/image_processing/generic_image.h
- images.size() == objects.size()
- images.size() > 0
- for some i: objects[i].size() != 0
(i.e. there has to be at least one full_object_detection in the training set)
- for all valid p, there must exist i and j such that:
objects[i][j].part(p) != OBJECT_PART_NOT_PRESENT.
(i.e. You can't define a part that is always set to OBJECT_PART_NOT_PRESENT.)
- for all valid i,j,k,l:
- objects[i][j].num_parts() == objects[k][l].num_parts()
(i.e. all objects must agree on the number of parts)
- objects[i][j].num_parts() > 0
ensures
- This object will try to learn to predict the locations of an object's parts
based on the object bounding box (i.e. full_object_detection::get_rect())
and the image pixels in that box. That is, we will try to learn a
shape_predictor, SP, such that:
SP(images[i], objects[i][j].get_rect()) == objects[i][j]
This learned SP object is then returned.
- Not all parts are required to be observed for all objects. So if you
have training instances with missing parts then set the part positions
equal to OBJECT_PART_NOT_PRESENT and this algorithm will basically ignore
those missing parts.
!*/
};
// ----------------------------------------------------------------------------------------
}
#endif // DLIB_SHAPE_PREDICToR_TRAINER_ABSTRACT_H_
dlib/iosockstream/iosockstream.h
View file @
3a91295e
...
...
@@ -6,8 +6,9 @@
#include "iosockstream_abstract.h"
#include <iostream>
#include <memory>
#include "../sockstreambuf.h"
#include "../smart_pointers_thread_safe.h"
#include "../timeout.h"
#ifdef _MSC_VER
...
...
@@ -147,16 +148,16 @@ namespace dlib
private:
void
terminate_connection
(
shared_ptr
_thread_safe
<
connection
>
thecon
std
::
shared_ptr
<
connection
>
thecon
)
{
thecon
->
shutdown
();
}
s
coped
_ptr
<
timeout
>
con_timeout
;
s
td
::
unique
_ptr
<
timeout
>
con_timeout
;
rmutex
class_mutex
;
shared_ptr
_thread_safe
<
connection
>
con
;
s
coped
_ptr
<
sockstreambuf
>
buf
;
std
::
shared_ptr
<
connection
>
con
;
s
td
::
unique
_ptr
<
sockstreambuf
>
buf
;
};
...
...
dlib/logger/logger_kernel_1.cpp
View file @
3a91295e
...
...
@@ -202,7 +202,7 @@ namespace dlib
}
else
{
s
coped
_ptr
<
T
>
temp
(
new
T
);
s
td
::
unique
_ptr
<
T
>
temp
(
new
T
);
temp
->
val
=
c
.
val
;
assign_tables
(
*
temp
,
last
,
val
);
c
.
table
.
add
(
first
,
temp
);
...
...
dlib/logger/logger_kernel_1.h
View file @
3a91295e
...
...
@@ -3,20 +3,21 @@
#ifndef DLIB_LOGGER_KERNEl_1_
#define DLIB_LOGGER_KERNEl_1_
#include <limits>
#include <memory>
#include <cstring>
#include <streambuf>
#include <vector>
#include "../threads.h"
#include "../misc_api.h"
#include "../set.h"
#include "logger_kernel_abstract.h"
#include <limits>
#include <cstring>
#include "../algs.h"
#include "../assert.h"
#include "../uintn.h"
#include "../map.h"
#include "../smart_pointers.h"
#include "../member_function_pointer.h"
#include <streambuf>
#include <vector>
namespace
dlib
{
...
...
@@ -445,7 +446,7 @@ namespace dlib
level_container
();
log_level
val
;
map
<
std
::
string
,
s
coped
_ptr
<
level_container
>
>::
kernel_1b_c
table
;
map
<
std
::
string
,
s
td
::
unique
_ptr
<
level_container
>
>::
kernel_1b_c
table
;
}
level_table
;
const
log_level
level
(
...
...
@@ -473,7 +474,7 @@ namespace dlib
struct
auto_flush_container
{
bool
val
;
map
<
std
::
string
,
s
coped
_ptr
<
auto_flush_container
>
>::
kernel_1b_c
table
;
map
<
std
::
string
,
s
td
::
unique
_ptr
<
auto_flush_container
>
>::
kernel_1b_c
table
;
}
auto_flush_table
;
bool
auto_flush
(
...
...
@@ -501,7 +502,7 @@ namespace dlib
struct
output_streambuf_container
{
std
::
streambuf
*
val
;
map
<
std
::
string
,
s
coped
_ptr
<
output_streambuf_container
>
>::
kernel_1b_c
table
;
map
<
std
::
string
,
s
td
::
unique
_ptr
<
output_streambuf_container
>
>::
kernel_1b_c
table
;
}
streambuf_table
;
std
::
streambuf
*
output_streambuf
(
...
...
@@ -542,7 +543,7 @@ namespace dlib
struct
output_hook_container
{
hook_mfp
val
;
map
<
std
::
string
,
s
coped
_ptr
<
output_hook_container
>
>::
kernel_1b_c
table
;
map
<
std
::
string
,
s
td
::
unique
_ptr
<
output_hook_container
>
>::
kernel_1b_c
table
;
}
hook_table
;
hook_mfp
output_hook
(
...
...
@@ -570,7 +571,7 @@ namespace dlib
struct
logger_header_container
{
print_header_type
val
;
map
<
std
::
string
,
s
coped
_ptr
<
logger_header_container
>
>::
kernel_1b_c
table
;
map
<
std
::
string
,
s
td
::
unique
_ptr
<
logger_header_container
>
>::
kernel_1b_c
table
;
}
header_table
;
print_header_type
logger_header
(
...
...
dlib/matrix/lapack/gees.h
View file @
3a91295e
...
...
@@ -42,12 +42,12 @@ namespace dlib
integer
info
=
0
;
char
sort
=
'N'
;
L_fp
fnil
=
0
;
logical
nil
=
0
;
logical
bwork
=
0
;
integer
sdim
=
0
;
DLIB_FORTRAN_ID
(
dgees
)(
&
jobvs
,
&
sort
,
fnil
,
&
n
,
a
,
&
lda
,
&
sdim
,
wr
,
wi
,
vs
,
&
ldvs
,
work
,
&
lwork
,
&
nil
,
&
info
);
&
lwork
,
&
bwork
,
&
info
);
return
info
;
}
...
...
@@ -61,12 +61,12 @@ namespace dlib
integer
info
=
0
;
char
sort
=
'N'
;
L_fp
fnil
=
0
;
logical
nil
=
0
;
logical
bwork
=
0
;
integer
sdim
=
0
;
DLIB_FORTRAN_ID
(
sgees
)(
&
jobvs
,
&
sort
,
fnil
,
&
n
,
a
,
&
lda
,
&
sdim
,
wr
,
wi
,
vs
,
&
ldvs
,
work
,
&
lwork
,
&
nil
,
&
info
);
&
lwork
,
&
bwork
,
&
info
);
return
info
;
}
...
...
dlib/matrix/matrix_blas_bindings.h
View file @
3a91295e
...
...
@@ -63,56 +63,56 @@ namespace dlib
void
cblas_cscal
(
const
int
N
,
const
void
*
alpha
,
void
*
X
,
const
int
incX
);
void
cblas_zscal
(
const
int
N
,
const
void
*
alpha
,
void
*
X
,
const
int
incX
);
void
cblas_sgemm
(
const
enum
CBLAS_ORDER
Order
,
const
enum
CBLAS_TRANSPOSE
TransA
,
const
enum
CBLAS_TRANSPOSE
TransB
,
const
int
M
,
const
int
N
,
void
cblas_sgemm
(
const
CBLAS_ORDER
Order
,
const
CBLAS_TRANSPOSE
TransA
,
const
CBLAS_TRANSPOSE
TransB
,
const
int
M
,
const
int
N
,
const
int
K
,
const
float
alpha
,
const
float
*
A
,
const
int
lda
,
const
float
*
B
,
const
int
ldb
,
const
float
beta
,
float
*
C
,
const
int
ldc
);
void
cblas_dgemm
(
const
enum
CBLAS_ORDER
Order
,
const
enum
CBLAS_TRANSPOSE
TransA
,
const
enum
CBLAS_TRANSPOSE
TransB
,
const
int
M
,
const
int
N
,
void
cblas_dgemm
(
const
CBLAS_ORDER
Order
,
const
CBLAS_TRANSPOSE
TransA
,
const
CBLAS_TRANSPOSE
TransB
,
const
int
M
,
const
int
N
,
const
int
K
,
const
double
alpha
,
const
double
*
A
,
const
int
lda
,
const
double
*
B
,
const
int
ldb
,
const
double
beta
,
double
*
C
,
const
int
ldc
);
void
cblas_cgemm
(
const
enum
CBLAS_ORDER
Order
,
const
enum
CBLAS_TRANSPOSE
TransA
,
const
enum
CBLAS_TRANSPOSE
TransB
,
const
int
M
,
const
int
N
,
void
cblas_cgemm
(
const
CBLAS_ORDER
Order
,
const
CBLAS_TRANSPOSE
TransA
,
const
CBLAS_TRANSPOSE
TransB
,
const
int
M
,
const
int
N
,
const
int
K
,
const
void
*
alpha
,
const
void
*
A
,
const
int
lda
,
const
void
*
B
,
const
int
ldb
,
const
void
*
beta
,
void
*
C
,
const
int
ldc
);
void
cblas_zgemm
(
const
enum
CBLAS_ORDER
Order
,
const
enum
CBLAS_TRANSPOSE
TransA
,
const
enum
CBLAS_TRANSPOSE
TransB
,
const
int
M
,
const
int
N
,
void
cblas_zgemm
(
const
CBLAS_ORDER
Order
,
const
CBLAS_TRANSPOSE
TransA
,
const
CBLAS_TRANSPOSE
TransB
,
const
int
M
,
const
int
N
,
const
int
K
,
const
void
*
alpha
,
const
void
*
A
,
const
int
lda
,
const
void
*
B
,
const
int
ldb
,
const
void
*
beta
,
void
*
C
,
const
int
ldc
);
void
cblas_sgemv
(
const
enum
CBLAS_ORDER
order
,
const
enum
CBLAS_TRANSPOSE
TransA
,
const
int
M
,
const
int
N
,
void
cblas_sgemv
(
const
CBLAS_ORDER
order
,
const
CBLAS_TRANSPOSE
TransA
,
const
int
M
,
const
int
N
,
const
float
alpha
,
const
float
*
A
,
const
int
lda
,
const
float
*
X
,
const
int
incX
,
const
float
beta
,
float
*
Y
,
const
int
incY
);
void
cblas_dgemv
(
const
enum
CBLAS_ORDER
order
,
const
enum
CBLAS_TRANSPOSE
TransA
,
const
int
M
,
const
int
N
,
void
cblas_dgemv
(
const
CBLAS_ORDER
order
,
const
CBLAS_TRANSPOSE
TransA
,
const
int
M
,
const
int
N
,
const
double
alpha
,
const
double
*
A
,
const
int
lda
,
const
double
*
X
,
const
int
incX
,
const
double
beta
,
double
*
Y
,
const
int
incY
);
void
cblas_cgemv
(
const
enum
CBLAS_ORDER
order
,
const
enum
CBLAS_TRANSPOSE
TransA
,
const
int
M
,
const
int
N
,
void
cblas_cgemv
(
const
CBLAS_ORDER
order
,
const
CBLAS_TRANSPOSE
TransA
,
const
int
M
,
const
int
N
,
const
void
*
alpha
,
const
void
*
A
,
const
int
lda
,
const
void
*
X
,
const
int
incX
,
const
void
*
beta
,
void
*
Y
,
const
int
incY
);
void
cblas_zgemv
(
const
enum
CBLAS_ORDER
order
,
const
enum
CBLAS_TRANSPOSE
TransA
,
const
int
M
,
const
int
N
,
void
cblas_zgemv
(
const
CBLAS_ORDER
order
,
const
CBLAS_TRANSPOSE
TransA
,
const
int
M
,
const
int
N
,
const
void
*
alpha
,
const
void
*
A
,
const
int
lda
,
const
void
*
X
,
const
int
incX
,
const
void
*
beta
,
void
*
Y
,
const
int
incY
);
void
cblas_sger
(
const
enum
CBLAS_ORDER
order
,
const
int
M
,
const
int
N
,
void
cblas_sger
(
const
CBLAS_ORDER
order
,
const
int
M
,
const
int
N
,
const
float
alpha
,
const
float
*
X
,
const
int
incX
,
const
float
*
Y
,
const
int
incY
,
float
*
A
,
const
int
lda
);
void
cblas_dger
(
const
enum
CBLAS_ORDER
order
,
const
int
M
,
const
int
N
,
void
cblas_dger
(
const
CBLAS_ORDER
order
,
const
int
M
,
const
int
N
,
const
double
alpha
,
const
double
*
X
,
const
int
incX
,
const
double
*
Y
,
const
int
incY
,
double
*
A
,
const
int
lda
);
void
cblas_cgerc
(
const
enum
CBLAS_ORDER
order
,
const
int
M
,
const
int
N
,
void
cblas_cgerc
(
const
CBLAS_ORDER
order
,
const
int
M
,
const
int
N
,
const
void
*
alpha
,
const
void
*
X
,
const
int
incX
,
const
void
*
Y
,
const
int
incY
,
void
*
A
,
const
int
lda
);
void
cblas_zgerc
(
const
enum
CBLAS_ORDER
order
,
const
int
M
,
const
int
N
,
void
cblas_zgerc
(
const
CBLAS_ORDER
order
,
const
int
M
,
const
int
N
,
const
void
*
alpha
,
const
void
*
X
,
const
int
incX
,
const
void
*
Y
,
const
int
incY
,
void
*
A
,
const
int
lda
);
float
cblas_sdot
(
const
int
N
,
const
float
*
X
,
const
int
incX
,
...
...
@@ -127,10 +127,10 @@ namespace dlib
const
void
*
Y
,
const
int
incY
,
void
*
dotc
);
void
cblas_zdotc_sub
(
const
int
N
,
const
void
*
X
,
const
int
incX
,
const
void
*
Y
,
const
int
incY
,
void
*
dotc
);
void
cblas_cgeru
(
const
enum
CBLAS_ORDER
order
,
const
int
M
,
const
int
N
,
void
cblas_cgeru
(
const
CBLAS_ORDER
order
,
const
int
M
,
const
int
N
,
const
void
*
alpha
,
const
void
*
X
,
const
int
incX
,
const
void
*
Y
,
const
int
incY
,
void
*
A
,
const
int
lda
);
void
cblas_zgeru
(
const
enum
CBLAS_ORDER
order
,
const
int
M
,
const
int
N
,
void
cblas_zgeru
(
const
CBLAS_ORDER
order
,
const
int
M
,
const
int
N
,
const
void
*
alpha
,
const
void
*
X
,
const
int
incX
,
const
void
*
Y
,
const
int
incY
,
void
*
A
,
const
int
lda
);
}
...
...
@@ -195,8 +195,8 @@ namespace dlib
// ----------------------------------------------------------------------------------------
inline
void
cblas_gemm
(
const
enum
CBLAS_ORDER
Order
,
const
enum
CBLAS_TRANSPOSE
TransA
,
const
enum
CBLAS_TRANSPOSE
TransB
,
const
int
M
,
const
int
N
,
inline
void
cblas_gemm
(
const
CBLAS_ORDER
Order
,
const
CBLAS_TRANSPOSE
TransA
,
const
CBLAS_TRANSPOSE
TransB
,
const
int
M
,
const
int
N
,
const
int
K
,
const
float
alpha
,
const
float
*
A
,
const
int
lda
,
const
float
*
B
,
const
int
ldb
,
const
float
beta
,
float
*
C
,
const
int
ldc
)
...
...
@@ -206,8 +206,8 @@ namespace dlib
K
,
alpha
,
A
,
lda
,
B
,
ldb
,
beta
,
C
,
ldc
);
}
inline
void
cblas_gemm
(
const
enum
CBLAS_ORDER
Order
,
const
enum
CBLAS_TRANSPOSE
TransA
,
const
enum
CBLAS_TRANSPOSE
TransB
,
const
int
M
,
const
int
N
,
inline
void
cblas_gemm
(
const
CBLAS_ORDER
Order
,
const
CBLAS_TRANSPOSE
TransA
,
const
CBLAS_TRANSPOSE
TransB
,
const
int
M
,
const
int
N
,
const
int
K
,
const
double
alpha
,
const
double
*
A
,
const
int
lda
,
const
double
*
B
,
const
int
ldb
,
const
double
beta
,
double
*
C
,
const
int
ldc
)
...
...
@@ -217,8 +217,8 @@ namespace dlib
K
,
alpha
,
A
,
lda
,
B
,
ldb
,
beta
,
C
,
ldc
);
}
inline
void
cblas_gemm
(
const
enum
CBLAS_ORDER
Order
,
const
enum
CBLAS_TRANSPOSE
TransA
,
const
enum
CBLAS_TRANSPOSE
TransB
,
const
int
M
,
const
int
N
,
inline
void
cblas_gemm
(
const
CBLAS_ORDER
Order
,
const
CBLAS_TRANSPOSE
TransA
,
const
CBLAS_TRANSPOSE
TransB
,
const
int
M
,
const
int
N
,
const
int
K
,
const
std
::
complex
<
float
>&
alpha
,
const
std
::
complex
<
float
>
*
A
,
const
int
lda
,
const
std
::
complex
<
float
>
*
B
,
const
int
ldb
,
const
std
::
complex
<
float
>&
beta
,
std
::
complex
<
float
>
*
C
,
const
int
ldc
)
...
...
@@ -228,8 +228,8 @@ namespace dlib
K
,
&
alpha
,
A
,
lda
,
B
,
ldb
,
&
beta
,
C
,
ldc
);
}
inline
void
cblas_gemm
(
const
enum
CBLAS_ORDER
Order
,
const
enum
CBLAS_TRANSPOSE
TransA
,
const
enum
CBLAS_TRANSPOSE
TransB
,
const
int
M
,
const
int
N
,
inline
void
cblas_gemm
(
const
CBLAS_ORDER
Order
,
const
CBLAS_TRANSPOSE
TransA
,
const
CBLAS_TRANSPOSE
TransB
,
const
int
M
,
const
int
N
,
const
int
K
,
const
std
::
complex
<
double
>&
alpha
,
const
std
::
complex
<
double
>
*
A
,
const
int
lda
,
const
std
::
complex
<
double
>
*
B
,
const
int
ldb
,
const
std
::
complex
<
double
>&
beta
,
std
::
complex
<
double
>
*
C
,
const
int
ldc
)
...
...
@@ -241,8 +241,8 @@ namespace dlib
// ----------------------------------------------------------------------------------------
inline
void
cblas_gemv
(
const
enum
CBLAS_ORDER
order
,
const
enum
CBLAS_TRANSPOSE
TransA
,
const
int
M
,
const
int
N
,
inline
void
cblas_gemv
(
const
CBLAS_ORDER
order
,
const
CBLAS_TRANSPOSE
TransA
,
const
int
M
,
const
int
N
,
const
float
alpha
,
const
float
*
A
,
const
int
lda
,
const
float
*
X
,
const
int
incX
,
const
float
beta
,
float
*
Y
,
const
int
incY
)
...
...
@@ -251,8 +251,8 @@ namespace dlib
cblas_sgemv
(
order
,
TransA
,
M
,
N
,
alpha
,
A
,
lda
,
X
,
incX
,
beta
,
Y
,
incY
);
}
inline
void
cblas_gemv
(
const
enum
CBLAS_ORDER
order
,
const
enum
CBLAS_TRANSPOSE
TransA
,
const
int
M
,
const
int
N
,
inline
void
cblas_gemv
(
const
CBLAS_ORDER
order
,
const
CBLAS_TRANSPOSE
TransA
,
const
int
M
,
const
int
N
,
const
double
alpha
,
const
double
*
A
,
const
int
lda
,
const
double
*
X
,
const
int
incX
,
const
double
beta
,
double
*
Y
,
const
int
incY
)
...
...
@@ -261,8 +261,8 @@ namespace dlib
cblas_dgemv
(
order
,
TransA
,
M
,
N
,
alpha
,
A
,
lda
,
X
,
incX
,
beta
,
Y
,
incY
);
}
inline
void
cblas_gemv
(
const
enum
CBLAS_ORDER
order
,
const
enum
CBLAS_TRANSPOSE
TransA
,
const
int
M
,
const
int
N
,
inline
void
cblas_gemv
(
const
CBLAS_ORDER
order
,
const
CBLAS_TRANSPOSE
TransA
,
const
int
M
,
const
int
N
,
const
std
::
complex
<
float
>&
alpha
,
const
std
::
complex
<
float
>
*
A
,
const
int
lda
,
const
std
::
complex
<
float
>
*
X
,
const
int
incX
,
const
std
::
complex
<
float
>&
beta
,
std
::
complex
<
float
>
*
Y
,
const
int
incY
)
...
...
@@ -271,8 +271,8 @@ namespace dlib
cblas_cgemv
(
order
,
TransA
,
M
,
N
,
&
alpha
,
A
,
lda
,
X
,
incX
,
&
beta
,
Y
,
incY
);
}
inline
void
cblas_gemv
(
const
enum
CBLAS_ORDER
order
,
const
enum
CBLAS_TRANSPOSE
TransA
,
const
int
M
,
const
int
N
,
inline
void
cblas_gemv
(
const
CBLAS_ORDER
order
,
const
CBLAS_TRANSPOSE
TransA
,
const
int
M
,
const
int
N
,
const
std
::
complex
<
double
>&
alpha
,
const
std
::
complex
<
double
>
*
A
,
const
int
lda
,
const
std
::
complex
<
double
>
*
X
,
const
int
incX
,
const
std
::
complex
<
double
>&
beta
,
std
::
complex
<
double
>
*
Y
,
const
int
incY
)
...
...
@@ -283,7 +283,7 @@ namespace dlib
// ----------------------------------------------------------------------------------------
inline
void
cblas_ger
(
const
enum
CBLAS_ORDER
order
,
const
int
M
,
const
int
N
,
inline
void
cblas_ger
(
const
CBLAS_ORDER
order
,
const
int
M
,
const
int
N
,
const
std
::
complex
<
float
>&
alpha
,
const
std
::
complex
<
float
>
*
X
,
const
int
incX
,
const
std
::
complex
<
float
>
*
Y
,
const
int
incY
,
std
::
complex
<
float
>
*
A
,
const
int
lda
)
{
...
...
@@ -291,7 +291,7 @@ namespace dlib
cblas_cgeru
(
order
,
M
,
N
,
&
alpha
,
X
,
incX
,
Y
,
incY
,
A
,
lda
);
}
inline
void
cblas_ger
(
const
enum
CBLAS_ORDER
order
,
const
int
M
,
const
int
N
,
inline
void
cblas_ger
(
const
CBLAS_ORDER
order
,
const
int
M
,
const
int
N
,
const
std
::
complex
<
double
>&
alpha
,
const
std
::
complex
<
double
>
*
X
,
const
int
incX
,
const
std
::
complex
<
double
>
*
Y
,
const
int
incY
,
std
::
complex
<
double
>
*
A
,
const
int
lda
)
{
...
...
@@ -299,7 +299,7 @@ namespace dlib
cblas_zgeru
(
order
,
M
,
N
,
&
alpha
,
X
,
incX
,
Y
,
incY
,
A
,
lda
);
}
inline
void
cblas_ger
(
const
enum
CBLAS_ORDER
order
,
const
int
M
,
const
int
N
,
inline
void
cblas_ger
(
const
CBLAS_ORDER
order
,
const
int
M
,
const
int
N
,
const
float
alpha
,
const
float
*
X
,
const
int
incX
,
const
float
*
Y
,
const
int
incY
,
float
*
A
,
const
int
lda
)
{
...
...
@@ -307,7 +307,7 @@ namespace dlib
cblas_sger
(
order
,
M
,
N
,
alpha
,
X
,
incX
,
Y
,
incY
,
A
,
lda
);
}
inline
void
cblas_ger
(
const
enum
CBLAS_ORDER
order
,
const
int
M
,
const
int
N
,
inline
void
cblas_ger
(
const
CBLAS_ORDER
order
,
const
int
M
,
const
int
N
,
const
double
alpha
,
const
double
*
X
,
const
int
incX
,
const
double
*
Y
,
const
int
incY
,
double
*
A
,
const
int
lda
)
{
...
...
@@ -317,7 +317,7 @@ namespace dlib
// ----------------------------------------------------------------------------------------
inline
void
cblas_gerc
(
const
enum
CBLAS_ORDER
order
,
const
int
M
,
const
int
N
,
inline
void
cblas_gerc
(
const
CBLAS_ORDER
order
,
const
int
M
,
const
int
N
,
const
std
::
complex
<
float
>&
alpha
,
const
std
::
complex
<
float
>
*
X
,
const
int
incX
,
const
std
::
complex
<
float
>
*
Y
,
const
int
incY
,
std
::
complex
<
float
>
*
A
,
const
int
lda
)
{
...
...
@@ -325,7 +325,7 @@ namespace dlib
cblas_cgerc
(
order
,
M
,
N
,
&
alpha
,
X
,
incX
,
Y
,
incY
,
A
,
lda
);
}
inline
void
cblas_gerc
(
const
enum
CBLAS_ORDER
order
,
const
int
M
,
const
int
N
,
inline
void
cblas_gerc
(
const
CBLAS_ORDER
order
,
const
int
M
,
const
int
N
,
const
std
::
complex
<
double
>&
alpha
,
const
std
::
complex
<
double
>
*
X
,
const
int
incX
,
const
std
::
complex
<
double
>
*
Y
,
const
int
incY
,
std
::
complex
<
double
>
*
A
,
const
int
lda
)
{
...
...
dlib/matrix/matrix_trsm.h
View file @
3a91295e
This diff is collapsed.
Click to expand it.
Prev
1
2
3
4
5
6
7
Next
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