Google Chrome 人脸识别功能 https://ouweiya.github.io/FaceDetector

Google Chomre 自带人脸检测API尝鲜

核心API

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...

github: https://github.com/ouweiya/FaceDetector

你可能感兴趣的:(react.js,chrome,javascript)