zed-python-api
zed-python-api copied to clipboard
Feature/get data gpu
Keep the retrieved data on GPU
Description
Through the utilization of cupy.ndarrays (extra dependency), we were able to keep the retrieved data on GPU and provide a view of the memory on the Python side.
This PR introduces a slight modification to the get_data() function in a way that extends the API, but doesn't break any of its current functionalities.
Notes
In an effort to stay true to the original API, data on the GPU could be either deeply copied, or viewed by the Python API consumer.
A list of references is kept as a comment above the added code for potential enhancements, and/or better understanding of the feature.
Tests
This was tested with the ZED SDK 4.0, on both SVOs (recorded in HD2K-15), and on a live stream from a ZED Mini, with a custom wrapper of the Python API, on a Ubuntu 20.04.6 LTS system, with an Nvidia GTX 1650 4Gb graphics card.
Additionally, we are attempting its test on an Nvidia AGX Orin 32Gb developer kit, though we're having some Cython compilation errors that are prohibiting us from proceeding with the tests (would love to discuss, but not our topic).
Disclaimers
This is not thoroughly tested, and this PR is intended to spark a discussion around how this feature might be developed by the community, rather than being a final product (though we hope it's ready as is).