Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

React native face detection not working for me (iOS)

$
0
0

I am trying to build a face detection module in objective-c using react native. I am using onFacesdetected from react native. But it is not working for me. Below is the code :

<RNCamera
        ref={ref => {
          this.camera = ref;
        }}
        style = {styles.preview}
        type={RNCamera.Constants.Type.front}
        flashMode={RNCamera.Constants.FlashMode.off}
        faceDetectionMode={RNCamera.Constants.FaceDetection.Mode.fast}
        onFacesDetected={(d)=>{console.log('onFacesDetected',d);}}
        permissionDialogTitle={'Permission to use camera'}
        permissionDialogMessage={'We need your permission to use your camera phone'}
        onGoogleVisionBarcodesDetected={({ barcodes }) => {
          console.log(barcodes)
        }}
    />

When the camera opens for the first time it prints 'onFacesDetected', { type: 'face', faces: [], target: 27 } after that upon bringing the face in front of camera it does nothing.

Any help would be appreciated.


Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>