Closed cedarconnor closed 1 year ago
Hi @cedarconnor thanks for the kind words and whoa that is indeed quite the beast of a machine! I'm easily getting 30fps for hand tracking on my laptop so something odd is going on somewhere for sure.
The component can use anything that appears as a webcam on your machine as a video source, as it's essentially running a web browser to host MediaPipe inside TouchDesigner. So if you have a capture card or webcam you want to use as a video source in MediaPipe, you should be able to select it directly from the Webcam dropdown and skip the whole SpoutCam setup. The only caveat is (for now at least) the source capture device needs to be 1280 x 720.
If things are still running slowly, the analyze1 CHOP at the top of the screen should give you timing information from the MediaPipe process itself to tell you how long that's taking to process. If that part is taking forever, the issue is somewhere inside the MediaPipe component itself.
Otherwise if that looks reasonable, I'd try disabling the Video Device In TOP and just putting your camera directly into MediaPipe - if that fixes your FPS issue than the issue lies with SpoutCam somewhere. If it doesn't then uh not sure... it should just work. There's not really any configuration outside of that :\
Bit more info.
"webrender1" is showing this error.
Hmm, that would imply the web page that's hosting all the MediaPipe tasks is dying for some reason. It could be because MediaPipe itself is having a hard time running (not sure why).
When it's (sort of) working, what kind of times are you seeing in analyze1?
If they're any more than 15ms or so then something is going wrong within MediaPipe itself possibly due to it not being able to figure out GPU or CPU resources properly. Let me know if that is the case, I'm currently working on implementing the latest release of MediaPipe that has a few various fixes (nothing too exciting), but it may address your issue and I can make you a build to try out.
I think the tracking is happening faster than the video FPS. I can see skeletal motion between video frame updates. Still streaming via Spout. Unfortunately, I can't use my webcam directly. I suspect that's because it's a full-HD camera. Windows does not give me the option to change my webcam resolution. If I understand the mediapipe implementation, the webpage is directly accessing the camera so there's no way to down rez the webcam in TD.
Thanks for the help!
Huh, this is interesting. It's showing the detection time is only take 1ms or so on average, so that huge rig is certainly paying off there!
As long as one of the resolutions your camera supports is 720p (which pretty much everything can do these days), you should be able to use your webcam as a direct input to the MediaPipe component. The web page specifically asks the camera for 1280 x 720 so as long as it's a format the camera can do (even if it's less than the maximum the camera supports), it should work. You can check if it's a mode your camera supports if you take a look at the Video Device In TOP, select your camera, and see what options it has.
The other thing that occured to me is some webcams can only be used in one place. So if you have the Video Device In enabled, it will prevent the camera from working as a webcam source in the Media Pipe component. That's something I run into with my USB webcam and may be what's going on if you just get a black screen (or loading forever screen) when trying to select your webcam directly.
Going to close this for now, but please re-open if you have any other questions or it still doesn't work in the latest release.
First of all, thanks for all the wonderful open source work!
Hand tracking works through spoutCam however the performance is quite poor. Perhaps five to seven frames per second. I'm running a high end machine. New threadrippers, 256 gigs of ram, A6000 graphics card. Windows 10 pro Version 10.0.19045 Build 19045, TD 2022.33910.
One thing I am confused about is whether there's a way to track directly from a video device or webcam. I can't get that method to work at all. Only SpoutCam input seems to work.