Coder Social home page Coder Social logo

ma7555 / evalify Goto Github PK

View Code? Open in Web Editor NEW
19.0 5.0 20.0 2.7 MB

Evaluate your biometric verification models literally in seconds.

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%
python face-recognition face-verification evaluation evaluation-metrics evaluation-framework

evalify's Introduction

evalify

Logo

License DOI Python 3.7 | 3.8 | 3.9 | 3 Release Status CI Status Documentation Status Code style: black PyPI Downloads/Month

Evaluate Biometric Authentication Models Literally in Seconds.

Installation

Stable release:

pip install evalify

Bleeding edge:

pip install git+https://github.com/ma7555/evalify.git

Used for

Evaluating all biometric authentication models, where the model output is a high-level embeddings known as feature vectors for visual or behaviour biometrics or d-vectors for auditory biometrics.

Usage

import numpy as np
from evalify import Experiment

rng = np.random.default_rng()
nphotos = 500
emb_size = 32
nclasses = 10
X = rng.random((self.nphotos, self.emb_size))
y = rng.integers(self.nclasses, size=self.nphotos)

experiment = Experiment()
experiment.run(X, y)
experiment.get_roc_auc()
print(experiment.roc_auc)
print(experiment.find_threshold_at_fpr(0.01))

How it works

  • When you run an experiment, evalify tries all the possible combinations between individuals for authentication based on the X and y parameters and returns the results including FPR, TPR, FNR, TNR and ROC AUC. X is an array of embeddings and y is an array of corresponding targets.
  • Evalify can find the optimal threshold based on your agreed FPR and desired similarity or distance metric.

Documentation:

Features

  • Blazing fast implementation for metrics calculation through optimized einstein sum and vectorized calculations.
  • Many operations are dispatched to canonical BLAS, cuBLAS, or other specialized routines.
  • Smart sampling options using direct indexing from pre-calculated arrays with total control over sampling strategy and sampling numbers.
  • Supports most evaluation metrics:
    • cosine_similarity
    • pearson_similarity
    • cosine_distance
    • euclidean_distance
    • euclidean_distance_l2
    • minkowski_distance
    • manhattan_distance
    • chebyshev_distance
  • Computation time for 4 metrics 4.2 million samples experiment is 24 seconds vs 51 minutes if looping using scipy.spatial.distance implemntations.

TODO

  • Safer memory allocation. I did not have issues but if you ran out of memory please manually set the batch_size argument.

Contribution

  • Contributions are welcomed, and they are greatly appreciated! Every little bit helps, and credit will always be given.
  • Please check CONTRIBUTING.md for guidelines.

Citation

  • If you use this software, please cite it using the metadata from CITATION.cff

evalify's People

Contributors

ma7555 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

waildzess

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.