Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows sdk autodetection #132

Merged
merged 13 commits into from
Jun 29, 2021

Conversation

shagren
Copy link
Contributor

@shagren shagren commented Jun 11, 2021

Some magic for windows users

I have tested only for my configuration. Haven't any idea will it work on x32 or with custom SDK location.

@codecov
Copy link

codecov bot commented Jun 11, 2021

Codecov Report

❗ No coverage uploaded for pull request base (develop@23b99f8). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             develop     #132   +/-   ##
==========================================
  Coverage           ?   81.23%           
==========================================
  Files              ?       12           
  Lines              ?      762           
  Branches           ?        0           
==========================================
  Hits               ?      619           
  Misses             ?      143           
  Partials           ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 23b99f8...bfc497a. Read the comment docs.

@lpasselin
Copy link
Collaborator

lpasselin commented Jun 15, 2021

Thanks a lot, this will reduce the windows issues we receive by a lot.
I will add a few minor changes like logging and merge this in the next week.

@lpasselin
Copy link
Collaborator

Changes I made:

  • rename .loader to .module
  • refactor and created the file win32_utils
  • added env variable K4A_DLL_DIR to directly specify where k4a.dll is.
  • detect starting from %ProgramFiles% or %PROGRAMFILES% (PROGRAMFILES seems to be windows 10)
  • more information on raise ImportError
  • edit readme

@shagren I could not test the changes since I don't have a windows system anymore. Would you mind doing a quick test on your side?

@shagren
Copy link
Contributor Author

shagren commented Jun 29, 2021

Minor fix and ow is ok:

(venv) C:\Users\altis\PycharmProjects\test\pyk4a>pip install git+https://github.com/shagren/pyk4a@windows-sdk-autodetection
Collecting git+https://github.com/shagren/pyk4a@windows-sdk-autodetection
  Cloning https://github.com/shagren/pyk4a (to revision windows-sdk-autodetection) to c:\users\altis\appdata\local\temp\pip-req-build-ocn8bfo9
  Running command git clone -q https://github.com/shagren/pyk4a 'C:\Users\altis\AppData\Local\Temp\pip-req-build-ocn8bfo9'
  Running command git checkout -b windows-sdk-autodetection --track origin/windows-sdk-autodetection
  Branch 'windows-sdk-autodetection' set up to track remote branch 'windows-sdk-autodetection' from 'origin'.
  Switched to a new branch 'windows-sdk-autodetection'
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Requirement already satisfied: numpy in c:\users\altis\pycharmprojects\test\venv\lib\site-packages (from pyk4a==1.2.5) (1.21.0)
Requirement already satisfied: python-version>="3.4" in c:\users\altis\pycharmprojects\test\venv\lib\site-packages (from pyk4a==1.2.5) (0.0.2)
Building wheels for collected packages: pyk4a
  Building wheel for pyk4a (PEP 517) ... done
  Created wheel for pyk4a: filename=pyk4a-1.2.5-cp38-cp38-win_amd64.whl size=33569 sha256=71ae04b92d4ff90a8647ab141ea07cf23138ccfd33279e365b9b0
f87e7530379
  Stored in directory: C:\Users\altis\AppData\Local\Temp\pip-ephem-wheel-cache-u_bccl1v\wheels\bd\23\e5\fff733384f10e40c4b088351feb0002fcf6e972
c35cc3b6b2e
Successfully built pyk4a
Installing collected packages: pyk4a
Successfully installed pyk4a-1.2.5

(venv) C:\Users\altis\PycharmProjects\test\pyk4a>python -c "import pyk4a; device=pyk4a.PyK4A();device.open();device.start(); print(device.get_c
apture().color.shape)"
(720, 1280, 4)

@lpasselin lpasselin merged commit 0940fa8 into etiennedub:develop Jun 29, 2021
@lpasselin lpasselin mentioned this pull request Aug 7, 2021
lpasselin added a commit that referenced this pull request Aug 7, 2021
* fix install fail on recent python with python_version requirement

* Add functions to access system timestamps for each image (#122)

* fix memory usage problem for calls to capture.transformed_ir (#125)

* version 1.2.4

* Adding a context manager for playback objects (#130)


* Added support for with statements

Co-authored-by: David Dunn <[email protected]>

* Windows sdk autodetection (#132)

* Autodetecting Kinect SDK for windows

* Fixes

* Fixes

* DLL Autodetection

* Latest fixes

* update version

* rephrase readme

* refactor and add K4A_DLL_DIR

* minor readme change

* rename loader to module

* fix multiline string

* Update module.py

fix lint

* Minor fix

Co-authored-by: Louis-Philippe Asselin <[email protected]>

* Add develop branch for ci target (#139)

Co-authored-by: Johan von Forstner <[email protected]>
Co-authored-by: Louis-Philippe Asselin <[email protected]>
Co-authored-by: David Dunn <[email protected]>
Co-authored-by: David Dunn <[email protected]>
Co-authored-by: Ilya Gruzinov <[email protected]>
lpasselin added a commit that referenced this pull request Aug 7, 2021
* fix install fail on recent python with python_version requirement

* Add functions to access system timestamps for each image (#122)

* fix memory usage problem for calls to capture.transformed_ir (#125)

* version 1.2.4

* Adding a context manager for playback objects (#130)


* Added support for with statements

Co-authored-by: David Dunn <[email protected]>

* Windows sdk autodetection (#132)

* Autodetecting Kinect SDK for windows

* Fixes

* Fixes

* DLL Autodetection

* Latest fixes

* update version

* rephrase readme

* refactor and add K4A_DLL_DIR

* minor readme change

* rename loader to module

* fix multiline string

* Update module.py

fix lint

* Minor fix

Co-authored-by: Louis-Philippe Asselin <[email protected]>

* Add develop branch for ci target (#139)

* rename 1.2.5 to 1.3.0

Co-authored-by: Johan von Forstner <[email protected]>
Co-authored-by: Louis-Philippe Asselin <[email protected]>
Co-authored-by: David Dunn <[email protected]>
Co-authored-by: David Dunn <[email protected]>
Co-authored-by: Ilya Gruzinov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants