Skip to main content

MiRA tool is a model-independent open evaluation method based on four diverse audio music similarity metrics to assess exact data replication of the training set.

Project description

MiRA

MiRA (Music Replication Assessment) tool is a model-independent open evaluation method based on four diverse audio music similarity metrics to assess exact data replication of the training set.

quick start

create and install conda environment

conda create --name mira python=3.10
conda activate mira
python -m pip install --upgrade pip

install mira package

pip install mira-sim

to run KL divergence download PaSST classifier

pip install 'git+https://github.com/kkoutini/passt_hear21@0.0.19'

to run CLAP and DEfNet scores install pythorch...

pip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 torchaudio==0.11.0+cu113 -f https://download.pytorch.org/whl/torch_stable.html 

# note that you can also install pytorch by following the official instruction (https://pytorch.org/get-started/locally/)
### for H100 GPU: pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

... and download corresponding models

mkdir misc/ 
wget -O misc/music_audioset_epoch_15_esc_90.14.pt https://huggingface.co/lukewys/laion_clap/resolve/main/music_audioset_epoch_15_esc_90.14.pt?download=true 
wget -O misc/discogs_track_embeddings-effnet-bs64-1.pb https://essentia.upf.edu/models/feature-extractors/discogs-effnet/discogs_track_embeddings-effnet-bs64-1.pb

Attention! MiRA expects to find weights in misc folder in the directory you run mira. Note that if you would like to store the models elsewhere, you MUST change the location directory model_path at files clap.py and defnet.py.

how to use MiRA?

Run an evaluation by calling mira and indicating the directory of the reference folder (reference_foldr), the target folder (target_folder) and name of the evaluation or test (eval_name).

Registering results (log) is active by default. You can deactivate storing the results by setting log to no or you can specify your preferred directory (log_directory). If you do not specify any log folder where results should be stored, MiRA will create a log folder in the current directory automatically.

MiRA will run the evaluation between the samples in the reference and target folder for four music similarity metrics: CLAP score, DEfNet score, Cover Identification (CoverID) and KL divergence. However, you can specify a metric with -m argument.

mira <reference_folder> <target_folder> --eval_name <eval_name> {--log <no/log_directory> -m <clap,defnet,coverid,kld>}

Important! Note that MiRA is prepared to interpret wav files.

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

mira_sim-0.1.2.tar.gz (50.1 kB view hashes)

Uploaded Source

Built Distribution

mira_sim-0.1.2-py3-none-any.whl (41.2 kB view hashes)

Uploaded Python 3

Supported by

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