Keras_face_identification_realtime
Keras_face_identification_realtime copied to clipboard
Threshold explanation
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)?