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

body tracking implementation #39

Draft
wants to merge 85 commits into
base: develop
Choose a base branch
from
Draft

Conversation

lpasselin
Copy link
Collaborator

Previous PR was a mess so let's continue here.

Implements body tracking with #ifdef BODY_TRACKING macros.

See README.md for instructions on how to install.

Enabling body tracking this way is a hack but we don't need to maintain two repositories.

Is there any other simple way to do this?

@shagren shagren mentioned this pull request Sep 22, 2020
@romilpunetha
Copy link

Any tentative release date for this?

@lpasselin
Copy link
Collaborator Author

lpasselin commented Dec 20, 2020 via email

@romilpunetha
Copy link

No sorry. It used to work but now it would need a couple hours of refactor to be updated. Is this a feature you would use? Would you be willing to help me test if I work on it?

On Sun., Dec. 20, 2020, 15:21 Romil Punetha, @.***> wrote: Any tentative release date for this? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#39 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTB77F7EUWCBDMIXIY3RODSVZMELANCNFSM4PXAI55Q .

Yes, I have a kinect device and am looking at making use of the body tracking sdk using python. I can help test it.

@codecov
Copy link

codecov bot commented Dec 21, 2020

Codecov Report

Merging #39 (da97299) into develop (7d18e35) will decrease coverage by 0.65%.
The diff coverage is 75.00%.

❗ Current head da97299 differs from pull request most recent head 007fb38. Consider uploading reports for the commit 007fb38 to get more accurate results

@@             Coverage Diff             @@
##           develop      #39      +/-   ##
===========================================
- Coverage    91.55%   90.90%   -0.65%     
===========================================
  Files            5        5              
  Lines          308      319      +11     
===========================================
+ Hits           282      290       +8     
- Misses          26       29       +3     
Impacted Files Coverage Δ
pyk4a/config.py 95.89% <72.72%> (-4.11%) ⬇️
pyk4a/pyk4a.py 89.52% <100.00%> (+0.05%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@lpasselin
Copy link
Collaborator Author

@romilpunetha it works again!

For details, see property Capture.body_skeleton in pyk4a/capture.py

And example/pose_display_2d.py

@romilpunetha
Copy link

@romilpunetha it works again!

For details, see property Capture.body_skeleton in pyk4a/capture.py

And example/pose_display_2d.py

Great! I'll give it a try now.

@romilpunetha
Copy link

romilpunetha commented Dec 22, 2020

@romilpunetha it works again!

For details, see property Capture.body_skeleton in pyk4a/capture.py

And example/pose_display_2d.py

I'm getting the following error in reinstalling:

error: option --enable-body-tracking not recognized

Using the following command:

pip install pyk4a --no-use-pep517 --global-option=build_ext --global-option="-IC:\Program Files\Azure Kinect SDK v1.4.1\sdk\include" --global-option="-LC:\Program Files\Azure Kinect SDK v1.4.1\sdk\windows-desktop\amd64\release\lib" --global-option="build_ext"  --global-option="--enable-body-tracking"

@romilpunetha
Copy link

I also edited the setup.py to not depend on the body tracking flag. The setup completed. However, the example is throwing the following error:

$ python example/pose_display_2d.py
Traceback (most recent call last):
  File "example/pose_display_2d.py", line 19, in <module>
    body_skeleton = capture.body_skeleton
AttributeError: 'PyK4ACapture' object has no attribute 'body_skeleton'

@lpasselin
Copy link
Collaborator Author

lpasselin commented Dec 22, 2020

The error you are getting is from wrong python code being used.

Maybe you are reusing an older pyk4a version. Make sure you install with --upgrade or pip uninstall pyk4a before installing the body tracking version. Also, try calling the example script from an other directory.

Be careful with the include paths. You are including the regular SDK files. We need them but also the body tracking sdk (it is possible they are already included). The following command is from the readme of the body tracking branch. It installs directly the code from the live branch. Notice the path is k4abt which stands for k4a body tracking:

pip install -v --no-use-pep517 --no-build-isolation --upgrade git+https://github.com/etiennedub/pyk4a.git@feature/body-tracking --global-option="build_ext" --global-option="-I/home/louis/p/pyk4a/k4abt/usr/include/" --global-option="-L/home/louis/p/pyk4a/k4abt/usr/lib/" --global-option="--enable-body-tracking"

@romilpunetha
Copy link

romilpunetha commented Dec 23, 2020

This is the full command:

pip install pyk4a --no-use-pep517 --no-build-isolation --global-option=build_ext --global-option="-IC:\Program Files\Azure Kinect SDK v1.4.1\sdk\include;C:\Program Files\Azure Kinect Body Tracking SDK\sdk\include" --global-option="-LC:\Program Files\Azure Kinect SDK v1.4.1\sdk\windows-desktop\amd64\release\lib;C:\Program Files\Azure Kinect Body Tracking SDK\sdk\windows-desktop\amd64\release\lib" --upgrade git+https://github.com/etiennedub/pyk4a.git@feature/body-tracking   --global-option="--enable-body-tracking"

I'm getting the following error due to compiler issues...fixing it:

 pyk4a/pyk4a.cpp(8): fatal error C1021: invalid preprocessor command 'warning'

@lpasselin
Copy link
Collaborator Author

lpasselin commented Dec 23, 2020 via email

@romilpunetha
Copy link

Had some issues with the nvidia library. Fixed those and it seems to be working now.
Thanks a lot for the help @lpasselin!

@romilpunetha
Copy link

Any way to run the same on ubuntu 18.04? I used the following command to install this on windows:

pip install --no-use-pep517 --no-build-isolation --global-option=build_ext --global-option="-IC:\Program Files\Azure Kinect SDK v1.4.1\sdk\include;C:\Program Files\Azure Kinect Body Tracking SDK\sdk\include" --global-option="-LC:\Program Files\Azure Kinect SDK v1.4.1\sdk\windows-desktop\amd64\release\lib;C:\Program Files\Azure Kinect Body Tracking SDK\sdk\windows-desktop\amd64\release\lib" . --force-reinstall

For ubuntu, this is what I've done for now:

sudo apt install libk4a1.4-dev
sudo apt install k4a-tools

However, when I try to run the examples, it gives the following error:

AttributeError: 'PyK4ACapture' object has no attribute 'body_skeleton'

@romilpunetha
Copy link

romilpunetha commented Mar 25, 2021

Any way to run the same on ubuntu 18.04? I used the following command to install this on windows:

pip install --no-use-pep517 --no-build-isolation --global-option=build_ext --global-option="-IC:\Program Files\Azure Kinect SDK v1.4.1\sdk\include;C:\Program Files\Azure Kinect Body Tracking SDK\sdk\include" --global-option="-LC:\Program Files\Azure Kinect SDK v1.4.1\sdk\windows-desktop\amd64\release\lib;C:\Program Files\Azure Kinect Body Tracking SDK\sdk\windows-desktop\amd64\release\lib" . --force-reinstall

For ubuntu, this is what I've done for now:

sudo apt install libk4a1.4-dev
sudo apt install k4a-tools

However, when I try to run the examples, it gives the following error:

AttributeError: 'PyK4ACapture' object has no attribute 'body_skeleton'

The command for linux is simpler:

pip install --no-use-pep517 --no-build-isolation --global-option=build_ext  --global-option="--enable-body-tracking" .

But I'm getting this error now:

/tmp/onnxruntime/onnxruntime/core/providers/cuda/cuda_call.cc:123 bool onnxruntime::CudaCall(ERRTYPE, const char*, const char*, ERRTYPE, const char*) [with ERRTYPE = cudaError; bool THRW = true] /tmp/onnxruntime/onnxruntime/core/providers/cuda/cuda_call.cc:117 bool onnxruntime::CudaCall(ERRTYPE, const char*, const char*, ERRTYPE, const char*) [with ERRTYPE = cudaError; bool THRW = true] CUDA failure 100: no CUDA-capable device is detected ; GPU=32672 ; hostname=romil-Precision-7530 ; expr=cudaSetDevice(device_id_); 


[2021-03-26 00:31:33.626] [error] [t=11666] [K4ABT] ../src/TrackerHost/TrackerHost.cpp (185): Create(). /tmp/onnxruntime/onnxruntime/core/providers/cuda/cuda_call.cc:123 bool onnxruntime::CudaCall(ERRTYPE, const char*, const char*, ERRTYPE, const char*) [with ERRTYPE = cudaError; bool THRW = true] /tmp/onnxruntime/onnxruntime/core/providers/cuda/cuda_call.cc:117 bool onnxruntime::CudaCall(ERRTYPE, const char*, const char*, ERRTYPE, const char*) [with ERRTYPE = cudaError; bool THRW = true] CUDA failure 100: no CUDA-capable device is detected ; GPU=32672 ; hostname=romil-Precision-7530 ; expr=cudaSetDevice(device_id_); 


[2021-03-26 00:31:33.626] [error] [t=11666] [K4ABT] ../src/sdk/k4abt.cpp (38): tracker->Create(sensor_calibration, config) returned failure in k4abt_tracker_create()
Traceback (most recent call last):
 File "example/pose_display_2d.py", line 19, in <module>
   body_skeleton = capture.body_skeleton
 File "/home/romil/scifi/lib/python3.7/site-packages/pyk4a/capture.py", line 155, in body_skeleton
   self._calibration.body_tracker_handle,
 File "/home/romil/scifi/lib/python3.7/site-packages/pyk4a/calibration.py", line 131, in body_tracker_handle
   raise K4AException("Cannot create body tracker handle")
pyk4a.errors.K4AException: Cannot create body tracker handle

@romilpunetha
Copy link

Any way to run the same on ubuntu 18.04? I used the following command to install this on windows:

pip install --no-use-pep517 --no-build-isolation --global-option=build_ext --global-option="-IC:\Program Files\Azure Kinect SDK v1.4.1\sdk\include;C:\Program Files\Azure Kinect Body Tracking SDK\sdk\include" --global-option="-LC:\Program Files\Azure Kinect SDK v1.4.1\sdk\windows-desktop\amd64\release\lib;C:\Program Files\Azure Kinect Body Tracking SDK\sdk\windows-desktop\amd64\release\lib" . --force-reinstall

For ubuntu, this is what I've done for now:

sudo apt install libk4a1.4-dev
sudo apt install k4a-tools

However, when I try to run the examples, it gives the following error:

AttributeError: 'PyK4ACapture' object has no attribute 'body_skeleton'

The command for linux is simpler:

pip install --no-use-pep517 --no-build-isolation --global-option=build_ext  --global-option="--enable-body-tracking" .

But I'm getting this error now:

/tmp/onnxruntime/onnxruntime/core/providers/cuda/cuda_call.cc:123 bool onnxruntime::CudaCall(ERRTYPE, const char*, const char*, ERRTYPE, const char*) [with ERRTYPE = cudaError; bool THRW = true] /tmp/onnxruntime/onnxruntime/core/providers/cuda/cuda_call.cc:117 bool onnxruntime::CudaCall(ERRTYPE, const char*, const char*, ERRTYPE, const char*) [with ERRTYPE = cudaError; bool THRW = true] CUDA failure 100: no CUDA-capable device is detected ; GPU=32672 ; hostname=romil-Precision-7530 ; expr=cudaSetDevice(device_id_); 


[2021-03-26 00:31:33.626] [error] [t=11666] [K4ABT] ../src/TrackerHost/TrackerHost.cpp (185): Create(). /tmp/onnxruntime/onnxruntime/core/providers/cuda/cuda_call.cc:123 bool onnxruntime::CudaCall(ERRTYPE, const char*, const char*, ERRTYPE, const char*) [with ERRTYPE = cudaError; bool THRW = true] /tmp/onnxruntime/onnxruntime/core/providers/cuda/cuda_call.cc:117 bool onnxruntime::CudaCall(ERRTYPE, const char*, const char*, ERRTYPE, const char*) [with ERRTYPE = cudaError; bool THRW = true] CUDA failure 100: no CUDA-capable device is detected ; GPU=32672 ; hostname=romil-Precision-7530 ; expr=cudaSetDevice(device_id_); 


[2021-03-26 00:31:33.626] [error] [t=11666] [K4ABT] ../src/sdk/k4abt.cpp (38): tracker->Create(sensor_calibration, config) returned failure in k4abt_tracker_create()
Traceback (most recent call last):
 File "example/pose_display_2d.py", line 19, in <module>
   body_skeleton = capture.body_skeleton
 File "/home/romil/scifi/lib/python3.7/site-packages/pyk4a/capture.py", line 155, in body_skeleton
   self._calibration.body_tracker_handle,
 File "/home/romil/scifi/lib/python3.7/site-packages/pyk4a/calibration.py", line 131, in body_tracker_handle
   raise K4AException("Cannot create body tracker handle")
pyk4a.errors.K4AException: Cannot create body tracker handle

Solved this by disabling secure boot on ubuntu.

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.

4 participants