Skip to content

Instantly share code, notes, and snippets.

@p01 p01/index.html
Last active Sep 26, 2018

Embed
What would you like to do?
Face detection in 280 bytes

Face detection in 280 bytes by p01

Tweet sized version of https://xem.github.io/miniFaceDetection/

Requires Chrome + chrome://flags/#enable-experimental-web-platform-features To enable fast mode / multiple faces: FaceDetector({fastMode: true, maxDetectedFaces: 2})

For more Audio Visual projects, check www.p01.org

<canvas id=a><video id=v><svg onload="navigator.getUserMedia({video:1},n=m=>{v.src=top.URL.createObjectURL(m);setInterval(async(c=a.getContext`2d`)=>{c.drawImage(v,0,0,208,150);for(i of await new FaceDetector().detect(a))with(i.boundingBox)c.strokeRect(x,y,width,height)},9)},n)">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.