WebAR-rocks / WebAR.rocks.face

WebAR.rocks face detection and tracking JavaScript library
https://webar.rocks
Other
84 stars 27 forks source link

Tracking image #27

Closed sorenharfagri closed 3 years ago

sorenharfagri commented 3 years ago

Hello, Thanks for the incredible work, library is awesome!

I'm trying to adapt a react glasses demo to work with uploaded picture, instead of a video camera capture, is there any way or example?

xavierjs commented 3 years ago

Hi,

It is possible, take a look at this demo: https://github.com/WebAR-rocks/WebAR.rocks.face/tree/master/demos/faceReplacement/gif

sorenharfagri commented 3 years ago

I made this by creating a gl texture from my photo, then directly setting _glVideoTexture in WebARRocksFaceThreeHelper, and passing it to WEBARROCKSFACE.set_inputTexture().

Is there possibility to not request user videocam?

xavierjs commented 3 years ago

If you set videoSettings init argument to null, the user camera should not be requested (more info here: https://github.com/WebAR-rocks/WebAR.rocks.face#optional-init-arguments )