DepthAI Python Library
Project description
DepthAI Python Library
Python bindings for C++ depthai-core library
Documentation
Documentation is available over at Luxonis DepthAI API
Building documentation
-
Using Docker (with Docker Compose)
cd docs docker-compose build docker-compose up
Then open http://localhost:8000.
This docker container will watch changes in the
docs/source
directory and rebuild the docs automatically -
Linux
First, please install the required dependencies
Then run the following commands to build the docs website
python3 -m pip install -U pip python3 -m pip install -r docs/requirements.txt cmake -S . -B build -D DEPTHAI_BUILD_DOCS=ON -D DEPTHAI_PYTHON_BUILD_DOCS=ON cmake --build build --parallel --target sphinx python3 -m http.server --bind 0.0.0.0 8000 --directory build/docs/sphinx
Then open http://localhost:8000.
This will build documentation based on current sources, so if some new changes will be made, run this command in a new terminal window to update the website source
cmake --build build --parallel --target sphinx
Then refresh your page - it should load the updated website that was just built
Installation
Prebuilt wheels are available in Luxonis repository Make sure pip is upgraded
python3 -m pip install -U pip
python3 -m pip install --extra-index-url https://artifacts.luxonis.com/artifactory/luxonis-python-snapshot-local/ depthai
Building from source
Dependencies
- cmake >= 3.4
- C++14 compiler (clang, gcc, msvc, ...)
- Python
Along these, dependencies of depthai-core are also required See: depthai-core dependencies
Building
To build a shared library from source perform the following:
mkdir build && cd build
cmake ..
cmake --build . --parallel
To build a wheel, execute the following
python3 -m pip wheel . -w wheelhouse
Running tests
To run the tests build the library with the following options
mkdir build_tests && cd build_tests
cmake .. -D DEPTHAI_PYTHON_ENABLE_TESTS=ON -D DEPTHAI_PYTHON_ENABLE_EXAMPLES=ON -D DEPTHAI_PYTHON_TEST_EXAMPLES=ON
cmake --build . --parallel
ctest
Tested platforms
- Windows 10
- Ubuntu 16.04, 18.04;
- Raspbian 10;
- macOS 10.14.6, 10.15.4;
Troubleshooting
Relocation link error
Build failure on Ubuntu 18.04 ("relocation ..." link error) with gcc 7.4.0 (default) - issue #3
-
the solution was to upgrade gcc to version 8:
sudo apt install g++-8 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 70 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 70
Hunter
Hunter is a CMake-only dependency manager for C/C++ projects.
If you are stuck with error message which mentions external libraries (subdirectory of .hunter
) like the following:
/usr/bin/ld: /home/[user]/.hunter/_Base/062a19a/ccfed35/a84a713/Install/lib/liblzma.a(stream_flags_decoder.c.o): warning: relocation against `lzma_footer_magic' in read-only section `.text'
Try erasing the Hunter cache folder.
Linux/MacOS:
rm -r ~/.hunter
Windows:
del C:/.hunter
or
del C:/[user]/.hunter
LTO - link time optimization
If following message appears:
lto1: internal compiler error: in add_symbol_to_partition_1, at lto/lto-partition.c:152
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-10/README.Bugs> for instructions.
lto-wrapper: fatal error: /usr/bin/c++ returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/depthai.dir/build.make:227: depthai.cpython-38-x86_64-linux-gnu.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:98: CMakeFiles/depthai.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
One fix is to update linker: (In case you are on Ubuntu 20.04: /usr/bin/ld --version
: 2.30)
# Add to the end of /etc/apt/sources.list:
echo "deb http://ro.archive.ubuntu.com/ubuntu groovy main" >> /etc/apt/sources.list
# Replace ro with your countries local cache server (check the content of the file to find out which is)
# Not mandatory, but faster
sudo apt update
sudo apt install binutils
# Should upgrade to 2.35.1
# Check version:
/usr/bin/ld --version
# Output should be: GNU ld (GNU Binutils for Ubuntu) 2.35.1
# Revert /etc/apt/sources.list to previous state (comment out line) to prevent updating other packages.
sudo apt update
Another option is to use clang compiler:
sudo apt install clang-10
mkdir build && cd build
CC=clang-10 CXX=clang++-10 cmake ..
cmake --build . --parallel
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for depthai-2.1.0.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0142b4a48a30ec941be249c0c5421313a75277c214d0edd1ced061704e1bf91c |
|
MD5 | 81ec21796ed7fa9d95eabe18ab9c05a9 |
|
BLAKE2b-256 | f6fb3e4d97c3a8775c0435fbafb97dcf79c81af6031f5cdaf4297983dcbd22bd |
Hashes for depthai-2.1.0.0-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7cdd9104b26eec3436528d1aaea8b153f92eb3add59bbc24aaea5a9e32dd3a1a |
|
MD5 | c91529b31b1df3979224374d1fc5962c |
|
BLAKE2b-256 | b30689f0005fc4826dbd3e1e80c264b7d4ed600bce37f5bcf388c60a08f84044 |
Hashes for depthai-2.1.0.0-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d098152ec7ef3414de34406ab77f68153776001e1b302ce5d54a9ee18b9ad74d |
|
MD5 | 7464dd90245a62b2c600937cb338ac29 |
|
BLAKE2b-256 | 3ae0008f7fe8528729002107e4f1c6105476b0802a096784ece4c1369ce2cb18 |
Hashes for depthai-2.1.0.0-cp39-cp39-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 252b45a14f1575bad5f6ac18daf11739ffb099aa5ddf7fef46d701d838e60c36 |
|
MD5 | 57a32f5ab0d5f5659e8b4d1a516288b2 |
|
BLAKE2b-256 | faf32fc8e4293cf376da0a0b751957a9c5c6a8ca8f2a9280db0ac11b52519baa |
Hashes for depthai-2.1.0.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d50bf644fbb7141293606159994ced9137cb24e18fad557fe5acf52452504d78 |
|
MD5 | bc7e6d5bb336a780d719df346b8cb88c |
|
BLAKE2b-256 | 47b22b4bda94445710298a3d3791e402ce80bd665c39f9d4613b84043e0b39ef |
Hashes for depthai-2.1.0.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 810300f1b1dbd6e3334b9572fbdc6600c39d7b5a4f40039b9d5f2a1682de2b2d |
|
MD5 | fd39cbd583d65959ac3bdd64cb662838 |
|
BLAKE2b-256 | 67a8ca67c86096e48724c8a9cb089221a888905d0da79b1401475679dad9d9cd |
Hashes for depthai-2.1.0.0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42dee34c82b2c9b474b276bb10cc98d1b84cf7f238edfef7510d8b0022f86989 |
|
MD5 | bb5f75f4986f3b5a733935c89b3139e8 |
|
BLAKE2b-256 | bed6870344d607da3010d81cc7b510bf12039988c4fc52b1d69dbb62dd3f38fb |
Hashes for depthai-2.1.0.0-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 199f2aaab4b3fe9866aa18f86804935feb1c779901b2b7b91494a00ea4fd3f3d |
|
MD5 | 729ef95338d0c9c52f4d60764f08e41d |
|
BLAKE2b-256 | d06f19a80d5ccf42dfc183c7b38c7301721184884b4e656ed20701cdcb11532d |
Hashes for depthai-2.1.0.0-cp38-cp38-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b18e51d29c10515440a14faf399409d8a729698b93ff62d6d99b9c0582fafad |
|
MD5 | 674123be2c592a143c44813a09845922 |
|
BLAKE2b-256 | f9787de9bcfd297e2af2e267c04856a353919e05844e2d11f2947c51177d8c5c |
Hashes for depthai-2.1.0.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a94a2eea75d643627d8981cce119d8d68baa6925fb9d2b909a924deb09406248 |
|
MD5 | 564869a54bf7dfa8cdea31b90bfd12af |
|
BLAKE2b-256 | 24fe8d31469faf9b2418deafca6508a4d09e9df5ecc291a533530ae4cbde62e9 |
Hashes for depthai-2.1.0.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 579d4a99eaafdf527a6e7bf2c60152156cf867ba76819da5ae4252f2f78309e6 |
|
MD5 | 3e116945f98eff02671c48a27f31bd45 |
|
BLAKE2b-256 | 672bb947d500bd7b1579d8880549f6e14090b26e4941326a7c312111c2be112c |
Hashes for depthai-2.1.0.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 252fde89ccef141e540956a68ef411df30c38859442a617accf6fc1d038d2a33 |
|
MD5 | 0af5bec6d2ce9011f146fa18abbd360d |
|
BLAKE2b-256 | f9fac84d3dfeafab627ccf7915b1da58accadcec1175d5865ce6daad97a3a0eb |
Hashes for depthai-2.1.0.0-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f2bb754c6d8bae5951cd556edaaeceab77ea99ab5c0f95295ea55ddc7232063 |
|
MD5 | 378975f88f7fc2cbc15137a16e277876 |
|
BLAKE2b-256 | a23a825a5ff1eb2f32d8f0797449873b5d2ab1d2cdfc85620160d943f8d63e38 |
Hashes for depthai-2.1.0.0-cp37-cp37m-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86382715dfc284d9b83cd83dd32dcc5ac470b32ea156582b67b0296a5a646abe |
|
MD5 | 457e80513b8b114d1c4ae4b94e23f247 |
|
BLAKE2b-256 | 18c15da902d477f1e02775309b159fb0d8794d617c206aa7c36aa387b1dd07b2 |
Hashes for depthai-2.1.0.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9a38a39fb7acb421b4828bff92bb7b558828e059f3b4dc6293cefffd0ee5771 |
|
MD5 | 47534f4c12d757a313ba8e72d2cd9d5b |
|
BLAKE2b-256 | 5eda9e85e290e961337d68ce7a4554b890aed492d718cf5ea568d32ee8f5ae97 |
Hashes for depthai-2.1.0.0-cp37-cp37m-linux_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d608eec01bf43bfe3333be122d088f0e749a8f3e347df7346acafe317c1a3d8b |
|
MD5 | ba47685531385fb8ef7bcf81bacb9a74 |
|
BLAKE2b-256 | 5988d0e0d08d061488865423c42a6a1752aa501204fcce10c78ce28376fd3d06 |
Hashes for depthai-2.1.0.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33160cfa9296136dbde4fd073ca002e7dd089fb2fcec3f34160441681a3b3357 |
|
MD5 | 254c269bcdb6496941aaf65dab89f16d |
|
BLAKE2b-256 | 0aedd81e906b41767c081b614e94f392e27e63ef1d6bdbfd5cdcae0e8f0fb724 |
Hashes for depthai-2.1.0.0-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2bc8aa9d793cee6a6bbfb608518f943dd2e8c0331ad8a532357aeeb10cf3df1c |
|
MD5 | 79de6162902733c5879af2c8ed25d2bb |
|
BLAKE2b-256 | f51b754ca6dab248c3b1dfc1d3098b18f56288bf0ccdeb18847f12bb54f6adb8 |
Hashes for depthai-2.1.0.0-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d341f4c8780a07586c10dfc859cb9c72208624a7aa53e3c9900c469f48b96b9c |
|
MD5 | 17eebc5683094428cdd3411a3405842a |
|
BLAKE2b-256 | 1ea6c2c08e9b921b0bc2a0348a1735f186eff20c5f7b9db508e454cd12fc2390 |
Hashes for depthai-2.1.0.0-cp36-cp36m-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c16fb40442cccdc6c2f95450a6f5ae81cec05d6349cc767b2a66eafc6dd0ca5 |
|
MD5 | 3d7ac0fc02fa90e62862ccbee543f963 |
|
BLAKE2b-256 | f4134052de7fc45de927906b366420fbfbf8e891ce0f2d7e4b2e5b0612f1acc8 |
Hashes for depthai-2.1.0.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7a7fb17cd48cd8804c8b7d0aabb63c34c52efa3cd1875b3a32f7051de427216 |
|
MD5 | 8dc2da1d9c2284c17773ae568c36f9e6 |
|
BLAKE2b-256 | d540a462882469e33e9b684ab9d96a3a72dc63ea7b41761533af44d4ede97d10 |
Hashes for depthai-2.1.0.0-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64a8f5a482b41828053a23ee89d190bd2eb49b7c79c62f6b3ee27d8050a9d1d2 |
|
MD5 | f18dd62ae9c665e39952de2d28011ad3 |
|
BLAKE2b-256 | f5b9d5cf430e4708dd9a513372f8153d501145e5b46605c7870417ced820079a |
Hashes for depthai-2.1.0.0-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d60f80d4bf1c8d941218fa0111b9aed859504241872a49635d8650c4b0888f93 |
|
MD5 | b18ae315727822b86b6582a74f683387 |
|
BLAKE2b-256 | b7819addde3e3f771d664fc79b50b8472bf408d4bde702c1d8bbb48182ea867c |
Hashes for depthai-2.1.0.0-cp35-cp35m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd297906befec302046d546eabcefa6110abaa604f33bf8988f950578fb15124 |
|
MD5 | 34a8f6dfd3e511711e376e5928404e7d |
|
BLAKE2b-256 | 4a1456e483ee2aab857f776208a706cf70dcf50772b9d0cab51123051d1face4 |
Hashes for depthai-2.1.0.0-cp35-cp35m-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f8e9d979ba186d6ccd73ef2c2249f70076a737114b8917b05abfb5b98737be2 |
|
MD5 | 235976af7f48c7b61e3534cdb0e8ca15 |
|
BLAKE2b-256 | be612706ace172dbaef44af1d761b76c194832b29c86781a259cc86a5184c7be |
Hashes for depthai-2.1.0.0-cp35-cp35m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be866a6ac9b59740bcb859144521d51e618349730fdbefd4d408b5dcd9104aa7 |
|
MD5 | 6935979b8fddb0d2c23f142b82a3b7b6 |
|
BLAKE2b-256 | ee086a5ed2f30c94abb05e42fcce951b43c77a45a37076b22ef023151578e071 |