Skip to main content

Python wrapper over Azure Kinect SDK

Project description

pyk4a-bundle

CI codecov PyPI

pyk4a

This library is a simple and pythonic wrapper in Python 3 for the Azure-Kinect-Sensor-SDK.

Images are returned as numpy arrays and behave like python objects.

This approach incurs almost no overhead in terms of CPU, memory or other resources. It also simplifies usage. Kinect C api image buffers are directly reused and image releases are performed automatically by the python garbage collector.

Homepage: https://github.com/etiennedub/pyk4a/

Prerequisites

The Azure-Kinect-Sensor-SDK is required to build this library. To use the SDK, refer to the installation instructions here.

Install

Just install the pip package with the bundled libraries (Windows & Linux):

pip install pyk4a-bundle

Example

For a basic example displaying the first frame, you can run this code:

from pyk4a import PyK4A

# Load camera with the default config
k4a = PyK4A()
k4a.start()

# Get the next capture (blocking function)
capture = k4a.get_capture()
img_color = capture.color

# Display with pyplot
from matplotlib import pyplot as plt
plt.imshow(img_color[:, :, 2::-1]) # BGRA to RGB
plt.show()

Otherwise, a more avanced example is available in the example folder. To execute it opencv-python is required.

git clone https://github.com/etiennedub/pyk4a.git
cd pyk4a/example
python viewer.py

Documentation

No documentation is available but all functinos are properly type hinted. The code of the main class is a good place to startPyK4A.

You can also follow the various example folder scripts as reference.

Bug Reports

Submit an issue and please include as much details as possible.

Make sure to use the search function on closed issues, especially if your problem is related to installing on windows.

Module Development

  1. Install required packages: make setup

  2. Install local pyk4a version (compiles pyk4a.cpp): make build

Contribution

Feel free to send pull requests. The develop branch should be used.

Please rebuild, format, check code quality and run tests before submitting a pull request:

make build
make fmt lint
make test

Note: you need clang-format tool(v 11.0+) for formatting CPP code.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

pyk4a_bundle-1.3.0.1-cp310-cp310-win_amd64.whl (950.4 kB view details)

Uploaded CPython 3.10 Windows x86-64

pyk4a_bundle-1.3.0.1-cp310-cp310-manylinux_2_27_x86_64.whl (13.5 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.27+ x86-64

pyk4a_bundle-1.3.0.1-cp39-cp39-win_amd64.whl (950.4 kB view details)

Uploaded CPython 3.9 Windows x86-64

pyk4a_bundle-1.3.0.1-cp39-cp39-manylinux_2_27_x86_64.whl (13.5 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.27+ x86-64

pyk4a_bundle-1.3.0.1-cp38-cp38-win_amd64.whl (950.5 kB view details)

Uploaded CPython 3.8 Windows x86-64

pyk4a_bundle-1.3.0.1-cp38-cp38-manylinux_2_27_x86_64.whl (13.5 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.27+ x86-64

pyk4a_bundle-1.3.0.1-cp37-cp37m-win_amd64.whl (950.4 kB view details)

Uploaded CPython 3.7m Windows x86-64

pyk4a_bundle-1.3.0.1-cp37-cp37m-manylinux_2_27_x86_64.whl (13.5 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.27+ x86-64

pyk4a_bundle-1.3.0.1-cp36-cp36m-win_amd64.whl (950.3 kB view details)

Uploaded CPython 3.6m Windows x86-64

pyk4a_bundle-1.3.0.1-cp36-cp36m-manylinux_2_27_x86_64.whl (13.5 MB view details)

Uploaded CPython 3.6m manylinux: glibc 2.27+ x86-64

File details

Details for the file pyk4a_bundle-1.3.0.1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pyk4a_bundle-1.3.0.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 950.4 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for pyk4a_bundle-1.3.0.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 0052e0ce6deb500b2b828ca33e36aed058803cc665c907b605fa686c727e7894
MD5 4890a659754a9427e223bbdfb339afef
BLAKE2b-256 1565ba10fa051f69bb81aaef8d518c5ebca930b729015d6125d0b69ba9ea2496

See more details on using hashes here.

File details

Details for the file pyk4a_bundle-1.3.0.1-cp310-cp310-manylinux_2_27_x86_64.whl.

File metadata

  • Download URL: pyk4a_bundle-1.3.0.1-cp310-cp310-manylinux_2_27_x86_64.whl
  • Upload date:
  • Size: 13.5 MB
  • Tags: CPython 3.10, manylinux: glibc 2.27+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for pyk4a_bundle-1.3.0.1-cp310-cp310-manylinux_2_27_x86_64.whl
Algorithm Hash digest
SHA256 eecbf34c83c30929d6f533138261295cf40ba78342a8b4f6843ffaaeb9b2c52f
MD5 10ce0cb0799c717af23cb266cd76f7d5
BLAKE2b-256 5ba81d14622fd5f18fc41d696787c53926b4dcc5eb90c7b56ce7722d79ddfe36

See more details on using hashes here.

File details

Details for the file pyk4a_bundle-1.3.0.1-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pyk4a_bundle-1.3.0.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 950.4 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for pyk4a_bundle-1.3.0.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 5bc90bb7ec07f3a42d6dfcc33df9e8cfbc66561d88fbba54dd68aefb4d723566
MD5 d9519179775fcbaf0b809c267c6d0648
BLAKE2b-256 745110d9b560f600b66cd40290d72a3671b1d1a33e5127c5a2f9ccbdfc1d0f90

See more details on using hashes here.

File details

Details for the file pyk4a_bundle-1.3.0.1-cp39-cp39-manylinux_2_27_x86_64.whl.

File metadata

  • Download URL: pyk4a_bundle-1.3.0.1-cp39-cp39-manylinux_2_27_x86_64.whl
  • Upload date:
  • Size: 13.5 MB
  • Tags: CPython 3.9, manylinux: glibc 2.27+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for pyk4a_bundle-1.3.0.1-cp39-cp39-manylinux_2_27_x86_64.whl
Algorithm Hash digest
SHA256 c2065673bde8264ce1b5f5cc64576b647d97ebb508d192757570b1b75383ae32
MD5 56baf4523d4e9169c7a7aace12a89d4e
BLAKE2b-256 557e51721b307bea2aa9171051d1daef8101f1e3feafd73e51ad39ef4cda70b6

See more details on using hashes here.

File details

Details for the file pyk4a_bundle-1.3.0.1-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: pyk4a_bundle-1.3.0.1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 950.5 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for pyk4a_bundle-1.3.0.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 277026488be878bebb51fdf16cd87a144eb179ebc0ffab6f8e9ee4938adec89b
MD5 496c97884e627bcb5c462f6b3a8a5d60
BLAKE2b-256 0da38f301a07e244891e85478833ca4b095c5e4353aae76fb07a0328ba3ec476

See more details on using hashes here.

File details

Details for the file pyk4a_bundle-1.3.0.1-cp38-cp38-manylinux_2_27_x86_64.whl.

File metadata

  • Download URL: pyk4a_bundle-1.3.0.1-cp38-cp38-manylinux_2_27_x86_64.whl
  • Upload date:
  • Size: 13.5 MB
  • Tags: CPython 3.8, manylinux: glibc 2.27+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for pyk4a_bundle-1.3.0.1-cp38-cp38-manylinux_2_27_x86_64.whl
Algorithm Hash digest
SHA256 7bd9525869eb0400ba93f216f5ed7a5eb83282e01f3a5053c76ebbb7a5c48f45
MD5 fe3cd50bb2a8ecaff9f758acf0baede3
BLAKE2b-256 515cc57a62a77294ce2cfab9774e3331d31af43b8fc00b095af5b7ac7aa9a2ae

See more details on using hashes here.

File details

Details for the file pyk4a_bundle-1.3.0.1-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: pyk4a_bundle-1.3.0.1-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 950.4 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for pyk4a_bundle-1.3.0.1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 d03cf3b3e6db5fb6421dee8118214ab76e731328362830fa8cb568d0de4556d5
MD5 99aace0fc79e47b0b730240616354c1d
BLAKE2b-256 86c77550a99863f603b5948140945af05ed72c26d5272f82a0163c6c9cb81193

See more details on using hashes here.

File details

Details for the file pyk4a_bundle-1.3.0.1-cp37-cp37m-manylinux_2_27_x86_64.whl.

File metadata

  • Download URL: pyk4a_bundle-1.3.0.1-cp37-cp37m-manylinux_2_27_x86_64.whl
  • Upload date:
  • Size: 13.5 MB
  • Tags: CPython 3.7m, manylinux: glibc 2.27+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for pyk4a_bundle-1.3.0.1-cp37-cp37m-manylinux_2_27_x86_64.whl
Algorithm Hash digest
SHA256 8ab18cf7359cf369f2033f7e04471cc59c67bbf6a43e05d3c709651ff956e3cb
MD5 1df27b0f53109be5823c02d124430986
BLAKE2b-256 c3418333bf500cba1d91d280a717cb0341e1a894d2e5e626ccc7fa0bf2261fd3

See more details on using hashes here.

File details

Details for the file pyk4a_bundle-1.3.0.1-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: pyk4a_bundle-1.3.0.1-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 950.3 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for pyk4a_bundle-1.3.0.1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 f39727b3eaf778d5c89213764ad869540ffd95ee8d1c42a93f6f53190ea953ec
MD5 13a48de05a67b6e51b5fcae72a705aef
BLAKE2b-256 34b8ea4c496aa94a9a0d3a1fb784673f43ae7d64cfc7f80444df8f149abcb894

See more details on using hashes here.

File details

Details for the file pyk4a_bundle-1.3.0.1-cp36-cp36m-manylinux_2_27_x86_64.whl.

File metadata

  • Download URL: pyk4a_bundle-1.3.0.1-cp36-cp36m-manylinux_2_27_x86_64.whl
  • Upload date:
  • Size: 13.5 MB
  • Tags: CPython 3.6m, manylinux: glibc 2.27+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for pyk4a_bundle-1.3.0.1-cp36-cp36m-manylinux_2_27_x86_64.whl
Algorithm Hash digest
SHA256 f24ece712876214686643f19200ba6354e2fe4a5e325900206d80da39664c59f
MD5 b45e3fa955f5b4739f26bb785f1192cd
BLAKE2b-256 1c65540f1536df1ac8b8e09c589b0a6a2ca1e99b3f7eef45da42dd02b5bc758c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page