MCarlomagno / FaceRecognitionAuth

😀🤳 Simple face recognition authentication (Sign up + Sign in) written in Flutter using Tensorflow Lite and Firebase ML vision library.
BSD 3-Clause "New" or "Revised" License
389 stars 194 forks source link

The model mobilefacenet.tflite doesn't produce accurate result #28

Closed ThangVuNguyenViet closed 3 years ago

ThangVuNguyenViet commented 3 years ago

Hi, I'm having trouble with the model.

I compared the _euclideanDistance of array result from frames of my face, it yields the distance around .7-.9, which is below the threshold, which is correct.

However, when I compare the array result of my face with my sister's face, it also yields the same distance, around .7-.9, which is still below the threshold, while it shouldn't be.

I tested it on both Android and iOS, it shows the same result

fuadarradhi commented 3 years ago

in my case, just check length is 192.

double _euclideanDistance(List e1, List e2) {
    if (e1 == null || e2 == null || e1.length != 192 || e2.length != 192) throw Exception("Null or empty argument");

    double sum = 0.0;
    for (int i = 0; i < e1.length; i++) {
      sum += pow((e1[i] - e2[i]), 2);
    }
    return sqrt(sum);
  }
ThangVuNguyenViet commented 3 years ago

I've made some checks, and I am sure that the length of both List are equally 192

matejsvajger commented 3 years ago

I'm having the same issue.

The lengths are correct, but the distance is always below the threshold of 1 for any face.

@ThangVuNguyenViet did you find a solution for this?


Update: My problem seems to be related to #12 -- Cross-platform registration/sign-in