victordibia / handtrack.js

A library for prototyping realtime hand detection (bounding box), directly in the browser.

Home Page:https://victordibia.com/handtrack.js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Webcam faces wrong direction

jarble opened this issue · comments

When I tried to use this demo on my Microsoft Surface computer, the webcam detection was working with the front-facing webcam instead of the rear-facing webcam, so it was facing away from my keyboard. Could this demo be modified to allow switching webcams, so that it will work correctly on computers with more than one webcam?

Hi @jarble,
Thanks for mentioning this.
Yes, the demo can be extended to enable camera switching. The demo uses the html5

Once I have some time, I'll modify the demo.
-V

Just in case anybody else comes across this: This actually works out of the box. You do not have to call the handtrack.startVideo method - you can start the video yourself along with settings that you may want to adjust to your application such as the facingMode: "user" setting. You can then simply call the model.detect method iteratively as is done in the example game.
Nice architecture!

I have a live demo utilized handtrak.js, the camera is working both on laptop and mobile, I had added feature to switch between front and back camera
https://bensonruan.com/magic-fire-in-your-hand-with-handtrack-js