Skip to content

Commit

Permalink
Update wrapper for ZED SDK 4.0.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
adujardin committed Apr 24, 2023
1 parent b2586ac commit 33a098e
Show file tree
Hide file tree
Showing 6 changed files with 3,360 additions and 804 deletions.
35 changes: 16 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ This package lets you use the ZED stereo camera in Python 3. The Python API is a

To start using the ZED SDK in Python, you will need to install the following dependencies on your system:

- [ZED SDK 3.8](https://www.stereolabs.com/developers/) and its dependency [CUDA](https://developer.nvidia.com/cuda-downloads)
- [ZED SDK 4.0](https://www.stereolabs.com/developers/) and its dependency [CUDA](https://developer.nvidia.com/cuda-downloads)

For the ZED SDK 3.8 compatible version, use the [zedsdk_3.X branch](https://github.com/stereolabs/zed-python-api/tree/zedsdk_3.X) or the [3.8 release tag](https://github.com/stereolabs/zed-python-api/releases/tag/v3.8)

- Python 3.7+ x64 ([Windows installer](https://www.python.org/ftp/python/3.7.6/python-3.7.6-amd64.exe))
- [Cython 0.28](http://cython.org/#download)
- [Numpy 1.13](https://www.scipy.org/scipylib/download.html)
Expand Down Expand Up @@ -58,29 +61,23 @@ Run the script:
```bash
$ cd "/usr/local/zed/"
$ python get_python_api.py

# The script displays the detected platform versions
CUDA 10.0
Platform ubuntu18
ZED 3.1
Python 3.7
# Downloads the whl package
Downloading python package from https://download.stereolabs.com/zedsdk/3.1/ubuntu18/cu100/py37 ...

# Gives instruction on how to install the downloaded package
File saved into pyzed-3.1-cp37-cp37m-linux_x86_64.whl
To install it run :
python3 -m pip install pyzed-3.1-cp37-cp37m-linux_x86_64.whl
Detected platform:
linux_x86_64
Python 3.11
ZED SDK 4.0
# Downloads and install the whl package
-> Checking if https://download.stereolabs.com/zedsdk/4.0/whl/linux_x86_64/pyzed-4.0-cp311-cp311-linux_x86_64.whl exists and is available
-> Found ! Downloading python package into /home/user/pyzed-4.0-cp311-cp311-linux_x86_64.whl
-> Installing necessary dependencies
...
Successfully installed pyzed-4.0
```
Now install the downloaded package with pip:
To install it later or on a different environment run :
```bash
$ python3 -m pip install pyzed-3.1-cp37-cp37m-linux_x86_64.whl

Processing ./pyzed-3.1-cp37-cp37m-linux_x86_64.whl
Installing collected packages: pyzed
Successfully installed pyzed-3.1
$ python -m pip install --ignore-installed /home/user/pyzed-4.0-cp311-cp311-linux_x86_64.wh
```
That's it ! The Python API is now installed.
Expand Down
6 changes: 3 additions & 3 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

### Prerequisites

- [ZED SDK 3.8](https://www.stereolabs.com/developers/) and its dependency [CUDA](https://developer.nvidia.com/cuda-downloads)
- [ZED SDK 4.0](https://www.stereolabs.com/developers/) and its dependency [CUDA](https://developer.nvidia.com/cuda-downloads)
- Python 3.7+ x64
- C++ compiler (VS2017 recommended)
- [Cython 0.26](http://cython.org/#download)
- [Numpy 1.13.1](https://www.scipy.org/scipylib/download.html)

The ZED SDK 2.X compatible API can be found in the [zedsdk_2.X branch](https://github.com/stereolabs/zed-python-api/tree/zedsdk_2.X).
The ZED SDK 3.X compatible API can be found in the [zedsdk_3.X branch](https://github.com/stereolabs/zed-python-api/tree/zedsdk_3.X).

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

```
python --version
Expand Down
5 changes: 2 additions & 3 deletions src/pyzed/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,7 @@ namespace sl {

sl::ObjectDetectionRuntimeParameters* create_object_detection_runtime_parameters(float confidence_threshold,
std::vector<int> object_vector,
std::map<int,float> object_class_confidence_map,
int minimum_keypoints_threshold) {
std::map<int,float> object_class_confidence_map) {

std::vector<sl::OBJECT_CLASS> object_vector_cpy;
for (unsigned int i = 0; i < object_vector.size(); i++)
Expand All @@ -209,6 +208,6 @@ namespace sl {
object_class_confidence_map_cpy[static_cast<sl::OBJECT_CLASS>(map_elem.first)] = map_elem.second;
}
}
return new ObjectDetectionRuntimeParameters(confidence_threshold, object_vector_cpy, object_class_confidence_map_cpy, minimum_keypoints_threshold);
return new ObjectDetectionRuntimeParameters(confidence_threshold, object_vector_cpy, object_class_confidence_map_cpy);
}
}
Loading

0 comments on commit 33a098e

Please sign in to comment.