在 react-use-face-detection 中卸载组件后 react-webcam 未关闭

问题描述 投票:0回答:1

我正在尝试使用 react-use-face-detection 和 @mediapipe 库实现人脸识别组件。当我卸载组件时 react-webcam 没有成功关闭。我如何修复该错误?

const { webcamRef, boundingBox, isLoading, detected, facesDetected } = useFaceDetection({
    faceDetectionOptions : {
      model: 'short'
    },
    faceDetection: new FaceDetection.FaceDetection({
      locateFile: (file) => {
        return `/face_detection/${file}`
      },
    }),
    camera: ({ mediaSrc, onFrame, width, height }) =>
      new Camera(mediaSrc, {
        onFrame,
        width,
        height,
      }),
  });

如何解决这个问题?

reactjs camera face-detection webcam-capture
1个回答
0
投票

你设法解决了这个问题吗?

© www.soinside.com 2019 - 2024. All rights reserved.