TD crashing when using HandTracking in OAKExamples.toe

I am trying to use my OAK-1 camera for hand tracking. I am working on Windows 11 and attempted to use the OAK examples provided in TD, located at:
C:\Program Files\Derivative\TouchDesigner\Samples\OAK\OAKExamples.toe.

After disabling the “Use3D” button in the “handTracking” container and initializing the camera, everything appears to work fine. However, as soon as I place my hand in front of the camera, TouchDesigner freezes and crashes. I noticed that the “oakselect_joints” CHOP is receiving data right before TouchDesigner freezes.
The same crash also occurs when using the OAK-D S2 camera.

I am currently using TouchDesigner version 2023.12120.

Thanks in advance.
-Bene

Hey @BenFri

Thanks for the report.

I was able to reproduce and this is logged for a dev to look into it.

Best,
Michel

Thank you for looking into it!
Will I receive a notification here as soon as the bug is fixed?
Best,
Bene

Hi @BenFri,

we do post an update here when a fixed version is available.

cheers
Markus

Hi snaut,

could you roughly estimate how long this might take? We are currently working on a project that needs to be completed by the end of February, and we have already purchased the OAK hardware.

Apologies for the curious questions.
Thank you,
Bene

Hi @BenFri

we are actively investigating but haven’t found a solution yet.
Can you see if you can generate a OAK crash report with this script:

import cv2
import depthai as dai
from json import dump
from os.path import exists

# Connect to device and start pipeline
with dai.Device() as device:

    if device.hasCrashDump():
        crashDump = device.getCrashDump()
        commitHash = crashDump.depthaiCommitHash
        deviceId = crashDump.deviceId

        json = crashDump.serializeToJson()
        
        i = -1
        while True:
            i += 1
            destPath = "crashDump_" + str(i) + "_" + deviceId + "_" + commitHash + ".json"
            
            if exists(destPath):
                continue

            with open(destPath, 'w', encoding='utf-8') as f:
                dump(json, f, ensure_ascii=False, indent=4)

            print("Crash dump found on your device!")
            print(f"Saved to {destPath}")
            print("Please report to developers!")
            break
    else:
        print("There was no crash dump found on your device!")

You can run it in a seperate TouchDesigner process right after the camera / TouchDesigner crashes.

cheers
Markus

I just tried to run the script in a separate TD file right after TD crashed. But got an error message that i could not connect to the Device. When running the script as soon as TD closes it prints “There was no crash dump found on your device!”

Hi @BenFri,

we were able to also create this crash when running the original example in edge mode (which we implemented) available from here:

We are looking for a solution and in the meantime will try to implement the host version.

Cheers
Markus

1 Like

Hi @BenFri

It looks like this is an issue with the depthai SDK, Luxonis has said they will come with a with a fix for their depthai SDK near end of Febuary that should address this problem. If you have a pro license with pro support hours, we can work on getting a separate build with a downgraded stable working SDK. If not you will probably need to wait until Luxonis releases their fix.

Best,
Huck

Hey, thanks for the message.
Unfortunately we only have a Touchdesigner Commercial license, so we have to wait until the end of February. We also ran the original deapth_ai_handtracking model and it works on Mac, but unfortunately not on Windows.
Cheers,
Bene

Hello everyone,
Luxonis has informed me that the fix is already available on the ‘develop’ branch of the ‘depthai-python’ GitHub repository (GitHub - luxonis/depthai-python at develop).
I installed the original HandTracking example (GitHub - geaxgx/depthai_hand_tracker: Running Google Mediapipe Hand Tracking models on Luxonis DepthAI hardware (OAK-D-lite, OAK-D, OAK-1,...)) and installed depthai with:

python3 -m pip install --extra-index-url https://artifacts.luxonis.com/artifactory/luxonis-python-snapshot-local depthai==2.29.0.0.dev0+818211d7d970a931cc128b0b98f495af631092f4

and it is running successfully.

Now, my question is: How can I change which depthai version is used in the TouchDesigner OAK examples?

Best regards,
Bene

Hello,

We will be updating our DepthAI version and will reply to this post with a link to a new build from Official when it comes out.

Thanks for your patience!

Huck

Hello,

Thanks for your feedback! I just wanted to check in again—do you know when this update will happen? I really need a concrete answer now, as we have to deliver the exhibit by March 19th. If there isn’t a link by next week, I’ll have to explore other options. Appreciate your help!

Bene

Hello everyone,

I have now tried to replace the depthai.cp311-win_amd64.pyd file and other folders in "C:\Program Files\Derivative\TouchDesigner\bin\Lib\site-packages" with the DepthAI version 2.29.0.0.dev0+818211d7d970a931cc128b0b98f495af631092f4.

Within TouchDesigner, I can also verify the updated version using the following commands in a text DAT:

import depthai as dai
print('depthai version:', dai.__version__)
print('depthai location:', dai.__file__)

Unfortunately, when initializing the OAK Device CHOP, I get the same error as described in the existing forum post:

Is there perhaps a simple workaround to fix this error without having to wait for a newly updated build?

Thanks a lot for your effort,
Bene

Hi @BenFri

Sorry for the delay, while updating to that specified build I was still having issues with the HandTracking in both the original Github project and in TD. I contacted Luxonis to see if they are able to reproduce. It seems that they are planning to release a new version of DepthAI on Friday with fixes. In the meantime I am currently building a version of TD with the version of DepthAI specified in that command and will post a link by today. Please let me know if you are still having problems in the new build.

Best,

Huck

Hi @BenFri
https://www.dropbox.com/scl/fi/8jd0xdzx4xdw1kxns80on/TouchDesignerWebInstaller.2023.12251.80.exe?rlkey=ch6j0ujd28y6ovf2xnpq0b7cc&e=1&dl=0

Here is the link of TD running DepthaiAI v2.29.0.0.dev0+818211d7. Let me know if you run into any problems.

Best
Huck

Hi huck,
thanks for the quick response. I’ve had the version running all day, and the camera only froze once, but TouchDesigner didn’t crash because of it.
What other issues did you encounter when testing this version?
Thanks again for your help!

Best regards,
Bene

Hi @BenFri

The freeze was the issue I was having, but if this is okay for you there are no problems.

Huck

Hey huck,
Thanks for your help. Our installation is now up and running, but recently the camera has been freezing more frequently, even though it used to run stably for several days or even weeks. Do you have any idea what might be causing this freeze?
Also, I noticed that a new version of TouchDesigner was released — does it already include a newer DepthAI version, the one with the updated hand tracking?

Hi @BenFri

Hm, you can try setting the TOUCH_TEXT_CONSOLE environment variable to 1 to get some extra debugging information. When a freeze or crash occurs with the DepthAI library it should output additional information to the console.

The new release of TD still has the old version of DepthAI, I do however have an updated build that also has the most recent release of DepthAI (v2.30.0) that you can try out. In the end I think this is an issue on the DepthAI SDK side, so the amount help I can do is limited. Does the freeze happen consistently by some action (i.e. I was seeing freezing when moving my hand very quickly towards and away from the camera) or does it happen when no tracking is done?

Best,

Huck