From 04ad68928ea90b069f2c51223961a3352414d758 Mon Sep 17 00:00:00 2001 From: Alan Ng <15185920+alanngnet@users.noreply.github.com> Date: Sat, 27 Jul 2024 11:08:35 -0500 Subject: [PATCH] updated description of tools.identify --- README.md | 6 +++--- tools/make_embeds.py | 30 ++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 tools/make_embeds.py diff --git a/README.md b/README.md index 8f2312f..f35862e 100644 --- a/README.md +++ b/README.md @@ -159,12 +159,12 @@ The default value for the optional `marks` argument is 'markers', which makes th ## Inference (work identification) -After you have trained a model and run the evaluation script, you can use the model to identify any music you give it. Provide the music input to the tools.identify.py script by creating a one-line text file that has the metadata about the music, following the format of the text files generated by tools.extract_csi_features.py. For example, you could select any of the entries in the data/covers80/full.txt file, like a speed-augmented version of one of the 80 works +After you have trained a model and run the evaluation script, you can use the model to identify any music you give it. See comments at the top of tools.identify for documentation of the parameters. Example for covers80: -`python -m tools.identify training/covers80 target.txt -top=10` +`python -m tools.identify data/covers80 training/covers80 youraudio.wav -top=10` -To interpret the output, use the data/covers80/work_id.map text file to see which `work_id` goes with which `work`. Good news: even the bare-bones demo of training from scratch on covers80 shows that CoverHunter does a very good job of identifying versions (covers) of those 80 pop songs. +To interpret the output, use the data/covers80/work_id.map text file to see which `work_id` goes with which `work`. Good news: even the bare-bones demo of training from scratch on covers80 shows that CoverHunter does a good job of identifying versions (covers) of those 80 pop songs. ## Coarse-to-Fine Alignment Training diff --git a/tools/make_embeds.py b/tools/make_embeds.py new file mode 100644 index 0000000..a22288d --- /dev/null +++ b/tools/make_embeds.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +""" +Utility to generate reference embeddings for all production-use audio data +available, using the production-ready model you trained using, for example, +tools.train_prod.py. Intended for use by tools.identify.py or other +applications you might create that use your fully trained model. + +Parameters +---------- +data_path : string + Relative path to the project folder containing the same dataset.txt file that you + generated using tools.extract_csi_features.py and used to train your model. + Example: "data/covers80" + +model_path : string + Relative path to the project folder containing your trained model. + Example: "training/covers80" + + +Output +------ +Pickle file of reference embeddings. + + +Created on Sat Jul 27 10:54:22 2024 + +@author: alan +""" +