Google Chrome 人臉識別功能 https://ouweiya.github.io/FaceDetector

Google Chomre 自帶人臉檢測API嚐鮮

核心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 => {});

image

體驗地址: https://ouweiya.github.io/Fac...git

github: https://github.com/ouweiya/FaceDetectorgithub

相關文章
相關標籤/搜索