Metrics used in training a face recognition model.

API Reference

This module provides metric used in face recognition

class gluonfr.metrics.FaceVerification

Compute confusion matrix of 1:1 problem in face verification or other fields. Use update() to collect the outputs and compute distance in each batch, then use get() to compute the confusion matrix and accuracy of the val dataset.

  • nfolds (int, default is 10) –
  • thresholds (ndarray, default is None.) – Use np.arange to generate thresholds. If thresholds=None, np.arange(0, 2, 0.01) will be used for euclidean distance.
  • far_target (float, default is 1e-3.) – This is used to get the verification accuracy of expected far.
  • dist_type (int, default is 0.) – Option value is {0, 1}, 0 for euclidean distance, 1 for cosine similarity. Here for cosine distance, we use 1 - cosine as the final distances.