react-native - react-native-camera人脸检测
问题描述
使用react-native-camera尝试面部识别不起作用。
<RNCamera
faceDetectionMode={RNCamera.Constants.FaceDetection.Mode.fast}
onFacesDetected={(face)=>{
console.log(face)
}}
/>
我得到错误
TypeError: cannot read property fast of undefined" triggered by faceDetectionMode={RNCamera.Constants.FaceDetection.Mode.fast}
当我打印出来
console.log('RNCAMERA',RNCamera.Constants)
{"AutoFocus": {"off": 0, "on": 2},....., "FaceDetection": {}, .....}
人脸检测为空。
我正在使用 react-native-camera@3.42.2
我也按照这些步骤让它工作。目前只测试ios。
pod 'react-native-camera', path: '../node_modules/react-native- camera', subspecs: ['FaceDetectorMLKit']
cd ios && pod install && cd ..
我在 pod install 上遇到的错误是
Unable to find a specification for `MLImage (= 1.0.0-beta1)` depended upon by `MLKitVision`
这是一个错误吗?
解决方案
推荐阅读
- python - 不能在 SQL Server 代理作业上使用谷歌包?
- python - python:比较日期时间熊猫
- typescript - 如何在 Typescript 中将类型定义为接口
- javascript - 从 useEffect 调用调用的函数渲染太快并且中断,重新渲染后正常工作
- wix - Wix 安装程序 - 自定义 MsiRMFilesInUse 对话框
- networking - 如何将 Compute Engine 实例连接到私有 VPN
- wordpress - 在 PHPUnit 中为我的 WordPress 插件模拟对象时遇到问题
- javascript - 如何在JS中编写概率函数
- qt - Raspberry Pi 错误的 Qt 和 OpenCv 交叉编译
- entity-framework-core - 具有复合主键的实体之间的多对多关系