DepthAI Python Library
Project description
DepthAI Python Library
Python bindings for C++ depthai-core library
Documentation
Documentation is available over at Luxonis DepthAI API
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:
git submodule update --init --recursive
mkdir build && cd build
cmake .. [-D PYTHON_EXECUTABLE=/full/path/to/python]
cmake --build . --parallel
Where -D PYTHON_EXECUTABLE
option can optionally specify an exact Python executable to use for building.
To build a wheel, execute the following
python3 -m pip wheel . -w wheelhouse
To build and install using pip:
python3 -m pip install .
Running tests
To run the tests build the library with the following options
git submodule update --init --recursive
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;
Building documentation
-
Using Docker (with Docker Compose)
cd docs sudo docker-compose build sudo docker-compose up
ℹ️ You can leave out the
sudo
if you have added your user to thedocker
group (or are using rootless docker). 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
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.2.0.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a343dca660a129373bd45ee91144277255603bbdb3fe6df284fca4251cad3730 |
|
MD5 | 4de75a6d8ce1905d51f9fc7d282bd6ab |
|
BLAKE2b-256 | ac3412384e13b5554a4d698511f35f18de49c775fa173dbc26a20115c4af9059 |
Hashes for depthai-2.2.0.0-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93964fd8e468f5021b983ba1bbd2ad77fbfce9825ed861304eb2ba41df14d507 |
|
MD5 | b60fe1439c413d8ca2a7ceda25a823a4 |
|
BLAKE2b-256 | 9a3c365b3b6862e3bfe92bf41c7ac5746c90fbb64bf36b30b6e5d89bf244ba03 |
Hashes for depthai-2.2.0.0-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd873c7803cdecd0ae90f03cf8710fea7cb818fa49ea3fbab83ed47876b76503 |
|
MD5 | dd7de31fbd18597ea52ea0a905b4de3d |
|
BLAKE2b-256 | c22813c6609592f14a3456964c4eaefd6f246f0870dc6ecd2993e7db1aae4d98 |
Hashes for depthai-2.2.0.0-cp39-cp39-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b30e7fadd813ca4e9274b81798142d37b9730de826d61c43892ba2049198380 |
|
MD5 | d66e0a4a0669def2b5eb858a383fc420 |
|
BLAKE2b-256 | 291a09001e0bf993e36ae003a75f413b868e2ae55ebd65fe0fc449a46c8bb11e |
Hashes for depthai-2.2.0.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d5b437c31e172426ed81e9ce9706cb4aabb15951b09680330d5eef537328538 |
|
MD5 | c182776c62d5d6654609844802b184de |
|
BLAKE2b-256 | a937d9940192577e4bdee56b01649fac90195ab75da8c352ac1dec9d39a8f474 |
Hashes for depthai-2.2.0.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c3e6b46e901d1cd70b66b3d2473f5dcb3e4eb935ced922a6952831fd5f9e904 |
|
MD5 | 5e6c82997376036e570db4f7b39b7ef4 |
|
BLAKE2b-256 | 90d92911d5a74da4ea195c8cdd4ff8a94504feb594851e0eaf816e978f5d886a |
Hashes for depthai-2.2.0.0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9dc8c491d743b196a7fd08a9a0e0aa7ff92c223a0e6761f5eebf76b1ebecfbdc |
|
MD5 | b8e4d88261cd9547cc39ea795d003b2a |
|
BLAKE2b-256 | 58a01d4560c1701e8305913581072a1c20093e2fa60a7cceb2c85cd3d6c55abe |
Hashes for depthai-2.2.0.0-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 649eabfd4fbe81b083cc92312cf40644313f7e63e98b471555e2b1fb75085d19 |
|
MD5 | ba74f706b6a7c25de6e4d2fcc034871f |
|
BLAKE2b-256 | f687c94bf0e79f41f12c80a63ae3b1164185f8ecf79bd38a53a3f8ed9245cd22 |
Hashes for depthai-2.2.0.0-cp38-cp38-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82684f9cebce022e001fc239f607dbb6f0ba6bf4abf29fe1038976ebe254c5c0 |
|
MD5 | 914f8d7849da7205f27238c8619f50df |
|
BLAKE2b-256 | 84f0f8140aba69c2955cadd99ab1e9c77ec06fd09a3824965a92985886731dd0 |
Hashes for depthai-2.2.0.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d61e69be36a03a324d2578dfe7a6dfe6f5faa61cae399aaf8c47455139b4341 |
|
MD5 | d357f779469a73f719d26833491fd0e5 |
|
BLAKE2b-256 | 5db680bb476168e57928cda6820739f8ab5f4d3a9719a1e2422de88f8892dbe0 |
Hashes for depthai-2.2.0.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8503bd28c2137a40dd10cf8e45778b0bb45e1c97fb4baf8fafaebdf1bd802666 |
|
MD5 | 6daf709a580e5d05b4696909f9bdccd9 |
|
BLAKE2b-256 | 3ac13e794a7306832824e55f725e2c9e41339184861bd027095a7ffa5ada1afa |
Hashes for depthai-2.2.0.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 017b956e35f201060569ded9fb73de58808ddc9b7c12650b05d93c3dc563ceca |
|
MD5 | 3dbedac6786e72b750ff67032f9d8cd2 |
|
BLAKE2b-256 | 096c551e4cf646d28ec80830df330f3c92fc3526082a8d840a49b59ba5e6b9ab |
Hashes for depthai-2.2.0.0-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 268c9815ffc4e3596b7a86ad87935e22ebd2c8bbf674f4b53eb2921fde48c030 |
|
MD5 | 36623d45584b82ab9b28a3f2f1e33955 |
|
BLAKE2b-256 | bb2b3c6a972a56cbaed687db78a147cdc5e87fab5554f28870ca301e8d17ae20 |
Hashes for depthai-2.2.0.0-cp37-cp37m-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d154b474e5460020bd7a544d7f597aaf7b759d14ce1fca37c5724c87972993fc |
|
MD5 | f15cb87899f1e1fe8819e8e8b959eb8e |
|
BLAKE2b-256 | c71cc2cc565e0c397295c4452b551db370429265960248120e6b63637badb35e |
Hashes for depthai-2.2.0.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07b534ac992ca977111a28489d30ba2aab996a0519a7631489ca14489e9b14dd |
|
MD5 | 29819f79b7a4c85277303de540920d86 |
|
BLAKE2b-256 | 5e913fedb9b737b6d853d0eb25dd839beee521fa9d651501fcb3b2e381376e52 |
Hashes for depthai-2.2.0.0-cp37-cp37m-linux_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0624b4fd73b55e9d0baf267adf02c0884ce77e3dac36871f5df280f83dcb1131 |
|
MD5 | 565e4a465199d4b6c59f0256bcedf616 |
|
BLAKE2b-256 | f08c66ea3f2feb950aacb388a1468448e8a365e472241a44534d085730188690 |
Hashes for depthai-2.2.0.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0050c2b18db5fb58c62bc59afcfd49c3b3128fcfd2250b3e78262f28cefe9b1 |
|
MD5 | 098fbb14f72b904c67999720eee78040 |
|
BLAKE2b-256 | 4135e726535d75620371974eb68df225d8b5d12e8b729c699564c4cd8c9e5eb0 |
Hashes for depthai-2.2.0.0-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7fa354b5c03ff88675e0d9c71d22f659e22403533fadfd24a6d88ff6a84faf1 |
|
MD5 | 9c6f0cdfed9c6d1d17b5b9245cb48e9c |
|
BLAKE2b-256 | 73fe00de1722d2617d5d554cc0bd1d5c6b816183cd52abf83982a6ec711ea7b4 |
Hashes for depthai-2.2.0.0-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee43ec92e0d637c6f59e04bd46f683c1dc09d3f4b19f769be9deda0022eca02d |
|
MD5 | fff254d65689ef65a8cf106fec11f0fb |
|
BLAKE2b-256 | d0285c70ca132ec8c1a11122e4dd35931b3394457da6b41f73df84d49c43b4a2 |
Hashes for depthai-2.2.0.0-cp36-cp36m-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe323eb797fe5e059077f2e3b60eb71de4d538073772bf0c86fbf10420fd1907 |
|
MD5 | e38853e5ac0f5f76ee29507d82766077 |
|
BLAKE2b-256 | 92b84876d8eed975bda60588ffcda1371843e4c351feec0997308cb9b033169d |
Hashes for depthai-2.2.0.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22032cadcdf196ed42d3612bb6e232d41e996c429323fa650545069ea427e506 |
|
MD5 | e044960cc4a294b62d76b96dca6decee |
|
BLAKE2b-256 | 9d5e21e9e487a3f6bf1159df7087aa99bf7b1982186c3be02a23b51701bdeeea |
Hashes for depthai-2.2.0.0-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f69dad20f343fa1d28accb73c98d3f1838ed707c42e09afed5fde0cf728ca02c |
|
MD5 | 967a24585ba1bc75930b648b40d9d61d |
|
BLAKE2b-256 | b46e118fd7031392f9c807c2ff40be8b3e3918cb7bad0d9bd005ebdf74e5b98c |
Hashes for depthai-2.2.0.0-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53133cce58dde28e575550adbd214f2c69d5d2662dea90007e36a092ba9513bf |
|
MD5 | 9eac461c672ef6eebf59ede1024ac06a |
|
BLAKE2b-256 | bd53af129963452c6ae671058fbf35c06dfbd48e66f1900edbec6a9db000c0be |
Hashes for depthai-2.2.0.0-cp35-cp35m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8d0d2739fd910b36efcdb9ece343899460d5e637413f43a8dfaaaf8352b2be9 |
|
MD5 | 1887dea05d96729f7acb3aa4201357a6 |
|
BLAKE2b-256 | 831fc627c906a215ae910714faa47a01e92fcd47b3afa7f1188dc50b4aa48953 |
Hashes for depthai-2.2.0.0-cp35-cp35m-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca47ddcc110ca0663bf0bf4836a53fd27129c0ff7a7f1b5259facffe422602a1 |
|
MD5 | 3e77f0a93741fc6c3005f439be72d195 |
|
BLAKE2b-256 | 44a121fbe814d0177e0a3f60f1c35b513a6c2f731bda838118bd7d8099b0072c |
Hashes for depthai-2.2.0.0-cp35-cp35m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef5db6398d59b07ae9b0b60b3ac315047ec312f2587f7131bf34ae1ed2557a2f |
|
MD5 | 2953498fa18b0cebe05a96c212f53b9e |
|
BLAKE2b-256 | 4c399aa304a37551b26a5614b55a0cb676389bd73e9f28e2762ed8e2e31bea76 |