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
75 stars 16 forks source link

Face always return empty object after upgrade vision camera to 4.0.0-beta.5 #18

Closed robertyulisman closed 3 months ago

robertyulisman commented 3 months ago

hey @nonam4 i have some issue after upgrade vision camera, before i am using 3.9.1 but there is some bug like stretch previewing camera and other bug, but after upgrade to 4.0.0-beta.5 bug is solved but no face detected or return empty object on detect faces

image

but when i rotate the camera, the face is detected WhatsApp Image 2024-03-22 at 11 55 49_3b81d7f5

when i change to normal position or potrait the face not detected WhatsApp Image 2024-03-22 at 11 55 49_6e9d3007

i test on android 11 there is no problem, can you help for it ?

i am using react native vision camera react-native-vision-camera": "^4.0.0-beta.9 testing on android 10 xiaomy pocophone

robertyulisman commented 3 months ago

test on android 14 at redmi phone after update to react native vision camera react-native-vision-camera": "^4.0.0-beta.9

and using from example, the marker also not on the face place

https://github.com/nonam4/react-native-vision-camera-face-detector/assets/55675899/d51bbd93-3516-4949-ac5a-c22fce7a7163

luicfrr commented 3 months ago

I'll take a look into vision camera updates soon. I'm currently working on another private project.

But you can try to fix it locally changing native code... I think this is something related to orientation in this line: https://github.com/nonam4/react-native-vision-camera-face-detector/blob/d21a61f826c55aa4f43c99f941666704e5ac79ef/android/src/main/java/com/visioncamerafacedetector/VisionCameraFaceDetectorPlugin.java#L243

try removing fixedOrientationvariable and pass orientation.toDegrees() directly to InputImage and see if the error is solved

robertyulisman commented 3 months ago

i have update it @nonam4 , but the marker not on centered face,

image

image

image

robertyulisman commented 3 months ago

i try too change on javascript file orientation in 'lanscape-right' from 270 to 360, but i dont think this will really fix for another device,

image

image

image

luicfrr commented 3 months ago

@robertyulisman I'll take a look on this issue this week. I was waiting to release a new version when vison camera releases a new non-beta version 😅

luicfrr commented 3 months ago

@robertyulisman Can you give me a feedback about new released 1.4 version?

robertyulisman commented 3 months ago

sure @nonam4 i will check it, thanks for your help