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
7fcb6c28
"...v2/git@developer.sourcefind.cn:OpenDAS/vision.git" did not exist on "16d62e3072955bd92b76a4ae73fefa73ecc9ee3e"
Commit
7fcb6c28
authored
Jun 07, 2020
by
Davis King
Browse files
Add an __init__.py file so we can add paths to CUDA libs on windows.
parent
53b6ea3b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
6 deletions
+16
-6
setup.py
setup.py
+2
-1
tools/python/CMakeLists.txt
tools/python/CMakeLists.txt
+2
-4
tools/python/dlib/__init__.py
tools/python/dlib/__init__.py
+11
-0
tools/python/src/dlib.cpp
tools/python/src/dlib.cpp
+1
-1
No files found.
setup.py
View file @
7fcb6c28
...
@@ -229,13 +229,14 @@ setup(
...
@@ -229,13 +229,14 @@ setup(
author_email
=
'davis@dlib.net'
,
author_email
=
'davis@dlib.net'
,
url
=
'https://github.com/davisking/dlib'
,
url
=
'https://github.com/davisking/dlib'
,
license
=
'Boost Software License'
,
license
=
'Boost Software License'
,
ext_modules
=
[
CMakeExtension
(
'dlib'
,
'tools/python'
)],
ext_modules
=
[
CMakeExtension
(
'
_
dlib
_pybind11
'
,
'tools/python'
)],
cmdclass
=
dict
(
build_ext
=
CMakeBuild
,
test
=
PyTest
),
cmdclass
=
dict
(
build_ext
=
CMakeBuild
,
test
=
PyTest
),
zip_safe
=
False
,
zip_safe
=
False
,
# We need an older more-itertools version because v6 broke pytest (for everyone, not just dlib)
# We need an older more-itertools version because v6 broke pytest (for everyone, not just dlib)
tests_require
=
[
'pytest==3.8'
,
'more-itertools<6.0.0'
],
tests_require
=
[
'pytest==3.8'
,
'more-itertools<6.0.0'
],
#install_requires=['cmake'], # removed because the pip cmake package is busted, maybe someday it will be usable.
#install_requires=['cmake'], # removed because the pip cmake package is busted, maybe someday it will be usable.
packages
=
[
'dlib'
],
packages
=
[
'dlib'
],
package_dir
=
{
''
:
'tools/python'
},
keywords
=
[
'dlib'
,
'Computer Vision'
,
'Machine Learning'
],
keywords
=
[
'dlib'
,
'Computer Vision'
,
'Machine Learning'
],
classifiers
=
[
classifiers
=
[
'Development Status :: 5 - Production/Stable'
,
'Development Status :: 5 - Production/Stable'
,
...
...
tools/python/CMakeLists.txt
View file @
7fcb6c28
...
@@ -68,8 +68,6 @@ if(NOT ${DLIB_NO_GUI_SUPPORT})
...
@@ -68,8 +68,6 @@ if(NOT ${DLIB_NO_GUI_SUPPORT})
list
(
APPEND python_srcs src/gui.cpp
)
list
(
APPEND python_srcs src/gui.cpp
)
endif
()
endif
()
pybind11_add_module
(
dlib_python
${
python_srcs
}
)
pybind11_add_module
(
_dlib_pybind11
${
python_srcs
}
)
target_link_libraries
(
dlib_python PRIVATE dlib::dlib
)
target_link_libraries
(
_dlib_pybind11 PRIVATE dlib::dlib
)
# Set the output library name to dlib because that's what setup.py and distutils expects.
set_target_properties
(
dlib_python PROPERTIES OUTPUT_NAME dlib
)
tools/python/dlib/__init__.py
0 → 100644
View file @
7fcb6c28
from
_dlib_pybind11
import
*
from
_dlib_pybind11
import
__version__
,
__time_compiled__
try
:
import
os
# On windows you must call os.add_dll_directory() to allow linking to external DLLs. See
# https://docs.python.org/3.8/whatsnew/3.8.html#bpo-36085-whatsnew.
os
.
add_dll_directory
(
os
.
path
.
join
(
os
.
environ
[
'CUDA_PATH'
],
'bin'
))
except
(
AttributeError
,
KeyError
):
pass
tools/python/src/dlib.cpp
View file @
7fcb6c28
...
@@ -37,7 +37,7 @@ void bind_line(py::module& m);
...
@@ -37,7 +37,7 @@ void bind_line(py::module& m);
void
bind_gui
(
py
::
module
&
m
);
void
bind_gui
(
py
::
module
&
m
);
#endif
#endif
PYBIND11_MODULE
(
dlib
,
m
)
PYBIND11_MODULE
(
_
dlib
_pybind11
,
m
)
{
{
warn_about_unavailable_but_used_cpu_instructions
();
warn_about_unavailable_but_used_cpu_instructions
();
...
...
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