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.1.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2785efd0a98a77bc938fe1fe1095ae06619c528106bc39f13ef9a0dbcbfa95a |
|
MD5 | 9c8dc1cb83d65764b4b51873184cd5d8 |
|
BLAKE2b-256 | 21353e7e58212c785590e8b3011f06d8c2bd497884fd464e096dc86a73af7dd3 |
Hashes for depthai-2.2.1.0-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 741fd1a873b5cc5a2dda3bd8008db6c8180ef32824f46a42e423d190bd7d7368 |
|
MD5 | bdb8725532d601d046b129d2541fc938 |
|
BLAKE2b-256 | 4936d8f8a569f0657790c46fd2567022d6e421d439ee0f12668b3a6b266c3192 |
Hashes for depthai-2.2.1.0-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 582adb4afa57f5cde4767ef03cfa3009ae9f5c2bd79c59683ef3dc52248f0fb6 |
|
MD5 | f47251dddc52db87647463d81739e755 |
|
BLAKE2b-256 | 45f5cb4b97074e4357851746805642f70e5e0204cd171013046685ab6b8d05cd |
Hashes for depthai-2.2.1.0-cp39-cp39-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ddcc89d78a4ab8b0543308eb7b4cd9bd30df5893ef6bf73aee3305f237b718fe |
|
MD5 | d92627b395c2e325105f4aba25987725 |
|
BLAKE2b-256 | 92b0678131c0f3ecf218ee865bab4322ab5df1e40eb2377b5c38a7348639150a |
Hashes for depthai-2.2.1.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97c19ccc1e5860ae053e71b06e9d7621b18a88ef7e5ef49066377977187d2c0c |
|
MD5 | 712f77061b580f65880c06078d8379c2 |
|
BLAKE2b-256 | f108d9774729e25a8893179b7a31e94d24dbff0b6e7a20da8940635238b3a791 |
Hashes for depthai-2.2.1.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96006013fd17d3419031f736bb408a35f02cd656948d83c148503bcf0f0c0955 |
|
MD5 | 8430874e59a34aeeeed82dbe41cede14 |
|
BLAKE2b-256 | 79582f3be6fbbba4b534217879aedccd9fa001bddf952f03f16e522945cadf4c |
Hashes for depthai-2.2.1.0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae8d1a406f211aa1663481ab4d7cd5f8de00371e892fa167e2bd8dd1b76bf283 |
|
MD5 | dd4dd795ea3e073f0950dc775f355b97 |
|
BLAKE2b-256 | 9678927322fcc5bcd5906200fad867dd8b85aadf0795c9662d6403260b3e1aac |
Hashes for depthai-2.2.1.0-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ffe828ffe8b9354145913129f3e553a5c167fe42af7cb6392371ffff2ccfb5a |
|
MD5 | f6bb37fe1dff811f759497d753c0f5dc |
|
BLAKE2b-256 | 0b4d1950ed5270701ff29616280ba4ed5ab2f54709106795821de81047cdc9b1 |
Hashes for depthai-2.2.1.0-cp38-cp38-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1892bb3431485d3b0d130a268459d44794223ccbd66ce3317bd0a490bcb73b4 |
|
MD5 | f1f21f21d921aa7855959dc056aad353 |
|
BLAKE2b-256 | f428081559174bd3561a45bf7e4e890a9dd417aa19676bfb1826cc4835fa6d3c |
Hashes for depthai-2.2.1.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7503c5233448c2f50b9ccf3e470eb2962d294412da2cbf1c686512411212e37 |
|
MD5 | fe64002e02cec592215cd60f30f2da5e |
|
BLAKE2b-256 | ba677206f35d300263518725f04dd7618c26a31e3d2eea9314178dc009903cba |
Hashes for depthai-2.2.1.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b041ed35dc24b23416acb9ed7032b4d7bed7368c9ef9a415ba9936c836d1b710 |
|
MD5 | f04a3ab29a9b8a483f208810c942c32d |
|
BLAKE2b-256 | 6401f743afb5eca850a61cca7518f553338b5abc58a1cad94253206dff2e345b |
Hashes for depthai-2.2.1.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17a142095f952cc631fedaebdfb81e11730a06841f9eb692393e1a6bd6fd7c1a |
|
MD5 | 2a573b0b9404ad7774eb008245a32d50 |
|
BLAKE2b-256 | d939c3f909cde716bcd4e145b8a651ea7cecb7809ab31b9862988e60418a3b91 |
Hashes for depthai-2.2.1.0-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | baa4396eff68ad2018e3fb35fefd5f4873de06657f94fb8c60e24886b531ccb4 |
|
MD5 | 4dca3823208e19c016bf7036b3ff0485 |
|
BLAKE2b-256 | 608a76472a4acd606735d187858f5a596f137a0bd3162d5c21700f3282279a04 |
Hashes for depthai-2.2.1.0-cp37-cp37m-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e56c4c75956cd12aca73e05d9cf3027ce00d97e792809708c5a9b4ada5ac0488 |
|
MD5 | c9e9d59e5043392ef8f558c4b4ddbf1f |
|
BLAKE2b-256 | df98eca436abf4de2946f4153d4e8eb3baa6f1712f3d533ce49e9ccc4571951e |
Hashes for depthai-2.2.1.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b4bffc38d947ffe92cb191cecf3b7a129a9a67f280914457c45024d8de979b2 |
|
MD5 | ed6979acdf819d1a486ba6700aa96e1b |
|
BLAKE2b-256 | f6eb627ec106aadbbe89867a80812faed21410db35ede473953f2213ac7d6293 |
Hashes for depthai-2.2.1.0-cp37-cp37m-linux_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2d4efb64248232d144427602995184eb9ba966d049a8630fb48da70fb4ccdf3 |
|
MD5 | 729068b87843bfaaa4eef6fabee9afa8 |
|
BLAKE2b-256 | e815e6717d3d5995b770a094b61e9291df3670996967deb6d224648528496417 |
Hashes for depthai-2.2.1.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e62e7ed6b7ab1625af03e3610b09053c25ed9c6b4e153dd97ee95e16337b1dd |
|
MD5 | 2b33606a5d76a0a2dad12268d29a2379 |
|
BLAKE2b-256 | 2e853e34dd571be41bce3319683b4daa7e53d32c0d62f68c91add1212f3d3ae8 |
Hashes for depthai-2.2.1.0-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd27b7952e899371e63006f554b8c65b671e93d5de948922154b7bf802731316 |
|
MD5 | 964cb828bcbd9777d9b01b55f8b85b40 |
|
BLAKE2b-256 | 69a237f49a137ddf5a5cc62fd412a55165049687e8bf896499c36fbba8ea4526 |
Hashes for depthai-2.2.1.0-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64e7f75260cd87f9a63b3cd9e1b09034c88c99fd777e967a13e766ae7c8d389c |
|
MD5 | 467f23dd36fac08add3b7fcaf29b0eba |
|
BLAKE2b-256 | 41dec0a21f7eb023bda8739e4c14040c80bfebf7da3f9f34cb18ba2e864ea898 |
Hashes for depthai-2.2.1.0-cp36-cp36m-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76deeab30d1ca53d1ecce8fccd16f09b1c2f9ca7f1542038885177f8e7bf86be |
|
MD5 | 2a283248fbeb3b8115e844f8a5459bf4 |
|
BLAKE2b-256 | 5aca075409ff9b2d7a3553b898d751dd7f0bc868fa74d238c6c44ac522a096b6 |
Hashes for depthai-2.2.1.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f2c4b6fb3b6aff00fa5db6c19f8a487134e26e5f8167cb3b4c599625153d75f |
|
MD5 | b4e10d17aa4a297b1760c43a046e9bd9 |
|
BLAKE2b-256 | 2bd64f5d17aac2e0d0069770f58500f7d4ae23ed8051f2a3a45d8b42e3564b68 |
Hashes for depthai-2.2.1.0-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4468ac57da583ab2aaae98cab537b87d45e52654f374550c346e9a4a10d558a9 |
|
MD5 | e89893d8ade0187d9e01f9de34ac74b5 |
|
BLAKE2b-256 | 445fbe331c2a6331d3b5cbe98702ed453d8fa58cff350449ddfb2c8e89471395 |
Hashes for depthai-2.2.1.0-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b9315d7bf35526af1853898c6ffdfedd1b998ec447df44a2b53af8ff04b06d2 |
|
MD5 | 71eab4d0028021da1151ff8e4a74e67a |
|
BLAKE2b-256 | ec7a5ee0af52c554dc047b3cfc3ec3493e5846850e2682af60ef94b9ef0b4d03 |
Hashes for depthai-2.2.1.0-cp35-cp35m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61deb8c5832144de004fcf8d18f6b989e6844ec61f52219985df65006afcf35e |
|
MD5 | cda5ffb43f43ec955557de6e3898c3c6 |
|
BLAKE2b-256 | 06b0cf65a1043b14a2f336fd56b6af2b4ad547eaa962157d3ae9ce5324f2e160 |
Hashes for depthai-2.2.1.0-cp35-cp35m-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f082a648e6190482427e05b55e0af9e4a1ba9821768f5415326d0a1ac7aa744a |
|
MD5 | 9760f7aed7068283019373a58202462b |
|
BLAKE2b-256 | b6ee6caa706e5e3e803661f09145628acf928601d99080f4ac3191ba2647f090 |
Hashes for depthai-2.2.1.0-cp35-cp35m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9f15f966e804eabe9cddbb48b1e944b0c0db2f7866376c32ecf9174795ea176 |
|
MD5 | 20b78ccf23d03cd129e3c0819aecf90b |
|
BLAKE2b-256 | 605c0a442c7301b554aa49aa9955ed63aeeea65728e87c1feadeb34eca12db86 |