1 Star 0 Fork 1

dongzhou/zed-python-api

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
Clone or Download
contribute
Sync branch
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README
MIT

Stereolabs ZED - Python API

This package lets you use the ZED stereo camera in Python 3.

Linux pipeline status Windows Build status

Getting started

Prerequisites

Please check your python version with the following command. The result should be 3.5 or higher.

python --version

Cython and Numpy can be installed via pip.

python -m pip install cython numpy

Note: On Linux, it is advised to use the python3 command instead of python which by default point to python 2.7. To do so, the following packages python3-dev and python3-pip need to be installed.

python3 --version
pip3 install -r requirements.txt

Installing the plugin using pip

Currently the package is built for Desktop for the latest ZED SDK 2.8, depending on your configuration (Python, CUDA or OS version), choose the relevant command :

Ubuntu 16 using the default Python 3.5 and CUDA 9

pip3 install https://download.stereolabs.com/whl/cu90/pyzed-2.8-cp35-cp35m-linux_x86_64.whl

Ubuntu 18 using the default Python 3.6 and CUDA 10

pip3 install https://download.stereolabs.com/whl/cu100/pyzed-2.8-cp36-cp36m-linux_x86_64.whl

Windows : Python 3.5, 3.6 and 3.7 are available. For instance Python 3.7, CUDA 10 :

python.exe -m pip install https://download.stereolabs.com/whl/cu100/pyzed-2.8-cp37-cp37m-win_amd64.whl

Build the plugin from source

python setup.py build
python setup.py install

or on Linux

python3 setup.py build
python3 setup.py install

If an error occurs during the compilation, make sure that you're using the latest ZED SDK and that you installed an x64 version of python. python -c "import platform; print(platform.architecture())"

The packages .pyd for Windows or .so for Linux will be generated and installed.

You can use python setup.py cleanall to remove every cpp files generated and build directory.

Make sure to be out of the plugin directory when using it. It will prevent Python from considering the pyzed folder of the plugin as the pyzed package.

When using Anaconda, make sure the package binary can be found. In the project folder, after compiling the wrapper run :

conda develop build/lib.linux-x86_64-3.6 # or 3.5 depending on the python version used

Use the plugin

Code

Import the packages in your Python terminal or file like this:

import pyzed.sl as sl

Vectors operations like norm, sum, square, dot, cross, distance but also simple operations can be done with Numpy package.

Run the tutorials

The tutorials provide simple projects to show how to use each module of the ZED SDK. For a similar version using the C++ API checkout the Cpp tutorials.

Run the examples

Please refer to the examples README for more informations.

Generate the API documentation

The documentation is provided in the doc folder and has to be built first.

Sphinx is used to generates the html documentation.

  1. The zed-python-api has to be compiled and installed
  2. Make sure sphinx and sphinx_rtd_theme are installed
    cd doc
    pip3 install -r requirements.txt
  1. Generate the documentation by running the provided Makefile (Linux) or make.bat (Windows)
    make html
  1. The documentation can be viewed in a browser by opening the generated index.html file located in doc/build/html/

Stable API notice

The ZED Python API is now stable but has some breaking changes from the previous (beta) version. The older beta version can be found in the legacy branch.

The changes were made to better reflect the C++ API and ease of use. Mainly all classes have a similar name to the C++ SDK (without the "Py" prefix), and all components were migrated to a unified sl namespace.

Contributing

Feel free to open an issue if you find a bug, or a pull request for bug fixes, features or other improvements.

MIT License Copyright (c) 2018 Stereolabs Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Python API for the ZED SDK expand collapse
MIT
Cancel

Releases

No release

Contributors

All

Activities

can not load any more
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/dong_zhou/zed-python-api.git
git@gitee.com:dong_zhou/zed-python-api.git
dong_zhou
zed-python-api
zed-python-api
master

Search