Skip to main content

A library for creating and comparing voice biometrics using GMM models.

Project description

pyometrics

A Python library for creating and comparing voice biometrics using Gaussian Mixture Models (GMMs). You can train a biometric model from a set of audio files and then compare new samples against that model to get a similarity score.

Features

  • MFCC + Delta Feature Extraction
  • GMM Training via scikit-learn
  • User-Defined Minimum Required Audio Files (min_files)
  • Supports .wav, .mp3, .m4a, .flac by default

Installation

Install from PyPI:

pip install pyometrics

Usage

  1. Train (or create) a voice biometric:
from pyometrics import create_voice_biometric

create_voice_biometric(
    folder_path="path/to/audio/folder",
    model_path="my_biometric.gmm",
    min_files=5  # specify how many audio files must exist
)
  • The library expects at least min_files audio files in the folder.
  • The GMM model is saved to the file my_biometric.gmm.
  1. Compare a new audio sample:
from pyometrics import compare_voice_biometric

score = compare_voice_biometric(
    audio_path="path/to/new_audio.mp3",
    model_path="my_biometric.gmm"
)
print("Similarity Score (log-likelihood):", score)
  • A higher (less negative) log-likelihood indicates closer similarity.

Example

Suppose you have at least 10 .mp3 files of the same speaker in samples_for_biometric/. You can do:

from pyometrics import create_voice_biometric, compare_voice_biometric

create_voice_biometric(
    folder_path="samples_for_biometric",
    model_path="example.gmm",
    min_files=10
)

score = compare_voice_biometric(
    audio_path="test_sample.m4a",
    model_path="example.gmm"
)
print("Score:", score)  # The higher, the more similar

Requirements

  • Python 3.6+
  • librosa
  • numpy
  • scikit-learn

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyometrics-0.1.1.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyometrics-0.1.1-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file pyometrics-0.1.1.tar.gz.

File metadata

  • Download URL: pyometrics-0.1.1.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for pyometrics-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5b91c6486b7c3ad4e9817dadbdf91fa52d0bca3da0393bb38dd44ad22ce4716f
MD5 f6f8235c5e15e63eca616b5be97d8d6d
BLAKE2b-256 75c19777a18e8473be5946b518dd69c14d29e89407ca0083339c1b87a30b6206

See more details on using hashes here.

File details

Details for the file pyometrics-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pyometrics-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for pyometrics-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b232c716548efcf393c2b3bf92c753dead1b990e8b72bac5b34821c62f29c147
MD5 15d2e2a9c6f10f7291f9c7b1c2b556d0
BLAKE2b-256 cc3de64f24479a8924a50231ec5e490c8eeec18e4bbe05ae9245c4dcc1c0e529

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page