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

相关文章
相关标签/搜索