核心APIcss
faceDetector .detect(img) .then(faces => faces.forEach(face => { const { height, width, top, left } = face.boundingBox; frameRef.current.style.cssText = ` display: inline-block; height: ${height * scale}px; width: ${width * scale}px; transform: translate(${left * scale}px, ${top * scale}px); `; }) ) .catch(error => {});
體驗地址: https://ouweiya.github.io/Fac...git
github: https://github.com/ouweiya/FaceDetectorgithub