shubham0204 / FaceRecognition_With_FaceNet_Android

Face Recognition using the FaceNet model and MLKit on Android.
https://towardsdatascience.com/using-facenet-for-on-device-face-recognition-with-android-f84e36e19761
Apache License 2.0
252 stars 88 forks source link

I am getting same name for every image in the frame #18

Closed gowthami77 closed 3 years ago

gowthami77 commented 3 years ago

HI i am getting same name for every image i.e., first image name. may i know what is the problem. Please inform me is there any issue with code? If that face doesn't added in the folder also it is showing random name

vishmanihub commented 3 years ago

I tried and getting the first name in the image folder. It seems that L2norm is giving the first folder name, The average minimum always results to the name of the first folder. The cosine seems to go back and forth some time depending on image size. I tried changing matrix.rotate the sign in the angle as some one suggested, It does not work for me.

shubham0204 commented 3 years ago

@gowthami77, I have verified the code that computes the average scores and outputs the name with the best score ( in FrameAnalyser.kt ). The code seems perfectly fine, so we need to investigate more on your issue.

gowthami77 commented 3 years ago

If the image is not stored also it is displaying random name on face

vishmanihub commented 3 years ago

Yes the average code is fine. I am wondering getFaceEmbedding inputs. Do we need to normalize the CmeraFrameBitmap?. I have saved 2 individual pictures taken using the phone camera converted to png for the model. Now when I try to identify the same face using the app, It is not doing identifying properly

venkakat83 commented 3 years ago

If the image is not stored also it is displaying random name on face

Yes that is how the code is now, we are not checking any tunning parameter. For L2 norm the lowest value and cosine with highest value.

I suggest to keep boundary values to show the name of the face. If it is out of defined boundry name it as "UNKNOWN".

shubham0204 commented 3 years ago

I am closing this issue due to inactivity. If someone else experiences this particular issue, do open it once again.