• Stars
    star
    446
  • Rank 97,888 (Top 2 %)
  • Language
    Python
  • License
    MIT License
  • Created over 4 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Python library to run Kinect Azure DK SDK functions

pyKinectAzure

PyPI

Azure kinect color and depth combination

Python 3 library for the Azure Kinect DK sensor-SDK.

Similar solutions

Part of the ideas in this repository are taken from following repositories:

  • pyk4a: Really nice and clean Python3 wrapper for the Kinect Azure SDK.

  • Azure-Kinect-Python: More complete library using ctypes as in this repository, however, examples about how to use the library are missing and the library is harder to use.

The objective of this repository is to combine the strong points of both repositories by creating a easy to use library that allows the use of most of the functions of the Kinect Azure. Also, to create sample programs to showcase the uses of the library

Prerequisites

  • Azure-Kinect-Sensor-SDK: required to build this library. To use the SDK, refer to the installation instructions here.
  • ctypes: required to read the library.
  • numpy: required for the matrix calculations
  • opencv-python: Required for the image transformations and visualization.

Installation

pip install pykinect_azure

How to use this library

  • The library has been tested in Windows 10 and Ubuntu 20.04 with the Kinect Azure SDK 1.4.0 and 1.4.1, it should also work with other operating systems.

    • Windows: When using the pyKinectAzure class, it requires the path to the k4a.dll module, make sure that the path is the correct one for your Kinect Azure SDK version. By default the path (module_path) is set to C:\\Program Files\\Azure Kinect SDK v1.4.0\\sdk\\windows-desktop\\amd64\\release\\bin\\k4a.dll.

    • Linux: When using the pyKinectAzure class, it requires the path to the k4a.so module, make sure that the path is the correct one for your Kinect Azure SDK version. When using Linux set module_path to /usr/lib/x86_64-linux-gnu/libk4a.so, please follow the instruction from microsoft to install the right packages.

    • Nvidia Jetson: When using the pyKinectAzure class, it requires the path to the k4a.so module, make sure that the path is the correct one for your Kinect Azure SDK version. When using Nvidia Jetson set module_path to to '/usr/lib/aarch64-linux-gnu/libk4a.so', please follow the instruction from microsoft to install the right packages.

  • The pyKinectAzure class is a wrapper around the _k4a.py module to make the library more understandable. However, the pyKinectAzure class still contains few methods from the Kinect Azure SDK

  • The _k4a.py module already contains all the methods in the Kinect Azure SDK. So, for more advanced of the Kinect Azure SDK check the _k4a.py module.

Examples

For an example on how to obtain and visualize the depth data from the Azure Kinect DK check the exampleDepthImageOpenCV.py script.

git clone https://github.com/ibaiGorordo/pyKinectAzure.git
cd pyKinectAzure/examples
python exampleDepthImageOpenCV.py

Also, there is an example to obtain and visualize the smooth depth from the Azure Kinect DK check the exampleSmoothDepthImageOpenCV.py script.

python exampleSmoothDepthImageOpenCV.py

note: when you are dealing on the linux platform, please insure that the user have permission to the usb devices, or always execute under the root permission by adding sudo ahead.

Azure kinect smoothed depth image comparison

Contribution

Feel free to send pull requests.

Bug reports are also appreciated. Please include as much details as possible.

TODO:

Wrappers for the Kinect Azure data

  • Create wrapper to read depth images.
  • Create wrapper to read Infrared images.
  • Create wrapper to read IMU data.
  • Create function to convert image buffer to image depending on the image type.
  • Create wrapper to transform depth image to color image.
  • Create wrapper to transform depth image to 3D point cloud.
  • Create funtion to visualize 3D point cloud.

Create examples

  • Example to visualize depth images.
  • Example to visualize passive IR images.
  • Example to plot IMU data.
  • Example to visualize Depth as color image.
  • Example to overlay depth color with alpha over real image.
  • Example to visualize 3D point cloud

Body tracking

  • Create library for the body tracking SDK similar the same way as the current library.
  • Combine image and skeleton data.
  • Generate 3D skeleton visualization.

Future ideas

  • Run Deep Learning models on Kinect data (Openpose 3D skeleton, semantic segmentation with depth, monocular depth estimation validation)
  • Track passive infrared marker for motion capture analysis

More Repositories

1

ONNX-YOLOv8-Object-Detection

Python scripts performing object detection using the YOLOv8 model in ONNX.
Python
376
star
2

CREStereo-Pytorch

Non-official Pytorch implementation of the CREStereo(CVPR 2022 Oral).
Python
216
star
3

ONNX-YOLOv7-Object-Detection

Python scripts performing object detection using the YOLOv7 model in ONNX.
Python
201
star
4

ONNX-YOLOv8-Instance-Segmentation

Python scripts performing Instance Segmentation using the YOLOv8 model in ONNX.
Python
133
star
5

AWR1642-Read-Data-Python-MMWAVE-SDK-2

Python program to read and plot the data in real time from the AWR1642 and IWR1642 mmWave radar boards (Texas Instruments).
Python
132
star
6

AWR1843-Read-Data-Python-MMWAVE-SDK-3-

Python program to read and plot the data in real time from the AWR1843 mmWave radar board (MMWAVE SDK 3)
Python
131
star
7

ONNX-SAM2-Segment-Anything

Python scripts for the Segment Anythin 2 (SAM2) model in ONNX
Python
131
star
8

HITNET-Stereo-Depth-estimation

Python scripts for performing stereo depth estimation using the HITNET Tensorflow model.
Python
123
star
9

ONNX-CREStereo-Depth-Estimation

Python scripts performing stereo depth estimation using the CREStereo model in ONNX.
Python
121
star
10

ONNX-Mobile-Human-Pose-3D

Python scripts for performing 3D human pose estimation using the Mobile Human Pose model in ONNX.
Python
120
star
11

ONNX-YOLOv6-Object-Detection

Python scripts performing object detection using the YOLOv6 model in ONNX.
Python
93
star
12

ONNX-Unidepth-Monocular-Metric-Depth-Estimation

Python scripts performing Metric Monocular Depth Estimation using the Unidepth model in ONNX.
Python
74
star
13

IWR1443-Read-Data-Python-MMWAVE-SDK-1

Python program to read and plot the position of the reflected points from the IWR1443 and the AWR1443. It works both with Windows and Raspberry Pi.
Python
69
star
14

Ultrafast-Lane-Detection-Inference-Pytorch-

Example scripts for the detection of lanes using the ultra fast lane detection model in Pytorch.
Python
69
star
15

ONNX-HybridNets-Multitask-Road-Detection

Python scripts for performing road segemtnation and car detection using the HybridNets multitask model in ONNX.
Python
67
star
16

Sapiens-Pytorch-Inference

Minimal code and examnples for inferencing Sapiens foundation human models in Pytorch
Python
62
star
17

BlazeFace-TFLite-Inference

Python scripts to detect faces in Python with the BlazeFace Tensorflow Lite models
Python
61
star
18

ONNX-CenterSnap-6D-Pose-and-Shape-Estimation

Python scripts for performing 6D pose estimation and shape reconstruction using the CenterSnap model in ONNX
Python
55
star
19

onnx-Ultra-Fast-Lane-Detection-Inference

Example scripts for the detection of lanes using the ultra fast lane detection model in ONNX.
Python
48
star
20

PyTorch-High-Res-Stereo-Depth-Estimation

Python scripts form performing stereo depth estimation using the high res stereo model in PyTorch .
Python
47
star
21

ONNX-HITNET-Stereo-Depth-estimation

Python scripts form performing stereo depth estimation using the HITNET model in ONNX.
Python
46
star
22

TFLite-Mobile-Generic-Object-Localizer

Python TFLite scripts for detecting objects of any class in an image without knowing their label.
Python
45
star
23

depthai-android-jni-example

Android example to get the rgb and disparity images from the OAK-D device connected to a phone.
C++
44
star
24

Mediapipe-Halloween-Examples

Python scripts using the Mediapipe models for Halloween.
Python
40
star
25

ONNX-HRNET-Human-Pose-Estimation

Python scripts for performing 2D human pose estimation using the HRNET family models in ONNX.
Python
39
star
26

ONNX-FastACVNet-Depth-Estimation

Python scripts performing stereo depth estimation using the Fast-ACVNet model in ONNX.
Python
39
star
27

ONNX-MobileStereoNet

Python scripts for performing stereo depth estimation using the MobileStereoNet model in ONNX
Python
39
star
28

ONNX-YOLOv5-Instance-Segmentation

Python scripts performing instance segmentation using the YOLOv5 model in ONNX.
Python
36
star
29

TFLite-HITNET-Stereo-depth-estimation

Python scripts form performing stereo depth estimation using the HITNET model in Tensorflow Lite.
Python
36
star
30

ONNX-HAWP-Line-Detection

Python scripts for performing line detection using the HAWP model in ONNX.
Python
35
star
31

ONNX-RAFT-Optical-Flow-Estimation

Python scripts for performing optical flow estimation using the RAFT model in ONNX
Python
35
star
32

Pytorch-KP2D-Feature-Tracking

Python scripts for performing 2D feature detection and tracking using the KP2D model in Pytorch
Python
33
star
33

ONNX-ImageNet-1K-Object-Detector

Python scripts for performing object detection with the 1000 labels of the ImageNet dataset in ONNX. The repository combines a class agnostic object localizer to first detect the objects in the image, and next a ResNet50 model trained on ImageNet is used to label each box.
Python
33
star
34

ONNX-LSTR-Lane-Detection

Python scripts for performing lane detection using the LSTR model in ONNX
Python
32
star
35

ONNX-YOLO-World-Open-Vocabulary-Object-Detection

Python scripts performing Open Vocabulary Object Detection using the YOLO-World model in ONNX.
Python
30
star
36

ONNX-SCDepth-Monocular-Depth-Estimation

Python scripts for performing monocular depth estimation using the SC_Depth model in ONNX
Python
29
star
37

ONNX-NeuFlowV2-Optical-Flow

Python scripts performing optical flow estimation using the NeuFlowV2 model in ONNX.
Python
26
star
38

Midasv2_1_small-TFLite-Inference

Python scripts to perform monocular depth estimation using Python with the Midas v2.1 small Tensorflow Lite model.
Python
25
star
39

onnx-perf-test

A simple Python tool to measure the performance of ONNX models.
Python
24
star
40

depthai-android-unity-example

Unity project with an example on how to run the depthai library in Android.
C++
24
star
41

ONNX-YOLOv9-MIT-Object-Detection

Python scripts performing object detection using the YOLOv9 MIT model in ONNX.
Python
23
star
42

cap_from_youtube

Get an OpenCV video capture from an YouTube video URL
Python
22
star
43

ONNX-msg_chn_wacv20-depth-completion

Python script for performing depth completion from sparse depth and rgb images using the msg_chn_wacv20. model in ONNX
Python
22
star
44

ONNX-GLPDepth

Python scripts for performing monocular depth estimation using the GLPDepth model in ONNX
Python
21
star
45

depthai-TopFormer-Semantic-Segmentation

Python scripts performing on devive semantic segmentation using the TopFormer model in depthai.
Jupyter Notebook
21
star
46

TfLite-Ultra-Fast-Lane-Detection-Inference

Example scripts for the detection of lanes using the ultra fast lane detection model in Tensorflow Lite.
Python
21
star
47

Social-Distance-Feedback-For-The-Blind

A social distancing feedback system for the blind using the OAK-D camera
Jupyter Notebook
21
star
48

UnrealCV-stereo-depth-generation

Python scripts for generating synthetic stereo depth data using the UnrealCV library.
Python
19
star
49

ONNX-TopFormer-Semantic-Segmentation

Python scripts performing semantic segmentation using the TopFormer model in ONNX.
Python
17
star
50

ONNX-Inference-Template

Template project for performing inference on ONNX models in Python.
Python
17
star
51

ONNX-PackNet-SfM

Python scripts for performing monocular depth estimation using the PackNet-SfM model in ONNX
Python
17
star
52

ONNX-Object-Localization-Network

Python scripts performing class agnostic object localization using the Object Localization Network model in ONNX.
Python
16
star
53

shoeDetection

Shoe detection with Tensorfllow js
Jupyter Notebook
15
star
54

Tensorflow-Mobile-Generic-Object-Localizer

Python Tensorflow 2 scripts for detecting objects of any class in an image without knowing their label.
Python
15
star
55

ONNX-MST-Image-Inpainting

Python scripts for performing Image Inpainting using the MST model in ONNX
Python
13
star
56

Tapir-Pytorch-Inference

Minimal code for Tapir model inference in Pytorch
Python
13
star
57

OpenImages-Yolo-converter

Convert OpenImages labels to be used for YOLOv3
Python
12
star
58

Mediapipe-Christmas-Examples

Python scripts using the Mediapipe models for Christmas.
Python
11
star
59

ONNX-ACVNet-Stereo-Depth-Estimation

About Python scripts form performing stereo depth estimation using the ACVNet model in ONNX.
Python
11
star
60

lsd_modern

(WIP) C++ code to try to modernize the original Line Segment Detect code
C++
10
star
61

ONNX-CoEx-Stereo-Depth-estimation

Python scripts form performing stereo depth estimation using the CoEx model in ONNX.
Python
10
star
62

ONNX-YOLOv10-Object-Detection

Python scripts performing object detection using the YOLOv10 model in ONNX.
Python
9
star
63

HuggingFace-API-ONNX-Conversion

Repository to showcase how to export models to ONNX using a client to a Hugging Face space.
Python
9
star
64

libusbAndroidTest

Example of an Android app for testing libusb with Java and C++.
C++
7
star
65

ONNX-PlanarReconstruction

Python scripts performing plane segmentation using PlanarReconstruction model in ONNX.
Python
7
star
66

TFLite-MobileStereoNet

Python scripts for performing stereo depth estimation using the MobileStereoNet model in Tensorflow Lite.
Python
7
star
67

Deeplab-Cityscapes-inference

Python program to visualize Deeplab (trained on Cityscapes dataset) results.
Python
6
star
68

nuScenes-Lane-Detection

Lane detection program (Python) for the nuScenes mini dataset
Python
6
star
69

libusbNativeAndroidTest

Example of a Native Android app for testing the libusb library in Android.
C
5
star
70

mmcv_onnx_ops_build

Repository for building the MMCV ONNX compatible ops to run them in onnxruntime.
CMake
5
star
71

ONNX-SAGENet-Driver-Attention-Estimation

Python scripts for performing driver attention estimation using the SAGENet model in ONNX
Python
5
star
72

Pytorch-SAGENet-Driver-Attention-Estimation

Python scripts for performing driver attention estimation using the SAGENet model in Pytorch
Python
4
star
73

Perception-Neuron-Read-Calc-File

Program to read the .calc file from the Perception Neuron (Noitom)
MATLAB
4
star
74

DepthaiAndroidMinimal

Minimal Android Studio project to build a depthai-core application without using a prebuild library.
Java
4
star
75

ONNX-Split-HITNET-Stereo-Depth-Estimation

Python scripts for performing Stereo Depth Estimation using the HITNET model split into two parts in ONNX.
Python
3
star
76

libUVC-OpenCV-cpp

Example script to capture images from USB cameras using the libUVC library and OpenCV in C++.
C
3
star
77

TFLite-msg_chn_wacv20-depth-completion

Python script for performing depth completion from sparse depth and rgb images using the msg_chn_wacv20. model in Tensorflow Lite.
Python
2
star
78

test-mapillary-python

Python scripts for testing the mapillary python library functionalities
Python
1
star
79

Jekyll-Posts-From-Github

Automatically generate Jekyll posts from all the README files of a Github user.
Python
1
star
80

Deeplab-ADE20K-Inference

Python program to visualize Deeplab (trained on ADE20K dataset) results.
Jupyter Notebook
1
star
81

cv_videowriter

Wrapper library around the OpenCV VideoWriter function with some extra features
Python
1
star
82

ibaiGorordo

1
star
83

tf2-object-detection-inference

Python program to perform object detection inference with Tensorflow 2.0.
Python
1
star