【问题标题】:Using face detection feature of react-native-camera使用 react-native-camera 的人脸检测功能
【发布时间】:2019-01-30 09:26:01
【问题描述】:

我正在尝试使用 react-native-camera 模块在我的 React Native 应用程序中进行实时人脸检测。我的基本模块(只是相机)在应用程序中工作正常,并且导入 FaceDetector 类工作正常,但是当我将 onFacesDetected 属性添加到我的相机组件时,它会破坏应用程序。发生这种情况时,整个应用程序都会冻结,我必须重建它。我在任何地方都没有收到正式的错误消息,但 Xcode 说:

Thread 19: EXC_BAD_ACCESS (code=1, address=0x10ac70000)

有人知道怎么回事吗?

顺便说一句:这只发生在设备上。它在 iOS 模拟器中运行良好

【问题讨论】:

    标签: ios xcode react-native react-native-camera


    【解决方案1】:

    面部检测在 iOS 上是可选的。如果您需要它们,则需要在您的项目中安装 Google Mobile Vision 框架,如下面的链接所述。

    https://github.com/react-native-community/react-native-camera#face-detection-or-text-recognition-steps

    【讨论】:

      【解决方案2】:

      react-native-camera 默认不包含人脸检测功能。 GMV(Google Mobile Vision)用于 iOS RNCamera 的人脸检测,因此您需要安装这些依赖项才能使其正常工作。

      我使用 cocoa pod 来安装这些依赖项。

      这是我的 podfile:

      平台:ios,'9.0'

      target '你的应用名称'做

      pod 'React', :path => '../node_modules/react-native'

      pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

      pod 'GoogleMobileVision/FaceDetector'

      pod 'GoogleMobileVision/Detector'

      pod 'GoogleMobileVision/MVDataOutput'

      pod 'react-native-camera',路径:'../node_modules/react-native-camera',子规范:[ “人脸检测器” ]

      结束

      【讨论】:

        猜你喜欢
        • 2020-06-28
        • 2015-03-14
        • 2017-06-01
        • 2019-12-01
        • 2019-11-18
        • 2020-10-24
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多