Skip to main content

LibriLight ABX

This is a wrapper module around the abx implementation found in libri-light/eval. This module only adds a wrapper function to directly call abx evaluation and a dataclass object annotating all arguments as well as a setup.py to allow installation as a module.

Installation

You can install this module from pip directly using the following command : pip install zerospeech-libriabx

Or you can install from source by cloning this repository and running : pip install .

Usage

From command line

A command line is created to allow running abx evaluations.

usage: libri-abx [-h] [--path_checkpoint PATH_CHECKPOINT] [--file_extension {.pt,.npy,.wav,.flac,.mp3}] [--feature_size FEATURE_SIZE] [--cuda] [--mode {all,within,across}]
                 [--distance_mode {euclidian,cosine,kl,kl_symmetric}] [--max_size_group MAX_SIZE_GROUP] [--max_x_across MAX_X_ACROSS] [--out OUT]
                 path_data path_item_file

ABX metric

positional arguments:
  path_data             Path to directory containing the data
  path_item_file        Path to the .item file

optional arguments:
  -h, --help            show this help message and exit
  --path_checkpoint PATH_CHECKPOINT
                        Path to a CPC checkpoint. If set, the apply the model to the input data to compute the features
  --file_extension {.pt,.npy,.wav,.flac,.mp3}
  --feature_size FEATURE_SIZE
                        Size (in s) of one feature
  --cuda                Use the GPU to compute distances
  --mode {all,within,across}
                        Choose the mode of the ABX score to compute
  --distance_mode {euclidian,cosine,kl,kl_symmetric}
                        Choose the kind of distance to use to compute the ABX score.
  --max_size_group MAX_SIZE_GROUP
                        Max size of a group while computing theABX score. A small value will make the code faster but less precise.
  --max_x_across MAX_X_ACROSS
                        When computing the ABX across score, maximumnumber of speaker X to sample per couple A,B. A small value will make the code faster but less precise.
  --out OUT             Path where the results should be saved

From python API

To call the abx evaluation from python code you can use the following example :

from pathlib import Path
import libriabx

args = libriabx.AbxArguments(
    path_data=Path("/location/to/scores/")
    path_item_file=Path("/location/to/file.item")
    **other_options
)
result = libriabx.abx_eval(args)

For all possible options see the AbxArguments class definition.

Result is a dictionary containing Dict{mode -> score} where mode is defined as (across, within)

Building & Upload

For security & compatibility reasons binary builds require a special environment to be build. We need to use the manylinux docker container so that correct flags are used.

To do this run :

> docker pull quay.io/pypa/manylinux2014_x86_64
> docker run --rm -v `pwd`:/io quay.io/pypa/manylinux2014_x86_64 bash /io/build_wheel.sh

To check for pyversions available docker run --rm quay.io/pypa/manylinux2014_x86_64 ls /opt/python

This allows to populate with compiled versions of libriabx for python3.8, python3.9, python3.10, python3.11 in the dist folder. For more information see ManyLinux Implementation

Once binaries have been build we can upload them to pypi using : twine upload dist/*

Release files for zerospeech-libriabx 1.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zerospeech-libriabx 1.0.5
File Size Uploaded
zerospeech-libriabx-1.0.5.tar.gz 139.2 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for zerospeech-libriabx 1.0.5
File
zerospeech_libriabx-1.0.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
zerospeech_libriabx-1.0.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
zerospeech_libriabx-1.0.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
zerospeech_libriabx-1.0.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64 Details

Total release size: 2.1 MB

Release files / zerospeech-libriabx-1.0.5.tar.gz

Download URL zerospeech-libriabx-1.0.5.tar.gz
Size 139.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b4445070dbecbe7559775961f508c468c161f9292f165fcbeed20ca2d7e5042c
BLAKE2b-256 checksum
How to use checksums
59e2c7e693c53f31e7a176724ce7d981ba673d45862305084ac270d42c4af547
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.0

Release files / zerospeech_libriabx-1.0.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL zerospeech_libriabx-1.0.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 440.8 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
70130d92e10235da435c26de1a1dff060487284e0a6ad2c99a87ac840e132c3d
BLAKE2b-256 checksum
How to use checksums
73270793ee2369d456872d1cf0f328648e052935dc51dcdc676536e91dccc157
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.7

Release files / zerospeech_libriabx-1.0.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL zerospeech_libriabx-1.0.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 419.5 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
adfe3a42518490d260c251d008665594d823f0b135a6badfd35ab0ed9d01659b
BLAKE2b-256 checksum
How to use checksums
83a2840a59da235dd8780a02cdb47632adf5341ac025ff75b6b0434153abf007
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.7

Release files / zerospeech_libriabx-1.0.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL zerospeech_libriabx-1.0.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 557.6 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
e23de560d92f68378cf44b78f991dfb54d819f89f970be3e6515c84ff542fedd
BLAKE2b-256 checksum
How to use checksums
b73a54ea519f1279742f481cfa40feb812be36c921e7c012e05ecdc3bd38c747
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.0

Release files / zerospeech_libriabx-1.0.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL zerospeech_libriabx-1.0.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 559.6 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
04dcf589d27449251f233a407de539bbb789388648e24ebfbd57bb07fe99ec86
BLAKE2b-256 checksum
How to use checksums
2190518f81973cf7ec5cdbb8e00d7f039793ffedca67094ebdb056657bf64bf3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.0

Release history Release notifications | RSS feed

This release

1.0.5 This release

5 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page