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
9ba7889f
Commit
9ba7889f
authored
Aug 23, 2017
by
Davis King
Browse files
Options
Browse Files
Download
Plain Diff
merged
parents
a94aa00e
c3fa856c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
16 additions
and
14 deletions
+16
-14
add_python_module
dlib/cmake_utils/add_python_module
+4
-0
tensor.h
dlib/dnn/tensor.h
+1
-1
numpy.h
dlib/python/numpy.h
+1
-1
serialize_pickle.h
dlib/python/serialize_pickle.h
+3
-3
simd8i.h
dlib/simd/simd8i.h
+1
-1
smart_pointers.h
dlib/smart_pointers.h
+4
-6
WINDOWS_build_and_run_all_unit_tests.bat
dlib/test/WINDOWS_build_and_run_all_unit_tests.bat
+2
-2
No files found.
dlib/cmake_utils/add_python_module
View file @
9ba7889f
...
...
@@ -126,6 +126,9 @@ else()
endif()
message(STATUS "USING BOOST_LIBS: ${Boost_LIBRARIES}")
if (WIN32)
message(STATUS "USING PYTHON_LIBS: ${PYTHON_LIBRARIES}")
endif()
if (CMAKE_COMPILER_IS_GNUCXX)
# Just setting CMAKE_POSITION_INDEPENDENT_CODE should be enough to set
...
...
@@ -150,6 +153,7 @@ macro(add_python_module module_name module_sources )
TARGET_LINK_LIBRARIES(${module_name}_ ${Boost_LIBRARIES} dlib::dlib)
if(WIN32 AND NOT CYGWIN)
TARGET_LINK_LIBRARIES(${module_name}_ ${PYTHON_LIBRARIES})
SET_TARGET_PROPERTIES( ${module_name}_
PROPERTIES
PREFIX ""
...
...
dlib/dnn/tensor.h
View file @
9ba7889f
...
...
@@ -168,7 +168,7 @@ namespace dlib
const
matrix_exp
<
EXP
>&
item
)
{
DLIB_CASSERT
(
idx
<
num_samples
());
DLIB_CASSERT
(
idx
<
(
unsigned
long
)
num_samples
());
DLIB_CASSERT
(
item
.
size
()
==
nr
()
*
nc
()
*
k
());
static_assert
((
is_same_type
<
float
,
typename
EXP
::
type
>::
value
==
true
),
"To assign a matrix to a tensor the matrix must contain float values"
);
...
...
dlib/python/numpy.h
View file @
9ba7889f
...
...
@@ -18,7 +18,7 @@ void validate_numpy_array_type (
)
{
using
namespace
boost
::
python
;
const
char
ch
=
extract
<
char
>
(
obj
.
attr
(
"dtype"
).
attr
(
"char"
));
const
char
ch
=
boost
::
python
::
extract
<
char
>
(
obj
.
attr
(
"dtype"
).
attr
(
"char"
));
if
(
dlib
::
is_same_type
<
T
,
double
>::
value
&&
ch
!=
'd'
)
throw
dlib
::
error
(
"Expected numpy.ndarray of float64"
);
...
...
dlib/python/serialize_pickle.h
View file @
9ba7889f
...
...
@@ -45,10 +45,10 @@ struct serialize_pickle : boost::python::pickle_suite
// UTF-8 encodings. So instead we access the python C interface directly and use
// bytes objects. However, we keep the deserialization code that worked with str
// for backwards compatibility with previously pickled files.
if
(
extract
<
str
>
(
state
[
0
]).
check
())
if
(
boost
::
python
::
extract
<
str
>
(
state
[
0
]).
check
())
{
str
data
=
extract
<
str
>
(
state
[
0
]);
std
::
string
temp
(
extract
<
const
char
*>
(
data
),
len
(
data
));
str
data
=
boost
::
python
::
extract
<
str
>
(
state
[
0
]);
std
::
string
temp
(
boost
::
python
::
extract
<
const
char
*>
(
data
),
len
(
data
));
std
::
istringstream
sin
(
temp
);
deserialize
(
item
,
sin
);
}
...
...
dlib/simd/simd8i.h
View file @
9ba7889f
...
...
@@ -44,7 +44,7 @@ namespace dlib
inline
simd4i
low
()
const
{
return
_mm256_castsi256_si128
(
x
);
}
inline
simd4i
high
()
const
{
return
_mm256_extractf128_si256
(
x
,
1
);
}
inline
unsigned
int
size
()
const
{
return
4
;
}
inline
unsigned
int
size
()
const
{
return
8
;
}
inline
int32
operator
[](
unsigned
int
idx
)
const
{
int32
temp
[
8
];
...
...
dlib/smart_pointers.h
View file @
9ba7889f
...
...
@@ -3,14 +3,12 @@
#ifndef DLIB_SMART_POINTERs_H_
#define DLIB_SMART_POINTERs_H_
// This is legacy smart pointer code that will likely to stop working under default
// compiler flags when C++17 becomes the default standard in the compilers.
// Please consider migrating your code to contemporary smart pointers from C++
// standard library. The warning below will help to detect if the deprecated code
// was included from library's clients.
// This is legacy smart pointer code that will likely stop working under default compiler
// flags when C++17 becomes the default standard in compilers. Please consider migrating
// your code to new smart pointers from C++ standard library.
#if (defined(__GNUC__) && ((__GNUC__ >= 4 && __GNUC_MINOR__ >= 8) || (__GNUC__ > 4))) || \
(defined(__clang__) && ((__clang_major__ >= 3 && __clang_minor__ >= 4)))
#pragma GCC warning "smart_pointers.h is included
which
will fail to compile under C++17"
#pragma GCC warning "smart_pointers.h is included
. This code
will fail to compile under C++17"
#endif
#include <memory>
...
...
dlib/test/WINDOWS_build_and_run_all_unit_tests.bat
View file @
9ba7889f
...
...
@@ -6,7 +6,7 @@ rem the pings are to wait between builds so visual studio doesn't get in a funk.
echo testing python >> test_log.txt
rm
-rf
build_python
rm
dir /S /Q
build_python
mkdir build_python
cd build_python
cmake -G "Visual Studio 14 2015 Win64" ../../../tools/python -DPYTHON3=ON
...
...
@@ -17,7 +17,7 @@ cd ..
echo testing vc2015 >> test_log.txt
rm
-rf
build_vc2015_64
rm
dir /S /Q
build_vc2015_64
mkdir build_vc2015_64
cd build_vc2015_64
cmake -G "Visual Studio 14 2015 Win64" ..
...
...
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