Keras_face_identification_realtime icon indicating copy to clipboard operation
Keras_face_identification_realtime copied to clipboard

Threshold explanation

Open elb3k opened this issue 5 years ago • 0 comments

Thank you for this demo.

I was wondering about exact value of threshold that you used in this function

def identify_face(self, features, threshold=100):
        distances = []
        for person in self.precompute_features_map:
            person_features = person.get("features")
            distance = sp.spatial.distance.euclidean(person_features, features)
            distances.append(distance)
        min_distance_value = min(distances)
        min_distance_index = distances.index(min_distance_value)
        if min_distance_value < threshold:
            return self.precompute_features_map[min_distance_index].get("name")
        else:
            return "?"

Is there any particular reason for threshold 100. I want to apply thresholding for my own MobileFaceNet face identification project. But euclidean distances are all in a range [0, 1] (in my case).

Is there any universal function to measure similarity between two feature embeddings ( No matter their range or size)?

elb3k avatar Jul 24 '20 05:07 elb3k