#Q: ml5 face-tracking runs much faster than hand-tracking on Chromebooks. But why?

2 messages · Page 1 of 1 (latest)

grim gyro
#

Dear Coding Train folks,
I am a huge fan of the amazing work done by Dan and all of you, especially the new next-gen ml5 library.

I have been playing around with it a bit. Here is an example using hand-tracking:
https://openprocessing.org/sketch/2654309
and here is one using face-tracking:
https://openprocessing.org/sketch/2672733

On a Macbook, both sketches run just fine. However, on an old Chromebook, of the sort used by my students (I teach in a K-8 school), the hand-tracking one runs very noticeably slower. The face-tracking one is quite fast on a Chromebook, but the hand-tracking code is very laggy. That is surprising to me, because both tasks should be about as hard as each other, in terms of computational demands. If anything, I would suspect that hand-tracking should be easier.

There is probably a similar performance-difference on my Macbook too, but it's only noticeable on older and slower hardware.

I'm wondering whether maybe the ml5 hand-tracking code uses an old and somewhat inefficient model. I'll bet there are some very fast and lightweight JS-compatible hand-tracking models out there these days. However, I don't know enough to know which ones might be suitable.

By the way, the hand-tracking code linked above uses the mediapipe runtime, but the tfjs runtime isn't any faster.

On a separate but related note, it would be great to know if there are any ml5 models that work well on an iPhone or Android, using the built-in front-facing camera. The sketches linked above do not really work properly on mobile, and again I am too ignorant to know how to fix that!

Any help greatly appreciated, and thanks again for making these great libraries!

Raj
P.S. I found the ml5 discord channel, but it seems to be very inactive these days. So, I'm posting this here instead. I hope this is ok!

glass grotto
#

These projects are great!! Unfortunately I don't have a chromebook to test but hte speed is probably tied to the GPU and runtime. ml5 just wraps the mediapipe handpose model you could try testing the model directly with the native JS code but i suspect you'll get the same results. Not sure why it would be slower than facemesh, but ml5 isn't using an old model it's using the latest one as far as I know!