()
| 4 | let ctx = canvas.getContext("2d"); |
| 5 | |
| 6 | const setUpCamera = () => { |
| 7 | navigator.mediaDevices.getUserMedia({ |
| 8 | video: { width: 600, height: 400 }, |
| 9 | audio: false, |
| 10 | }).then(stream => { |
| 11 | video.srcObject = stream; |
| 12 | }) |
| 13 | } |
| 14 | |
| 15 | const detectFaces = async () => { |
| 16 | const prediction = await model.estimateFaces(video, false); |