Skip to content
This repository was archived by the owner on Aug 22, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
0e8fafe
PythonK4A: Adding initial directory structure, k4atypes.py which defi…
JonathanESantos Dec 9, 2020
b77771a
PythonK4A: Updating __init__.py to point to the "api" directory (rena…
JonathanESantos Dec 9, 2020
f1e90ba
Python K4A: Rearranging directory tree so that it matches the expecta…
JonathanESantos Dec 9, 2020
b2443dd
Python k4a api: Put ctypes structs inside k4atypes.py.
JonathanESantos Dec 10, 2020
1e8677c
Python k4a api: Adding to setup.py so that "pip install -e .[test]" w…
JonathanESantos Dec 10, 2020
071ab03
Python k4a api: An enum name with AUTO was mistakenly replaced with _…
JonathanESantos Dec 10, 2020
de120dd
Python k4a api: Adding __repr__() functions to structs in order to pr…
JonathanESantos Dec 10, 2020
ad64501
Python k4a api: Adding a check that the required dlls are in the _lib…
JonathanESantos Dec 10, 2020
8e5e3a1
Python k4a api: Adding the rest of the bindings for the functions tha…
JonathanESantos Dec 10, 2020
5d9db7b
Python k4a: Adding tests to call the functions in the dll.
JonathanESantos Dec 11, 2020
744ccb9
Python k4a: Adding missing enum in color resolution, and adding tests…
JonathanESantos Dec 12, 2020
f85d8d2
Python k4a: Changing @unittest.skip to @unittest.expectedfail for tho…
JonathanESantos Dec 12, 2020
c1a85d9
Python k4a: Updating docs. Removing platform tag in building the k4a …
JonathanESantos Dec 12, 2020
3c25d68
Python API: Renaming enums and structs to Python naming convention.
JonathanESantos Dec 16, 2020
88be9e5
Python API: Moving all internal files and symbols into the _bindings/…
JonathanESantos Dec 16, 2020
da31b2a
Python API: Moving handle structs from _k4a.py back to _k4atypes.py s…
JonathanESantos Dec 16, 2020
a080d08
Renaming modules inside _bindings subpackage to not include underscor…
JonathanESantos Dec 16, 2020
ee41c9a
Python api: Adding Device class which corresponds to a device with a …
JonathanESantos Dec 17, 2020
fddad4e
Python API: Adding capture and image classes to encapsulate capture a…
JonathanESantos Dec 22, 2020
c44293c
Python API: Bug in Image class was missing a height_pixels in one lin…
JonathanESantos Dec 22, 2020
76b3e83
Python API: Adding Calibration and Transformation wrapper classes.
JonathanESantos Dec 23, 2020
cd14e98
Python API: Renaming a test file.
JonathanESantos Dec 23, 2020
d023902
Python API: Adding more tests to test the Device, Capture, Image, and…
JonathanESantos Dec 24, 2020
359525d
Python API: Fixing transformation functions and their tests.
JonathanESantos Dec 28, 2020
ef8887b
Python API: Adding example code that makes use of the Python API.
JonathanESantos Dec 29, 2020
456c0b6
Python API: Adding docstrings *.py files and a Doxygen settings file …
JonathanESantos Dec 31, 2020
cd9a0da
Python API: Adding a main page to the documentation, and fixing a bug…
JonathanESantos Dec 31, 2020
f48bf0c
Python API: Adding lines in build_wheel.ps1 to generate the documenta…
JonathanESantos Dec 31, 2020
6bf9c0c
Making minor changes to get this k4a package to work in both Windows …
JonathanESantos Jan 8, 2021
0e53962
Forgot to commit the minor changes to get this k4a package to work in…
JonathanESantos Jan 8, 2021
1b6b6aa
Python API: Specifying specific library names that the python code wi…
JonathanESantos Jan 8, 2021
49a52fd
Python API: Modifying the build_wheel.csh script to look for libdepth…
JonathanESantos Jan 8, 2021
d560c73
Python API: Updating building.md for clarity.
JonathanESantos Jan 15, 2021
c567635
Python API: Fixing bug in tests that causes failure in some of the te…
JonathanESantos Jan 22, 2021
038b9f6
Removing forced-loading of depthengine library. Just load k4a.dll and…
JonathanESantos Mar 23, 2021
ccbc0bf
In the wheel build scripts, adding test to check if doxygen is instal…
JonathanESantos Mar 23, 2021
f1902be
Fixing markdown documents.
JonathanESantos Mar 23, 2021
7b69e00
Adding blurb about installing pip in Linux.
JonathanESantos Mar 23, 2021
55d6ba7
Changing ctypes.c_ulonglong to ctypes.c_size_t where it matches the f…
JonathanESantos Mar 23, 2021
a742479
Changing c_ulonglong to c_size_t in the tests to match the change in …
JonathanESantos Mar 23, 2021
bd1cad9
Fixing build script in Linux to look for depthengine.so* inside a sub…
JonathanESantos Mar 23, 2021
d65d0b7
Fixing documents that say the Linux depthengine.so.2.0 must be in a s…
JonathanESantos Mar 24, 2021
57802b3
The build script for Linux needs to check for depthengine.so* in the …
JonathanESantos Mar 24, 2021
f71cbea
Making slight changes to the building.md documentation for more clarity.
JonathanESantos Mar 24, 2021
cf713d6
Fixing a minor typo in the comments of image_transformations.py, and …
JonathanESantos Mar 24, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Python K4A: Rearranging directory tree so that it matches the expecta…
…tion of what gets imported when users use "import k4a".

Adding a powershell script to build a wheel file. Adding empty docs files.
  • Loading branch information
JonathanESantos committed Dec 9, 2020
commit f1e90ba9739ddcbcc9fb68b79523c4d15e6f0068
37 changes: 16 additions & 21 deletions src/python/k4a/docs/PLACEHOLDER.md → src/python/k4a/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
# Azure Kinect SDK (K4A)
# Azure Kinect Python API(K4A)

Welcome to the Azure Kinect Sensor SDK! We hope you can use it to build many great applications and participate in the project. Don't be shy to ask questions, and provide feedback. See [Azure.com/Kinect](https://Azure.com/kinect) for device
Welcome to the Azure Kinect Python API! We hope you can use it to build many great applications and participate in the project. Don't be shy to ask questions, and provide feedback. See [Azure.com/Kinect](https://Azure.com/kinect) for device
info and available documentation.

[![Build Status
(develop)](https://dev.azure.com/ms/Azure-Kinect-Sensor-SDK/_apis/build/status/Microsoft.Azure-Kinect-Sensor-SDK%20(Public)?branchName=develop)](https://dev.azure.com/ms/Azure-Kinect-Sensor-SDK/_build/latest?definitionId=133&branchName=develop)
[![Nuget](https://img.shields.io/nuget/vpre/Microsoft.Azure.Kinect.Sensor.svg)](https://www.nuget.org/packages/Microsoft.Azure.Kinect.Sensor/)

## Introduction

**Azure Kinect SDK** is a cross platform (Linux and Windows) user mode SDK to read data from your Azure Kinect device.
**K4A** is a Python user mode API to read data from your Azure Kinect device.

## Why use the Azure Kinect SDK
## Why use K4A

The Azure Kinect SDK enables you to get the most out of your Azure Kinect camera. Features include:
K4A enables you to get the most out of your Azure Kinect camera. Features include:

* Depth camera access
* RGB camera access and control (e.g. exposure and white balance)
Expand All @@ -23,30 +19,30 @@ The Azure Kinect SDK enables you to get the most out of your Azure Kinect camera
* Camera frame meta-data access for image resolution, timestamp and temperature
* Device calibration data access

All image data is encapsulated in numpy arrays, allowing Python users to easily use the data in OpenCV
and other packages that work with numpy arrays.

## Installation

To use the SDK, please refer to the installation instructions in [usage](docs/usage.md)
To use the Python API, please refer to the installation instructions in [usage](docs/usage.md)

## Documentation

API documentation is avaliable [here](https://microsoft.github.io/Azure-Kinect-Sensor-SDK/).
API documentation is available [here]().

## Building

Azure Kinect SDK uses CMake to build. For instructions on how to build this SDK please see
K4A uses Python's setuptools to build a wheel file for distribution.
For instructions on how to build this distributable, please see
[building](docs/building.md).

## Versioning

The Azure Kinect SDK uses semantic versioning, please see [versioning.md](docs/versioning.md) for more information.

## Testing

For information on writing or running tests, please see [testing.md](docs/testing.md)

## Contribute

We welcome your contributions! Please see the [contribution guidelines](CONTRIBUTING.md).
We welcome your contributions! Please see the [contribution guidelines](../../../CONTRIBUTING.md).

## Feedback

Expand All @@ -56,8 +52,7 @@ For SDK feedback or to report a bug, please file a [GitHub Issue](https://github

There are several places where the sample code can be found.

- In this repository: [Azure-Kinect-Sensor-SDK\examples](https://github.com/microsoft/Azure-Kinect-Sensor-SDK/tree/develop/examples)- each example has a readme page that describes it and the steps to set it up.
- [Azure-Kinect-Samples](https://github.com/microsoft/Azure-Kinect-Samples) repository. There are multiple examples of how to use both Sensor and Body tracking SDKs.
- In this repository: [K4A\examples](examples)- each example has a readme page that describes it and the steps to set it up.

## Q&A

Expand All @@ -83,6 +78,6 @@ email to ensure we received your original message. Further information, includin

## License and Microsoft Support for Azure Kinect Sensor SDK

[MIT License](LICENSE)
[MIT License](../../../LICENSE)

[Microsoft Support for Azure Kinect Sensor SDK](microsoft-support.md)
[Microsoft Support for Azure Kinect Sensor SDK](../../../microsoft-support.md)
1 change: 0 additions & 1 deletion src/python/k4a/__init__.py

This file was deleted.

12 changes: 0 additions & 12 deletions src/python/k4a/_bindings/_k4atypes.py

This file was deleted.

4 changes: 0 additions & 4 deletions src/python/k4a/api/__init__.py

This file was deleted.

28 changes: 28 additions & 0 deletions src/python/k4a/build_wheel.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Create a virtual environment and activate it.
python -m venv temp_build_venv
./temp_build_venv/Scripts/activate

# Install the package in editable mode so that it installs dependencies. These are needed for sphinx docs.
python -m pip install --upgrade pip
pip install -e .


# Build the .whl file and place it in a build/ folder.
pip install wheel
pip wheel . -w build
Remove-Item ./build/* -Exclude k4a*.whl -Recurse -Force


# Build the docs and move them to the build/ folder.
#cd ./docs
#powershell -File ./build_docs.ps1
#Move-Item ./build/html ../build/docs/


# Deactivate virtual environment and delete it.
./temp_build_venv/Scripts/deactivate.bat
Remove-Item -LiteralPath "temp_build_venv" -Force -Recurse


# Copy the docs/ folder into the build/ folder.
#Copy-Item -Path .\docs -Destination .\build -Recurse
Empty file added src/python/k4a/docs/testing.md
Empty file.
15 changes: 4 additions & 11 deletions src/python/k4a/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,16 @@
author_email='[email protected]',
description='Python interface to Azure Kinect API.',
keywords=['k4a', 'Azure Kinect', 'Kinect for Azure'],
url='',
url='https://github.com/JonathanESantos/Azure-Kinect-Sensor-SDK/tree/python_ctypes_bindings',
license='Copyright (C) Microsoft Corporation. All rights reserved.',
python_requires='>=3.6',
packages=find_packages(exclude=['docs', 'data']),
extras_require={
'dev': [
],
},
packages=find_packages('src'),
package_dir={'': 'src'},
package_data={"k4a":["_libs/*"]},
zip_safe=False,
tests_require=[
'pytest',
],
package_data={
'k4a': [
'_lib/*',
]
},
install_requires=[
],
)
1 change: 1 addition & 0 deletions src/python/k4a/src/k4a/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .k4atypes import *
Empty file.
21 changes: 21 additions & 0 deletions src/python/k4a/src/k4a/_bindings/_k4atypes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'''k4atyps.py

Defines Python ctypes equivalent structures to those defined in k4atypes.h.

Credit given to hexops's github contribution for the
ctypes.Structure definitions and ctypes function bindings.
https://github.com/hexops/Azure-Kinect-Python
'''

# Add top-level k4a directory to path.
import sys
import os

k4a_top_level = os.path.dirname(os.path.dirname(__file__))
sys.path.insert(0, k4a_top_level)

import ctypes
import struct

import k4a

4 changes: 0 additions & 4 deletions src/python/k4a/tests/__init__.py

This file was deleted.

8 changes: 0 additions & 8 deletions src/python/k4a/tests/test_k4atypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
'''

import unittest

# Add top-level k4a directory to path.
import sys
import os
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(__file__))))

import k4a

Expand Down Expand Up @@ -145,7 +140,4 @@ def test_k4a_firmware_signature_t(self):
self.assertEqual(e.value, next(enum_values))

if __name__ == '__main__':



unittest.main()