luicfrr / react-native-vision-camera-face-detector

Vision Camera Frame Processor Plugin to detect faces using MLKit Face Detector
https://www.npmjs.com/package/react-native-vision-camera-face-detector
MIT License
77 stars 15 forks source link

Working example #1

Closed fernandatoledo closed 4 months ago

fernandatoledo commented 4 months ago

Hey! I followed instructions and try to use your processor. No matter how many faces are shown in my camera I always get: detection result {"faces": {}, "frame": {"height": 1920, "orientation": "portrait", "width": 1080}}. Can you provide a working example? It would be extremely helpful.

luicfrr commented 4 months ago

Hello,

Vision camera have an orientation issue and I think this is the reason you're not getting any face detected.

Try locking your phone orientation/rotation on portrait mode and then turn your device left, right or even upside-down then see if it detect anything.

In my case I noticed that frame image was rotated -90º then I had to adjust it here: https://github.com/nonam4/react-native-vision-camera-face-detector/blob/6eff9a6bcfdbf3d682d32616d491991886a25df4/android/src/main/java/com/visioncamerafacedetector/VisionCameraFaceDetectorPlugin.java#L220

luicfrr commented 4 months ago

Are you using an android device? or iphone?

luicfrr commented 4 months ago

Closing due to inactivity