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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章