Evaluating separation performance

In this notebook, we will demonstrate how one can use nussl to quickly and easily compare different separation approaches. Here, we will evaluate the performance of several simple vocal separation algorithms on a subset of the MUSDB18 dataset.

First, let’s load the dataset using nussl’s dataset utilities, and inspect an item from the dataset using nussl’s plotting and playing utlities:

[1]:
import nussl
import numpy as np
import matplotlib.pyplot as plt
import json
import time

start_time = time.time()

# seed this notebook
nussl.utils.seed(0)

# this will download the 7 second clips from MUSDB
musdb = nussl.datasets.MUSDB18(download=True)
i = 40 #or get a random track like this: np.random.randint(len(musdb))

# helper for plotting and playing
def visualize_and_embed(sources):
    plt.figure(figsize=(10, 7))
    plt.subplot(211)
    nussl.utils.visualize_sources_as_masks(
        sources, db_cutoff=-60, y_axis='mel')
    plt.subplot(212)
    nussl.utils.visualize_sources_as_waveform(
        sources, show_legend=False)
    plt.tight_layout()
    plt.show()

    nussl.play_utils.multitrack(sources, ext='.wav')

item = musdb[i]
mix = item['mix']
sources = item['sources']

visualize_and_embed(sources)
../_images/tutorials_evaluation_1_0.png