diff --git a/README.md b/README.md index 27c855c23..1b89cca37 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ pip install mirdata import mirdata import random -orchset = mirdata.Dataset('orchset') +orchset = mirdata.initialize('orchset') orchset.download() # download the dataset orchset.validate() # validate that all the expected files are there diff --git a/docs/source/contributing.rst b/docs/source/contributing.rst index 3aa52e397..37d0b1341 100644 --- a/docs/source/contributing.rst +++ b/docs/source/contributing.rst @@ -81,7 +81,7 @@ Here there is an example of an index to use as guideline: import glob import json import os - from mirdata.utils import md5 + from mirdata.validate import md5 DATASET_INDEX_PATH = "../mirdata/datasets/indexes/dataset_index.json" @@ -169,7 +169,6 @@ Module example from mirdata import download_utils from mirdata import jams_utils from mirdata import core, annotations - from mirdata import utils # -- Add any relevant citations here @@ -219,8 +218,8 @@ Module example return metadata - DATA = utils.LargeData('example_index.json', _load_metadata) - # DATA = utils.LargeData('example_index.json') ## use this if your dataset has no metadata + DATA = core.LargeData('example_index.json', _load_metadata) + # DATA = core.LargeData('example_index.json') ## use this if your dataset has no metadata class Track(core.Track): @@ -264,7 +263,7 @@ Module example # -- and saved when someone accesses it. Useful when loading slightly # -- bigger files or for bigger datasets. By default, we make any time # -- series data loaded from a file a cached property - @utils.cached_property + @core.cached_property def annotation(self): """output type: description of output""" return load_annotation(self.annotation_path) @@ -322,7 +321,7 @@ Module example self.annotation_path = ... # -- multitracks can optionally have mix-level cached properties and properties - @utils.cached_property + @core.cached_property def annotation(self): """output type: description of output""" return load_annotation(self.annotation_path) @@ -362,35 +361,6 @@ Module example raise IOError("audio_path {} does not exist".format(audio_path)) return librosa.load(audio_path, sr=None, mono=True) - # -- this function is not necessary unless you need very custom download logic - # -- If you need it, it must have this signature. - def _download( - save_dir, remotes, partial_download, info_message, force_overwrite, cleanup - ): - """Download the dataset. - - Args: - save_dir (str): - The directory to download the data - remotes (dict or None): - A dictionary of RemoteFileMetadata tuples of data in zip format. - If None, there is no data to download - partial_download (list or None): - A list of keys to partially download the remote objects of the download dict. - If None, all data is downloaded - info_message (str or None): - A string of info to print when this function is called. - If None, no string is printed. - force_overwrite (bool): - If True, existing files are overwritten by the downloaded files. - cleanup (bool): - Whether to delete the zip/tar file after extracting. - - """ - # see download_utils.downloader for basic usage - if you only need to call downloader - # once, you do not need this function at all. - # only write a custom function if you need it! - # -- Write any necessary loader functions for loading the dataset's data def load_annotation(annotation_path): @@ -416,6 +386,59 @@ Module example ) return annotation_data + # -- use this decorator so the docs are complete + @core.docstring_inherit(core.Dataset) + class Dataset(core.Dataset): + """The Example dataset + """ + + def __init__(self, data_home=None): + super().__init__( + data_home, + index=DATA.index, + name="Example", + track_object=Track, + bibtex=BIBTEX, + remotes=REMOTES, + download_info=DOWNLOAD_INFO, + ) + + # -- Copy any loaders you wrote that should be part of the Dataset object + # -- use this core.copy_docs decorator to copy the docs from the original + # -- load_ function + @core.copy_docs(load_audio) + def load_audio(self, *args, **kwargs): + return load_audio(*args, **kwargs) + + @core.copy_docs(load_annotation) + def load_annotation(self, *args, **kwargs): + return load_annotation(*args, **kwargs) + + # -- if your dataset needs to overwrite the default download logic, do it here. + # -- this function is usually not necessary unless you need very custom download logic + def download( + self, partial_download=None, force_overwrite=False, cleanup=True + ): + """Download the dataset + + Args: + partial_download (list or None): + A list of keys of remotes to partially download. + If None, all data is downloaded + force_overwrite (bool): + If True, existing files are overwritten by the downloaded files. + By default False. + cleanup (bool): + Whether to delete any zip/tar files after extracting. + + Raises: + ValueError: if invalid keys are passed to partial_download + IOError: if a downloaded file's checksum is different from expected + + """ + # see download_utils.downloader for basic usage - if you only need to call downloader + # once, you do not need this function at all. + # only write a custom function if you need it! .. _add_tests: @@ -449,7 +472,6 @@ Test file example import numpy as np from mirdata.datasets import dataset - from mirdata import utils from tests.test_utils import run_track_tests @@ -563,8 +585,10 @@ Submit your loader Before you submit your loader make sure to: -1. Add your module to ``docs/source/mirdata.rst`` (you can check that this was done correctly by clicking on the readthedocs check when you open a PR) -2. Add the module name to ``DATASETS`` in ``mirdata/__init__.py`` +1. Add your module to ``docs/source/mirdata.rst`` +2. Add your module to ``docs/source/quick_reference.rst`` + +(you can check that this was done correctly by clicking on the readthedocs check when you open a PR) Pull Request template ^^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/source/example.rst b/docs/source/example.rst index 53fa411b0..8707265fc 100644 --- a/docs/source/example.rst +++ b/docs/source/example.rst @@ -21,7 +21,7 @@ Fortunately, we can download Orchset dataset directly. :linenos: import mirdata - orchset = mirdata.Dataset("orchset") + orchset = mirdata.initialize("orchset") # Download the Orchset Dataset orchset.download() @@ -71,7 +71,7 @@ metadata, we could do the following: return time_stamps, melody_f0 # Evaluate on the full dataset - orchset = mirdata.Dataset("orchset") + orchset = mirdata.initialize("orchset") orchset_scores = {} orchset_data = orchset.load_tracks() for track_id, track_data in orchset_data.items(): @@ -138,7 +138,7 @@ For example, to load the melody annotations from Orchset into memory, we can sim import mirdata # get the orchset dataset - orchset = mirdata.Dataset("orchset") + orchset = mirdata.initialize("orchset") # Load a specific track track = orchset.track('Beethoven-S3-I-ex1') @@ -156,10 +156,10 @@ However, if your data lives somewhere else, accessing the annotation will return import mirdata # get the orchset dataset - orchset = mirdata.Dataset("orchset") + orchset = mirdata.initialize("orchset", data_home='gs://my_custom/remote_path') # Load a single track, specifying the remote location - track = orchset.track('Beethoven-S3-I-ex1', data_home='gs://my_custom/remote_path') + track = orchset.track('Beethoven-S3-I-ex1') melody_path = track.melody_path print(melody_path) @@ -199,7 +199,7 @@ The following is a simple example of a generator that can be used to create a te def orchset_generator(): # using the default data_home - orchset = mirdata.Dataset("orchset") + orchset = mirdata.initialize("orchset") track_ids = orchset.track_ids() for track_id in track_ids: track = orchset.track(track_id) diff --git a/docs/source/mirdata.rst b/docs/source/mirdata.rst index 63f69b8d6..f878c9550 100644 --- a/docs/source/mirdata.rst +++ b/docs/source/mirdata.rst @@ -9,12 +9,14 @@ acousticbrainz_genre .. automodule:: mirdata.datasets.acousticbrainz_genre :members: + :inherited-members: beatles ^^^^^^^ .. automodule:: mirdata.datasets.beatles :members: + :inherited-members: beatport_key @@ -22,6 +24,7 @@ beatport_key .. automodule:: mirdata.datasets.beatport_key :members: + :inherited-members: cante100 @@ -29,6 +32,7 @@ cante100 .. automodule:: mirdata.datasets.cante100 :members: + :inherited-members: dali @@ -36,6 +40,7 @@ dali .. automodule:: mirdata.datasets.dali :members: + :inherited-members: giantsteps_tempo @@ -43,6 +48,7 @@ giantsteps_tempo .. automodule:: mirdata.datasets.giantsteps_tempo :members: + :inherited-members: giantsteps_key @@ -50,6 +56,7 @@ giantsteps_key .. automodule:: mirdata.datasets.giantsteps_key :members: + :inherited-members: groove_midi @@ -57,6 +64,7 @@ groove_midi .. automodule:: mirdata.datasets.groove_midi :members: + :inherited-members: gtzan_genre @@ -64,6 +72,7 @@ gtzan_genre .. automodule:: mirdata.datasets.gtzan_genre :members: + :inherited-members: guitarset @@ -71,6 +80,7 @@ guitarset .. automodule:: mirdata.datasets.guitarset :members: + :inherited-members: ikala @@ -78,6 +88,7 @@ ikala .. automodule:: mirdata.datasets.ikala :members: + :inherited-members: irmas @@ -85,6 +96,7 @@ irmas .. automodule:: mirdata.datasets.irmas :members: + :inherited-members: maestro @@ -92,6 +104,7 @@ maestro .. automodule:: mirdata.datasets.maestro :members: + :inherited-members: medleydb\_melody @@ -99,6 +112,7 @@ medleydb\_melody .. automodule:: mirdata.datasets.medleydb_melody :members: + :inherited-members: medleydb\_pitch @@ -106,6 +120,7 @@ medleydb\_pitch .. automodule:: mirdata.datasets.medleydb_pitch :members: + :inherited-members: medley_solos_db @@ -113,6 +128,7 @@ medley_solos_db .. automodule:: mirdata.datasets.medley_solos_db :members: + :inherited-members: mridangam_stroke @@ -120,6 +136,7 @@ mridangam_stroke .. automodule:: mirdata.datasets.mridangam_stroke :members: + :inherited-members: orchset @@ -127,6 +144,7 @@ orchset .. automodule:: mirdata.datasets.orchset :members: + :inherited-members: rwc_classical @@ -134,6 +152,7 @@ rwc_classical .. automodule:: mirdata.datasets.rwc_classical :members: + :inherited-members: rwc_jazz @@ -141,6 +160,7 @@ rwc_jazz .. automodule:: mirdata.datasets.rwc_jazz :members: + :inherited-members: rwc_popular @@ -148,6 +168,7 @@ rwc_popular .. automodule:: mirdata.datasets.rwc_popular :members: + :inherited-members: salami @@ -155,6 +176,7 @@ salami .. automodule:: mirdata.datasets.salami :members: + :inherited-members: saraga_carnatic @@ -162,6 +184,7 @@ saraga_carnatic .. automodule:: mirdata.datasets.saraga_carnatic :members: + :inherited-members: saraga_hindustani @@ -169,6 +192,7 @@ saraga_hindustani .. automodule:: mirdata.datasets.saraga_hindustani :members: + :inherited-members: tinysol @@ -176,6 +200,7 @@ tinysol .. automodule:: mirdata.datasets.tinysol :members: + :inherited-members: tonality_classicaldb @@ -183,10 +208,15 @@ tonality_classicaldb .. automodule:: mirdata.datasets.tonality_classicaldb :members: + :inherited-members: + Core ---- +..automodule:: mirdata.initialize + :members: + .. automodule:: mirdata.core :members: @@ -201,10 +231,10 @@ Annotations Advanced -------- -mirdata.utils -^^^^^^^^^^^^^ +mirdata.validate +^^^^^^^^^^^^^^^^ -.. automodule:: mirdata.utils +.. automodule:: mirdata.validate :members: diff --git a/mirdata/__init__.py b/mirdata/__init__.py index be3a7d578..d5cc1b424 100644 --- a/mirdata/__init__.py +++ b/mirdata/__init__.py @@ -1,34 +1,16 @@ # -*- coding: utf-8 -*- +import os +import pkgutil + from .version import version as __version__ + DATASETS = [ - "acousticbrainz_genre", - "beatles", - "beatport_key", - "cante100", - "dali", - "giantsteps_key", - "giantsteps_tempo", - "groove_midi", - "gtzan_genre", - "guitarset", - "ikala", - "irmas", - "maestro", - "medley_solos_db", - "medleydb_melody", - "medleydb_pitch", - "mridangam_stroke", - "orchset", - "rwc_classical", - "rwc_jazz", - "rwc_popular", - "salami", - "saraga_carnatic", - "saraga_hindustani", - "tinysol", - "tonality_classicaldb", + d.name + for d in pkgutil.iter_modules( + [os.path.dirname(os.path.abspath(__file__)) + "/datasets"] + ) ] -from .core import Dataset +from .initialize import initialize diff --git a/mirdata/core.py b/mirdata/core.py index 59397a213..f4a270e7b 100644 --- a/mirdata/core.py +++ b/mirdata/core.py @@ -1,87 +1,128 @@ # -*- coding: utf-8 -*- """core mirdata classes """ -import importlib +import json import os import random import types import numpy as np -import mirdata from mirdata import download_utils -from mirdata import utils +from mirdata import validate MAX_STR_LEN = 100 -DATASETS = mirdata.DATASETS + + +##### decorators ###### + + +class cached_property(object): + """A property that is only computed once per instance and then replaces + itself with an ordinary attribute. Deleting the attribute resets the + property. + Source: https://github.com/bottlepy/bottle/commit/fa7733e075da0d790d809aa3d2f53071897e6f76 + """ + + def __init__(self, func): + self.__doc__ = getattr(func, "__doc__") + self.func = func + + def __get__(self, obj, cls): + # type: (Any, type) -> Any + if obj is None: + return self + value = obj.__dict__[self.func.__name__] = self.func(obj) + return value + + +def docstring_inherit(parent): + """Decorator function to inherit docstrings from the parent class. + + Adds documented Attributes from the parent to the child docs. + + """ + + def inherit(obj): + spaces = " " + if not str(obj.__doc__).__contains__("Attributes:"): + obj.__doc__ += "\n" + spaces + "Attributes:\n" + obj.__doc__ = str(obj.__doc__).rstrip() + "\n" + for attribute in parent.__doc__.split("Attributes:\n")[-1].lstrip().split("\n"): + obj.__doc__ += spaces * 2 + str(attribute).lstrip().rstrip() + "\n" + + return obj + + return inherit + + +def copy_docs(original): + """Decorator function to copy docs from one function to another""" + + def wrapper(target): + target.__doc__ = original.__doc__ + return target + + return wrapper + + +##### Core Classes ##### class Dataset(object): """mirdata Dataset object - Usage example: - orchset = mirdata.Dataset('orchset') # get the orchset dataset - orchset.download() # download orchset - orchset.validate() # validate orchset - track = orchset.choice_track() # load a random track - print(track) # see what data a track contains - orchset.track_ids() # load all track ids - Attributes: + data_home (str): path where mirdata will look for the dataset name (str): the identifier of the dataset bibtex (str): dataset citation/s in bibtex format remotes (dict): data to be downloaded - index (dict): dataset file index download_info (str): download instructions or caveats track (mirdata.core.Track): function that inputs a track_id readme (str): information about the dataset - data_home (str): path where mirdata will look for the dataset """ - def __init__(self, dataset, data_home=None, index=None): - """Inits a dataset by name and data location""" - if dataset not in DATASETS: - raise ValueError( - "{} is not a valid dataset in mirdata. Valid datsets are:\n{}".format( - dataset, ",".join(DATASETS) - ) - ) - module = importlib.import_module("mirdata.datasets.{}".format(dataset)) - self.name = dataset - self.bibtex = getattr(module, "BIBTEX", None) - self._remotes = getattr(module, "REMOTES", None) - self._index = module.DATA.index if index is None else index - self._download_info = getattr(module, "DOWNLOAD_INFO", None) - self._track_object = getattr(module, "Track", None) - self._download_fn = getattr(module, "_download", download_utils.downloader) - self._readme_str = module.__doc__ - - if data_home is None: - self.data_home = self.default_path - else: - self.data_home = data_home + def __init__( + self, + data_home=None, + index=None, + name=None, + track_object=None, + bibtex=None, + remotes=None, + download_info=None, + ): + """Dataset init method + + Args: + data_home (str or None): path where mirdata will look for the dataset + index (dict or None): the dataset's file index + name (str or None): the identifier of the dataset + track_object (mirdata.core.Track or None): the dataset's uninstantiated Track object + bibtex (str or None): dataset citation/s in bibtex format + remotes (dict or None): data to be downloaded + download_info (str or None): download instructions or caveats + + """ + self.name = name + self.data_home = self.default_path if data_home is None else data_home + self._index = index + self._track_object = track_object + self.bibtex = bibtex + self.remotes = remotes + self._download_info = download_info # this is a hack to be able to have dataset-specific docstrings self.track = lambda track_id: self._track(track_id) self.track.__doc__ = self._track_object.__doc__ # set the docstring - # inherit any public load functions from the module - for method_name in dir(module): - if method_name.startswith("load_"): - method = getattr(module, method_name) - setattr(self, method_name, method) - # getattr(self, method_name).__doc__ = method.__doc__ - def __repr__(self): repr_string = "The {} dataset\n".format(self.name) repr_string += "-" * MAX_STR_LEN - repr_string += "\n" - repr_string += ( - "Call the .readme method for complete documentation of this dataset.\n" - ) + repr_string += "\n\n\n" repr_string += "Call the .cite method for bibtex citations.\n" repr_string += "-" * MAX_STR_LEN - repr_string += "\n" + repr_string += "\n\n\n" if self._track_object is not None: repr_string += self.track.__doc__ repr_string += "-" * MAX_STR_LEN @@ -101,6 +142,7 @@ def default_path(self): def _track(self, track_id): """Load a track by track_id. + Hidden helper function that gets called as a lambda. Args: @@ -133,10 +175,6 @@ def choice_track(self): """ return self.track(random.choice(self.track_ids)) - def readme(self): - """Print the dataset's readme.""" - print(self._readme_str) - def cite(self): """Print the reference""" print("========== BibTeX ==========") @@ -159,23 +197,23 @@ def download(self, partial_download=None, force_overwrite=False, cleanup=True): IOError: if a downloaded file's checksum is different from expected """ - self._download_fn( + download_utils.downloader( self.data_home, - remotes=self._remotes, + remotes=self.remotes, partial_download=partial_download, info_message=self._download_info, force_overwrite=force_overwrite, cleanup=cleanup, ) - @utils.cached_property + @cached_property def track_ids(self): """Return track ids Returns: (list): A list of track ids """ - return list(self._index['tracks'].keys()) + return list(self._index["tracks"].keys()) def validate(self, verbose=True): """Validate if the stored dataset is a valid version @@ -190,13 +228,16 @@ def validate(self, verbose=True): index but has a different checksum compare to the reference checksum """ - missing_files, invalid_checksums = utils.validator( + missing_files, invalid_checksums = validate.validator( self._index, self.data_home, verbose=verbose ) return missing_files, invalid_checksums class Track(object): + """Track base class + """ + def __repr__(self): properties = [v for v in dir(self.__class__) if not v.startswith("_")] attributes = [ @@ -324,6 +365,7 @@ def get_random_target(self, n_tracks=None, min_weight=0.3, max_weight=1.0): target (np.ndarray): mixture audio with shape (n_samples, n_channels) tracks (list): list of keys of included tracks weights (list): list of weights used to mix tracks + """ self._check_mixable() tracks = list(self.tracks.keys()) @@ -342,6 +384,69 @@ def get_mix(self): Returns: target (np.ndarray): mixture audio with shape (n_samples, n_channels) + """ self._check_mixable() return self.get_target(list(self.tracks.keys())) + + +def load_json_index(filename): + working_dir = os.path.dirname(os.path.realpath(__file__)) + with open(os.path.join(working_dir, "datasets/indexes", filename)) as f: + return json.load(f) + + +def none_path_join(partial_path_list): + """Join a list of partial paths. If any part of the path is None, + returns None. + + Args: + partial_path_list (list): List of partial paths + + Returns: + path or None (str or None): joined path string or None + + """ + if None in partial_path_list: + return None + else: + return os.path.join(*partial_path_list) + + +class LargeData(object): + def __init__(self, index_file, metadata_load_fn=None, remote_index=None): + """Object which loads and caches large data the first time it's accessed. + + Args: + index_file: str + File name of checksum index file to be passed to `load_json_index` + metadata_load_fn: function + Function which returns a metadata dictionary. + If None, assume the dataset has no metadata. When the + `metadata` attribute is called, raises a NotImplementedError + + """ + self._metadata = None + self.index_file = index_file + self.metadata_load_fn = metadata_load_fn + self.remote_index = remote_index + + @cached_property + def index(self): + if self.remote_index is not None: + working_dir = os.path.dirname(os.path.realpath(__file__)) + path_index_file = os.path.join( + working_dir, "datasets/indexes", self.index_file + ) + if not os.path.isfile(path_index_file): + path_indexes = os.path.join(working_dir, "datasets/indexes") + download_utils.downloader(path_indexes, remotes=self.remote_index) + return load_json_index(self.index_file) + + def metadata(self, data_home): + if self.metadata_load_fn is None: + raise NotImplementedError + + if self._metadata is None or self._metadata["data_home"] != data_home: + self._metadata = self.metadata_load_fn(data_home) + return self._metadata diff --git a/mirdata/datasets/acousticbrainz_genre.py b/mirdata/datasets/acousticbrainz_genre.py index fcfe56cc5..26356cd11 100644 --- a/mirdata/datasets/acousticbrainz_genre.py +++ b/mirdata/datasets/acousticbrainz_genre.py @@ -43,7 +43,6 @@ from mirdata import download_utils, core from mirdata import jams_utils -from mirdata import utils BIBTEX = """ @@ -126,10 +125,7 @@ ) } -DOWNLOAD_INFO = "" - - -DATA = utils.LargeData("acousticbrainz_genre_index.json", remote_index=REMOTE_INDEX) +DATA = core.LargeData("acousticbrainz_genre_index.json", remote_index=REMOTE_INDEX) class Track(core.Track): @@ -147,7 +143,7 @@ class Track(core.Track): def __init__(self, track_id, data_home, remote_index=None, remote_index_name=None): if remote_index is not None and remote_index_name is not None: - data = utils.LargeData(remote_index_name, remote_index=remote_index) + data = core.LargeData(remote_index_name, remote_index=remote_index) else: data = DATA @@ -161,176 +157,139 @@ def __init__(self, track_id, data_home, remote_index=None, remote_index_name=Non self.track_id = track_id self._data_home = data_home self._track_paths = data.index["tracks"][track_id] - self.path = utils.none_path_join( - [self._data_home, self._track_paths["data"][0]] - ) + self.path = core.none_path_join([self._data_home, self._track_paths["data"][0]]) # Genre @property def genre(self): - """Genre: human-labeled genre and subgenres list""" + """human-labeled genre and subgenres list""" return [genre for genre in self.track_id.split("#")[2:]] # Music Brainz @property def mbid(self): - """mbid: musicbrainz id""" + """musicbrainz id""" return self.track_id.split("#")[0] @property def mbid_group(self): - """mbid_group: musicbrainz id group""" + """musicbrainz id group""" return self.track_id.split("#")[1] # Metadata @property def artist(self): - """Artist: metadata artist annotation""" + """metadata artist annotation""" return load_extractor(self.path)["metadata"]["artist"] @property def title(self): - """title: metadata title annotation""" + """metadata title annotation""" return load_extractor(self.path)["metadata"]["title"] @property def date(self): - """date: metadata date annotation""" + """metadata date annotation""" return load_extractor(self.path)["metadata"]["date"] @property def file_name(self): - """File_name: metadata file_name annotation""" + """metadata file_name annotation""" return load_extractor(self.path)["metadata"]["file_name"] @property def album(self): - """Album: metadata album annotation""" + """metadata album annotation""" return load_extractor(self.path)["metadata"]["album"] @property def tracknumber(self): - """tracknumber: metadata tracknumber annotation""" + """metadata tracknumber annotation""" return load_extractor(self.path)["metadata"]["tracknumber"] @property def tonal(self): - """Tonal: tonal features. - 'tuning_frequency': estimated tuning frequency [Hz]. Algorithms: TuningFrequency - 'tuning_nontempered_energy_ratio' and 'tuning_equal_tempered_deviation' - - 'hpcp', 'thpcp': 32-dimensional harmonic pitch class profile (HPCP) and its transposed version. Algorithms: HPCP - - 'hpcp_entropy': Shannon entropy of a HPCP vector. Algorithms: Entropy - - 'key_key', 'key_scale': Global key feature. Algorithms: Key - - 'chords_key', 'chords_scale': Global key extracted from chords detection. - - 'chords_strength', 'chords_histogram': : strength of estimated chords and normalized histogram of their - progression; Algorithms: ChordsDetection, ChordsDescriptors + """Tonal features. + - 'tuning_frequency': estimated tuning frequency [Hz]. Algorithms: TuningFrequency + - 'tuning_nontempered_energy_ratio' and 'tuning_equal_tempered_deviation' + - 'hpcp', 'thpcp': 32-dimensional harmonic pitch class profile (HPCP) and its transposed version. Algorithms: HPCP + - 'hpcp_entropy': Shannon entropy of a HPCP vector. Algorithms: Entropy + - 'key_key', 'key_scale': Global key feature. Algorithms: Key + - 'chords_key', 'chords_scale': Global key extracted from chords detection. + - 'chords_strength', 'chords_histogram': : strength of estimated chords and normalized histogram of their + progression; Algorithms: ChordsDetection, ChordsDescriptors + - 'chords_changes_rate', 'chords_number_rate': chords change rate in the progression; ratio + of different chords from the total number of chords in the progression; Algorithms: ChordsDetection, + ChordsDescriptors - 'chords_changes_rate', 'chords_number_rate': chords change rate in the progression; ratio - of different chords from the total number of chords in the progression; Algorithms: ChordsDetection, - ChordsDescriptors """ return load_extractor(self.path)["tonal"] @property def low_level(self): - """low_level: low_level track descritors. - - 'average_loudness': dynamic range descriptor. It rescales average loudness, - computed on 2sec windows with 1 sec overlap, into the [0,1] interval. The value of 0 corresponds to signals - with large dynamic range, 1 corresponds to signal with little dynamic range. Algorithms: Loudness - - 'dynamic_complexity': dynamic complexity computed on 2sec windows with 1sec overlap. Algorithms: DynamicComplexity - - 'silence_rate_20dB', 'silence_rate_30dB', 'silence_rate_60dB': rate of silent frames in a signal for - thresholds of 20, 30, and 60 dBs. Algorithms: SilenceRate - - 'spectral_rms': spectral RMS. Algorithms: RMS - - 'spectral_flux': spectral flux of a signal computed using L2-norm. Algorithms: Flux - - 'spectral_centroid', 'spectral_kurtosis', 'spectral_spread', 'spectral_skewness': centroid and central - moments statistics describing the spectral shape. Algorithms: Centroid, CentralMoments - - 'spectral_rolloff': the roll-off frequency of a spectrum. Algorithms: RollOff - - 'spectral_decrease': spectral decrease. Algorithms: Decrease - - 'hfc': high frequency content descriptor as proposed by Masri. Algorithms: HFC - - 'zerocrossingrate' zero-crossing rate. Algorithms: ZeroCrossingRate - - 'spectral_energy': spectral energy. Algorithms: Energy - - 'spectral_energyband_low', 'spectral_energyband_middle_low', 'spectral_energyband_middle_high', - 'spectral_energyband_high': spectral energy in frequency bands [20Hz, 150Hz], [150Hz, 800Hz], [800Hz, 4kHz], - and [4kHz, 20kHz]. Algorithms EnergyBand - - 'barkbands': spectral energy in 27 Bark bands. Algorithms: BarkBands - - 'melbands': spectral energy in 40 mel bands. Algorithms: MFCC - - 'erbbands': spectral energy in 40 ERB bands. Algorithms: ERBBands - - 'mfcc': the first 13 mel frequency cepstrum coefficients. See algorithm: MFCC - - 'gfcc': the first 13 gammatone feature cepstrum coefficients. Algorithms: GFCC - - 'barkbands_crest', 'barkbands_flatness_db': crest and flatness computed over energies in Bark bands. Algorithms: Crest, FlatnessDB - - 'barkbands_kurtosis', 'barkbands_skewness', 'barkbands_spread': central moments statistics over energies in Bark bands. Algorithms: CentralMoments - - 'melbands_crest', 'melbands_flatness_db': crest and flatness computed over energies in mel bands. Algorithms: Crest, FlatnessDB - - 'melbands_kurtosis', 'melbands_skewness', 'melbands_spread': central moments statistics over energies in mel bands. Algorithms: CentralMoments - - 'erbbands_crest', 'erbbands_flatness_db': crest and flatness computed over energies in ERB bands. Algorithms: Crest, FlatnessDB - - 'erbbands_kurtosis', 'erbbands_skewness', 'erbbands_spread': central moments statistics over energies in ERB bands. Algorithms: CentralMoments - - 'dissonance': sensory dissonance of a spectrum. Algorithms: Dissonance - - 'spectral_entropy': Shannon entropy of a spectrum. Algorithms: Entropy - - 'pitch_salience': pitch salience of a spectrum. Algorithms: PitchSalience - - 'spectral_complexity': spectral complexity. Algorithms: SpectralComplexity - - 'spectral_contrast_coeffs', 'spectral_contrast_valleys': spectral contrast features. Algorithms: - SpectralContrast + """low_level track descritors. + + - 'average_loudness': dynamic range descriptor. It rescales average loudness, + computed on 2sec windows with 1 sec overlap, into the [0,1] interval. The value of 0 corresponds to signals + with large dynamic range, 1 corresponds to signal with little dynamic range. Algorithms: Loudness + - 'dynamic_complexity': dynamic complexity computed on 2sec windows with 1sec overlap. Algorithms: DynamicComplexity + - 'silence_rate_20dB', 'silence_rate_30dB', 'silence_rate_60dB': rate of silent frames in a signal for + thresholds of 20, 30, and 60 dBs. Algorithms: SilenceRate + - 'spectral_rms': spectral RMS. Algorithms: RMS + - 'spectral_flux': spectral flux of a signal computed using L2-norm. Algorithms: Flux + - 'spectral_centroid', 'spectral_kurtosis', 'spectral_spread', 'spectral_skewness': centroid and central + moments statistics describing the spectral shape. Algorithms: Centroid, CentralMoments + - 'spectral_rolloff': the roll-off frequency of a spectrum. Algorithms: RollOff + - 'spectral_decrease': spectral decrease. Algorithms: Decrease + - 'hfc': high frequency content descriptor as proposed by Masri. Algorithms: HFC + - 'zerocrossingrate' zero-crossing rate. Algorithms: ZeroCrossingRate + - 'spectral_energy': spectral energy. Algorithms: Energy + - 'spectral_energyband_low', 'spectral_energyband_middle_low', 'spectral_energyband_middle_high', + - 'spectral_energyband_high': spectral energy in frequency bands [20Hz, 150Hz], [150Hz, 800Hz], [800Hz, 4kHz], + and [4kHz, 20kHz]. Algorithms EnergyBand + - 'barkbands': spectral energy in 27 Bark bands. Algorithms: BarkBands + - 'melbands': spectral energy in 40 mel bands. Algorithms: MFCC + - 'erbbands': spectral energy in 40 ERB bands. Algorithms: ERBBands + - 'mfcc': the first 13 mel frequency cepstrum coefficients. See algorithm: MFCC + - 'gfcc': the first 13 gammatone feature cepstrum coefficients. Algorithms: GFCC + - 'barkbands_crest', 'barkbands_flatness_db': crest and flatness computed over energies in Bark bands. Algorithms: Crest, FlatnessDB + - 'barkbands_kurtosis', 'barkbands_skewness', 'barkbands_spread': central moments statistics over energies in Bark bands. Algorithms: CentralMoments + - 'melbands_crest', 'melbands_flatness_db': crest and flatness computed over energies in mel bands. Algorithms: Crest, FlatnessDB + - 'melbands_kurtosis', 'melbands_skewness', 'melbands_spread': central moments statistics over energies in mel bands. Algorithms: CentralMoments + - 'erbbands_crest', 'erbbands_flatness_db': crest and flatness computed over energies in ERB bands. Algorithms: Crest, FlatnessDB + - 'erbbands_kurtosis', 'erbbands_skewness', 'erbbands_spread': central moments statistics over energies in ERB bands. Algorithms: CentralMoments + - 'dissonance': sensory dissonance of a spectrum. Algorithms: Dissonance + - 'spectral_entropy': Shannon entropy of a spectrum. Algorithms: Entropy + - 'pitch_salience': pitch salience of a spectrum. Algorithms: PitchSalience + - 'spectral_complexity': spectral complexity. Algorithms: SpectralComplexity + - 'spectral_contrast_coeffs', 'spectral_contrast_valleys': spectral contrast features. Algorithms: + SpectralContrast """ return load_extractor(self.path)["low_level"] @property def rhythm(self): - """Rhythm: rhytm essentia extractor descriptors - 'beats_position': time positions [sec] of detected beats using beat tracking algorithm by Degara et al., 2012. Algorithms: RhythmExtractor2013, BeatTrackerDegara - - 'beats_count': number of detected beats - - 'bpm': BPM value according to detected beats - - 'bpm_histogram_first_peak_bpm', 'bpm_histogram_first_peak_spread', 'bpm_histogram_first_peak_weight', - 'bpm_histogram_second_peak_bpm', 'bpm_histogram_second_peak_spread', 'bpm_histogram_second_peak_weight': - descriptors characterizing highest and second highest peak of the BPM histogram. Algorithms: - BpmHistogramDescriptors - - 'beats_loudness', 'beats_loudness_band_ratio': spectral energy computed on beats segments of audio across the whole spectrum, and ratios of energy in 6 frequency bands. Algorithms: BeatsLoudness, SingleBeatLoudness - - 'onset_rate': number of detected onsets per second. Algorithms: OnsetRate - - 'danceability': danceability estimate. Algorithms: Danceability + """Rhythm essentia extractor descriptors + + - 'beats_position': time positions [sec] of detected beats using beat tracking algorithm by Degara et al., 2012. Algorithms: RhythmExtractor2013, BeatTrackerDegara + - 'beats_count': number of detected beats + - 'bpm': BPM value according to detected beats + - 'bpm_histogram_first_peak_bpm', 'bpm_histogram_first_peak_spread', 'bpm_histogram_first_peak_weight', + - 'bpm_histogram_second_peak_bpm', 'bpm_histogram_second_peak_spread', 'bpm_histogram_second_peak_weight': + descriptors characterizing highest and second highest peak of the BPM histogram. Algorithms: + BpmHistogramDescriptors + - 'beats_loudness', 'beats_loudness_band_ratio': spectral energy computed on beats segments of audio + across the whole spectrum, and ratios of energy in 6 frequency bands. + Algorithms: BeatsLoudness, SingleBeatLoudness + - 'onset_rate': number of detected onsets per second. Algorithms: OnsetRate + - 'danceability': danceability estimate. Algorithms: Danceability """ return load_extractor(self.path)["metadata"]["rhythm"] def to_jams(self): - """Jams: the track's data in jams format""" + """the track's data in jams format""" return jams_utils.jams_converter( metadata={ "features": load_extractor(self.path), @@ -360,227 +319,194 @@ def load_extractor(path): return meta -def filter_index(search_key, index=None): - """Load from AcousticBrainz genre dataset the indexes that match with search_key. - - Args: - search_key (str): regex to match with folds, mbid or genres - index (dict): mirdata index to filter. - - Returns: - (dict): {`track_id`: track data} - """ - if index is None: - index = DATA.index["tracks"].items() - - acousticbrainz_genre_data = {k: v for k, v in index.items() if search_key in k} - return acousticbrainz_genre_data - - -def load_all_train(index=None): - """Load from AcousticBrainz genre dataset the tracks that are used for training across the four different datasets. - - Args: - index (dict): mirdata index to filter. - - Returns: - (dict): {`track_id`: track data} - +@core.docstring_inherit(core.Dataset) +class Dataset(core.Dataset): + """The acousticbrainz genre dataset """ - return filter_index("#train#", index=index) - - -def load_all_validation(index=None): - """Load from AcousticBrainz genre dataset the tracks that are used for validating across the four different datasets. - - Args: - index (dict): mirdata index to filter. - Returns: - (dict): {`track_id`: track data} - - """ - return filter_index("#validation#", index=index) - - -def load_tagtraum_validation(index=None): - """Load from AcousticBrainz genre dataset the tracks that are used for validating in tagtraum dataset. - - Args: - data_home (str): Local path where the dataset is stored. - If `None`, looks for the data in the default directory, `~/mir_datasets` - index (dict): mirdata index to filter. + def __init__(self, data_home=None, index=None): + super().__init__( + data_home, + index=DATA.index if index is None else index, + name="acousticbrainz_genre", + track_object=Track, + bibtex=BIBTEX, + remotes=REMOTES, + ) - Returns: - (dict): {`track_id`: track data} + @core.copy_docs(load_extractor) + def load_extractor(self, *args, **kwargs): + return load_extractor(*args, **kwargs) - """ - return filter_index("tagtraum#validation#", index=index) + def download(self, partial_download=None, force_overwrite=False, cleanup=True): + """Download the dataset + Args: + partial_download (list or None): + A list of keys of remotes to partially download. + If None, all data is downloaded + force_overwrite (bool): + If True, existing files are overwritten by the downloaded files. + By default False. + cleanup (bool): + Whether to delete any zip/tar files after extracting. -def load_tagtraum_train(index=None): - """Load from AcousticBrainz genre dataset the tracks that are used for training in tagtraum dataset. + Raises: + ValueError: if invalid keys are passed to partial_download + IOError: if a downloaded file's checksum is different from expected - Args: - index (dict): mirdata index to filter. - - Returns: - (dict): {`track_id`: track data} - - """ - return filter_index("tagtraum#train#", index=index) + """ + if not os.path.exists(self.data_home): + os.makedirs(self.data_home) + # Create these directories if doesn't exist + train = "acousticbrainz-mediaeval-train" + train_dir = os.path.join(self.data_home, train) + if not os.path.isdir(train_dir): + os.mkdir(train_dir) + validate = "acousticbrainz-mediaeval-validation" + validate_dir = os.path.join(self.data_home, validate) + if not os.path.isdir(validate_dir): + os.mkdir(validate_dir) + + # start to download + for key, remote in self.remotes.items(): + # check overwrite + file_downloaded = False + if not force_overwrite: + fold, first_dir = key.split("-") + first_dir_path = os.path.join( + train_dir if fold == "train" else validate_dir, first_dir + ) + if os.path.isdir(first_dir_path): + file_downloaded = True + print( + "File " + + remote.filename + + " downloaded. Skip download (force_overwrite=False)." + ) + if not file_downloaded: + # if this typical error happend it repeat download + download_utils.downloader( + self.data_home, + remotes={key: remote}, + partial_download=None, + info_message=None, + force_overwrite=True, + cleanup=cleanup, + ) + # move from a temporary directory to final one + source_dir = os.path.join( + self.data_home, "temp", train if "train" in key else validate + ) + target_dir = train_dir if "train" in key else validate_dir + dir_names = os.listdir(source_dir) + for dir_name in dir_names: + shutil.move( + os.path.join(source_dir, dir_name), + os.path.join(target_dir, dir_name), + ) + def filter_index(self, search_key): + """Load from AcousticBrainz genre dataset the indexes that match with search_key. -def load_allmusic_train(index=None): - """Load from AcousticBrainz genre dataset the tracks that are used for validation in allmusic dataset. + Args: + search_key (str): regex to match with folds, mbid or genres - Args: - index (dict): mirdata index to filter. + Returns: + (dict): {`track_id`: track data} + """ - Returns: - (dict): {`track_id`: track data} + acousticbrainz_genre_data = { + k: v for k, v in self._index["tracks"].items() if search_key in k + } + return acousticbrainz_genre_data - """ - return filter_index("allmusic#train#", index=index) + def load_all_train(self): + """Load from AcousticBrainz genre dataset the tracks that are used for training across the four different datasets. + Returns: + (dict): {`track_id`: track data} -def load_allmusic_validation(index=None): - """Load from AcousticBrainz genre dataset the tracks that are used for validation in allmusic dataset. + """ + return self.filter_index("#train#") - Args: - index (dict): mirdata index to filter. + def load_all_validation(self): + """Load from AcousticBrainz genre dataset the tracks that are used for validating across the four different datasets. - Returns: - (dict): {`track_id`: track data} + Returns: + (dict): {`track_id`: track data} - """ - return filter_index("allmusic#validation#", index=index) + """ + return self.filter_index("#validation#") + def load_tagtraum_validation(self): + """Load from AcousticBrainz genre dataset the tracks that are used for validating in tagtraum dataset. -def load_lastfm_train(index=None): - """Load from AcousticBrainz genre dataset the tracks that are used for training in lastfm dataset. + Returns: + (dict): {`track_id`: track data} - Args: - index (dict): mirdata index to filter. + """ + return self.filter_index("tagtraum#validation#") - Returns: - (dict): {`track_id`: track data} + def load_tagtraum_train(self): + """Load from AcousticBrainz genre dataset the tracks that are used for training in tagtraum dataset. - """ - return filter_index("lastfm#train#", index=index) + Returns: + (dict): {`track_id`: track data} + """ + return self.filter_index("tagtraum#train#") -def load_lastfm_validation(index=None): - """Load from AcousticBrainz genre dataset the tracks that are used for validation in lastfm dataset. + def load_allmusic_train(self): + """Load from AcousticBrainz genre dataset the tracks that are used for validation in allmusic dataset. - Args: - index (dict): mirdata index to filter. + Returns: + (dict): {`track_id`: track data} - Returns: - (dict): {`track_id`: track data} + """ + return self.filter_index("allmusic#train#") - """ - return filter_index("lastfm#validation#", index=index) + def load_allmusic_validation(self): + """Load from AcousticBrainz genre dataset the tracks that are used for validation in allmusic dataset. + Returns: + (dict): {`track_id`: track data} -def load_discogs_train(index=None): - """Load from AcousticBrainz genre dataset the tracks that are used for training in discogs dataset. + """ + return self.filter_index("allmusic#validation#") - Args: - index (dict): mirdata index to filter. + def load_lastfm_train(self): + """Load from AcousticBrainz genre dataset the tracks that are used for training in lastfm dataset. - Returns: - (dict): {`track_id`: track data} + Returns: + (dict): {`track_id`: track data} - """ - return filter_index("allmusic#train#", index=index) + """ + return self.filter_index("lastfm#train#") + def load_lastfm_validation(self): + """Load from AcousticBrainz genre dataset the tracks that are used for validation in lastfm dataset. -def load_discogs_validation(index=None): - """Load from AcousticBrainz genre dataset the tracks that are used for validation in tagtraum dataset. + Returns: + (dict): {`track_id`: track data} - Args: - index (dict): mirdata index to filter. + """ + return self.filter_index("lastfm#validation#") - Returns: - (dict): {`track_id`: track data} + def load_discogs_train(self): + """Load from AcousticBrainz genre dataset the tracks that are used for training in discogs dataset. - """ - return filter_index("allmusic#validation#", index=index) + Returns: + (dict): {`track_id`: track data} + """ + return self.filter_index("allmusic#train#") -def _download( - save_dir, - remotes, - partial_download, - info_message, - force_overwrite=False, - cleanup=True, -): - """Download data to `save_dir` and optionally print a message. + def load_discogs_validation(self): + """Load from AcousticBrainz genre dataset the tracks that are used for validation in tagtraum dataset. - Args: - save_dir (str): - Dataset files path - remotes (dict or None): - remotes (dict) : - A dictionary of RemoteFileMetadata tuples of data in zip format. - If None, there is no data to download - force_overwrite (bool): - If True, existing files are overwritten by the downloaded files. By default False. - cleanup (bool): - Whether to delete any zip/tar files after extracting. - - Raises: - ValueError: if invalid keys are passed to partial_download - IOError: if a downloaded file's checksum is different from expected + Returns: + (dict): {`track_id`: track data} - """ - if not os.path.exists(save_dir): - os.makedirs(save_dir) - # Create these directories if doesn't exist - train = "acousticbrainz-mediaeval-train" - train_dir = os.path.join(save_dir, train) - if not os.path.isdir(train_dir): - os.mkdir(train_dir) - validate = "acousticbrainz-mediaeval-validation" - validate_dir = os.path.join(save_dir, validate) - if not os.path.isdir(validate_dir): - os.mkdir(validate_dir) - - # start to download - for key, remote in remotes.items(): - # check overwrite - file_downloaded = False - if not force_overwrite: - fold, first_dir = key.split("-") - first_dir_path = os.path.join( - train_dir if fold == "train" else validate_dir, first_dir - ) - if os.path.isdir(first_dir_path): - file_downloaded = True - print( - "File " - + remote.filename - + " downloaded. Skip download (force_overwrite=False)." - ) - if not file_downloaded: - # if this typical error happend it repeat download - download_utils.downloader( - save_dir, - remotes={key: remote}, - partial_download=None, - info_message=None, - force_overwrite=True, - cleanup=cleanup, - ) - # move from a temporal directory to final one - source_dir = os.path.join( - save_dir, "temp", train if "train" in key else validate - ) - target_dir = train_dir if "train" in key else validate_dir - dir_names = os.listdir(source_dir) - for dir_name in dir_names: - shutil.move( - os.path.join(source_dir, dir_name), os.path.join(target_dir, dir_name) - ) + """ + return self.filter_index("allmusic#validation#") diff --git a/mirdata/datasets/beatles.py b/mirdata/datasets/beatles.py index 9805b01ca..94063e9c8 100644 --- a/mirdata/datasets/beatles.py +++ b/mirdata/datasets/beatles.py @@ -15,9 +15,11 @@ from mirdata import download_utils from mirdata import jams_utils from mirdata import core -from mirdata import utils from mirdata import annotations + +DATA = core.LargeData("beatles_index.json") + BIBTEX = """@inproceedings{mauch2009beatles, title={OMRAS2 metadata project 2009}, author={Mauch, Matthias and Cannam, Chris and Davies, Matthew and Dixon, Simon and Harte, @@ -27,7 +29,6 @@ series = {ISMIR} }""" - REMOTES = { "annotations": download_utils.RemoteFileMetadata( filename="The Beatles Annotations.tar.gz", @@ -36,26 +37,23 @@ destination_dir="annotations", ) } - - DOWNLOAD_INFO = """ - Unfortunately the audio files of the Beatles dataset are not available - for download. If you have the Beatles dataset, place the contents into - a folder called Beatles with the following structure: - > Beatles/ - > annotations/ - > audio/ - and copy the Beatles folder to {} + Unfortunately the audio files of the Beatles dataset are not available + for download. If you have the Beatles dataset, place the contents into + a folder called Beatles with the following structure: + > Beatles/ + > annotations/ + > audio/ + and copy the Beatles folder to {} """ -DATA = utils.LargeData("beatles_index.json") - class Track(core.Track): """Beatles track class Args: track_id (str): track id of the track + data_home (str): path where the data lives Attributes: audio_path (str): track audio path @@ -76,11 +74,11 @@ def __init__(self, track_id, data_home): self._data_home = data_home self._track_paths = DATA.index["tracks"][track_id] - self.beats_path = utils.none_path_join( + self.beats_path = core.none_path_join( [self._data_home, self._track_paths["beat"][0]] ) self.chords_path = os.path.join(self._data_home, self._track_paths["chords"][0]) - self.keys_path = utils.none_path_join( + self.keys_path = core.none_path_join( [self._data_home, self._track_paths["keys"][0]] ) self.sections_path = os.path.join( @@ -90,22 +88,22 @@ def __init__(self, track_id, data_home): self.title = os.path.basename(self._track_paths["sections"][0]).split(".")[0] - @utils.cached_property + @core.cached_property def beats(self): """BeatData: human-labeled beat annotation""" return load_beats(self.beats_path) - @utils.cached_property + @core.cached_property def chords(self): """ChordData: chord annotation""" return load_chords(self.chords_path) - @utils.cached_property + @core.cached_property def key(self): """KeyData: key annotation""" return load_key(self.keys_path) - @utils.cached_property + @core.cached_property def sections(self): """SectionData: section annotation""" return load_sections(self.sections_path) @@ -150,7 +148,7 @@ def load_beats(beats_path): beats_path (str): path to beat annotation file Returns: - (utils.BeatData): loaded beat data + (annotations.BeatData): loaded beat data """ if beats_path is None: @@ -184,7 +182,7 @@ def load_chords(chords_path): chords_path (str): path to chord annotation file Returns: - (utils.ChordData): loaded chord data + (annotations.ChordData): loaded chord data """ if chords_path is None: @@ -215,7 +213,7 @@ def load_key(keys_path): keys_path (str): path to key annotation file Returns: - (utils.KeyData): loaded key data + (annotations.KeyData): loaded key data """ if keys_path is None: @@ -245,7 +243,7 @@ def load_sections(sections_path): sections_path (str): path to section annotation file Returns: - (utils.SectionData): loaded section data + (annotations.SectionData): loaded section data """ if sections_path is None: @@ -271,7 +269,7 @@ def load_sections(sections_path): def _fix_newpoint(beat_positions): """Fills in missing beat position labels by inferring the beat position - from neighboring beats. + from neighboring beats. """ while np.any(beat_positions == "New Point"): @@ -286,3 +284,36 @@ def _fix_newpoint(beat_positions): beat_positions[beat_positions == "0"] = "4" return beat_positions + + +@core.docstring_inherit(core.Dataset) +class Dataset(core.Dataset): + """The beatles dataset + """ + + def __init__(self, data_home=None): + super().__init__( + data_home, + index=DATA.index, + name="beatles", + track_object=Track, + bibtex=BIBTEX, + remotes=REMOTES, + download_info=DOWNLOAD_INFO, + ) + + @core.copy_docs(load_audio) + def load_audio(self, *args, **kwargs): + return load_audio(*args, **kwargs) + + @core.copy_docs(load_beats) + def load_beats(self, *args, **kwargs): + return load_beats(*args, **kwargs) + + @core.copy_docs(load_chords) + def load_chords(self, *args, **kwargs): + return load_chords(*args, **kwargs) + + @core.copy_docs(load_sections) + def load_sections(self, *args, **kwargs): + return load_sections(*args, **kwargs) diff --git a/mirdata/datasets/beatport_key.py b/mirdata/datasets/beatport_key.py index e4f6ba9b2..5a9cd49ae 100644 --- a/mirdata/datasets/beatport_key.py +++ b/mirdata/datasets/beatport_key.py @@ -17,17 +17,15 @@ Data License: Creative Commons Attribution Share Alike 4.0 International """ - +import csv +import os import fnmatch import json import librosa -import os -import csv from mirdata import download_utils from mirdata import jams_utils from mirdata import core -from mirdata import utils BIBTEX = """@phdthesis {3897, title = {Tonality Estimation in Electronic Dance Music: A Computational and Musically Informed Examination}, @@ -62,11 +60,12 @@ ), } -DATA = utils.LargeData("beatport_key_index.json") +DATA = core.LargeData("beatport_key_index.json") class Track(core.Track): """beatport_key track class + Args: track_id (str): track id of the track data_home (str): Local path where the dataset is stored. @@ -77,6 +76,7 @@ class Track(core.Track): metadata_path (str): sections annotation path title (str): title of the track track_id (str): track id + """ def __init__(self, track_id, data_home): @@ -98,22 +98,22 @@ def __init__(self, track_id, data_home): ) self.title = self.audio_path.replace(".mp3", "").split("/")[-1] - @utils.cached_property + @core.cached_property def key(self): """List of String: list of possible key annotations""" return load_key(self.keys_path) - @utils.cached_property + @core.cached_property def artists(self): """Dict: artist annotation""" return load_artist(self.metadata_path) - @utils.cached_property + @core.cached_property def genres(self): """Dict: genre annotation""" return load_genre(self.metadata_path) - @utils.cached_property + @core.cached_property def tempo(self): """int: tempo beatports crowdsourced annotation""" return load_tempo(self.metadata_path) @@ -139,76 +139,29 @@ def to_jams(self): def load_audio(audio_path): """Load a beatport_key audio file. + Args: audio_path (str): path to audio file + Returns: y (np.ndarray): the mono audio signal sr (float): The sample rate of the audio file + """ if not os.path.exists(audio_path): raise IOError("audio_path {} does not exist".format(audio_path)) return librosa.load(audio_path, sr=None, mono=True) -def find_replace(directory, find, replace, pattern): - """ - Replace in some directory all the songs with the format pattern find by replace - Parameters - ---------- - directory (str) path to directory - find (str) string from replace - replace (str) string to replace - pattern (str) regex that must match the directories searrched - """ - for path, dirs, files in os.walk(os.path.abspath(directory)): - for filename in fnmatch.filter(files, pattern): - filepath = os.path.join(path, filename) - with open(filepath) as f: - s = f.read() - s = s.replace(find, replace) - with open(filepath, "w") as f: - f.write(s) - - -def _download( - save_dir, remotes, partial_download, info_message, force_overwrite, cleanup -): - """Download the dataset. - - Args: - save_dir (str): - The directory to download the data - remotes (dict or None): - A dictionary of RemoteFileMetadata tuples of data in zip format. - If None, there is no data to download - partial_download (list or None): - A list of keys to partially download the remote objects of the download dict. - If None, all data is downloaded - info_message (str or None): - A string of info to print when this function is called. - If None, no string is printed. - force_overwrite (bool): - If True, existing files are overwritten by the downloaded files. - cleanup (bool): - Whether to delete the zip/tar file after extracting. - """ - download_utils.downloader( - save_dir, - remotes=remotes, - partial_download=partial_download, - force_overwrite=force_overwrite, - cleanup=cleanup, - ) - # removing nans from JSON files - find_replace(os.path.join(save_dir, "meta"), ": nan", ": null", "*.json") - - def load_key(keys_path): """Load beatport_key format key data from a file + Args: keys_path (str): path to key annotation file + Returns: (str): loaded key data + """ if keys_path is None: return None @@ -216,8 +169,8 @@ def load_key(keys_path): if not os.path.exists(keys_path): raise IOError("keys_path {} does not exist".format(keys_path)) - with open(keys_path, 'r') as fhandle: - reader = csv.reader(fhandle, delimiter='|') + with open(keys_path, "r") as fhandle: + reader = csv.reader(fhandle, delimiter="|") keys = next(reader) # standarize 'Unknown' to 'X' @@ -227,10 +180,13 @@ def load_key(keys_path): def load_tempo(metadata_path): """Load beatport_key tempo data from a file + Args: metadata_path (str): path to metadata annotation file + Returns: (str): loaded tempo data + """ if metadata_path is None: return None @@ -246,10 +202,13 @@ def load_tempo(metadata_path): def load_genre(metadata_path): """Load beatport_key genre data from a file + Args: metadata_path (str): path to metadata annotation file + Returns: (dict): with the list of strings with genres ['genres'] and list of strings with sub-genres ['sub_genres'] + """ if metadata_path is None: return None @@ -268,10 +227,13 @@ def load_genre(metadata_path): def load_artist(metadata_path): """Load beatport_key tempo data from a file + Args: metadata_path (str): path to metadata annotation file + Returns: (list of strings): list of artists involved in the track. + """ if metadata_path is None: return None @@ -283,3 +245,89 @@ def load_artist(metadata_path): meta = json.load(json_file) return [artist["name"] for artist in meta["artists"]] + + +@core.docstring_inherit(core.Dataset) +class Dataset(core.Dataset): + """The beatport_key dataset + """ + + def __init__(self, data_home=None): + super().__init__( + data_home, + index=DATA.index, + name="beatport_key", + track_object=Track, + bibtex=BIBTEX, + remotes=REMOTES, + ) + + @core.copy_docs(load_audio) + def load_audio(self, *args, **kwargs): + return load_audio(*args, **kwargs) + + @core.copy_docs(load_key) + def load_key(self, *args, **kwargs): + return load_key(*args, **kwargs) + + @core.copy_docs(load_tempo) + def load_tempo(self, *args, **kwargs): + return load_tempo(*args, **kwargs) + + @core.copy_docs(load_genre) + def load_genre(self, *args, **kwargs): + return load_genre(*args, **kwargs) + + @core.copy_docs(load_artist) + def load_artist(self, *args, **kwargs): + return load_artist(*args, **kwargs) + + def download(self, partial_download=None, force_overwrite=False, cleanup=True): + """Download the dataset + + Args: + partial_download (list or None): + A list of keys of remotes to partially download. + If None, all data is downloaded + force_overwrite (bool): + If True, existing files are overwritten by the downloaded files. + By default False. + cleanup (bool): + Whether to delete any zip/tar files after extracting. + + Raises: + ValueError: if invalid keys are passed to partial_download + IOError: if a downloaded file's checksum is different from expected + + """ + download_utils.downloader( + self.data_home, + remotes=self.remotes, + partial_download=partial_download, + force_overwrite=force_overwrite, + cleanup=cleanup, + ) + + self._find_replace( + os.path.join(self.data_home, "meta"), ": nan", ": null", "*.json" + ) + + def _find_replace(self, directory, find, replace, pattern): + """Replace all the files with the format pattern "find" by "replace" + + Args: + directory (str): path to directory + find (str): string from replace + replace (str): string to replace + pattern (str): regex that must match the directories searrched + + """ + for path, dirs, files in os.walk(os.path.abspath(directory)): + for filename in fnmatch.filter(files, pattern): + filepath = os.path.join(path, filename) + with open(filepath) as f: + s = f.read() + s = s.replace(find, replace) + with open(filepath, "w") as f: + f.write(s) + diff --git a/mirdata/datasets/cante100.py b/mirdata/datasets/cante100.py index 0f81235d2..3d31b00c4 100644 --- a/mirdata/datasets/cante100.py +++ b/mirdata/datasets/cante100.py @@ -37,18 +37,17 @@ For more details, please visit: http://www.cofla-project.com/?page_id=134 """ - +import csv +import os import logging +import xml.etree.ElementTree as ET + import librosa -import os import numpy as np -import csv -import xml.etree.ElementTree as ET from mirdata import download_utils from mirdata import jams_utils from mirdata import core -from mirdata import utils from mirdata import annotations @@ -64,8 +63,7 @@ version = {1.0}, doi = {10.5281/zenodo.1322542}, url = {https://doi.org/10.5281/zenodo.1322542} -} - +}, @dataset{nadine_kroher_2018_1324183, author = {Nadine Kroher and José Miguel Díaz-Báñez and @@ -205,7 +203,7 @@ def _load_metadata(data_home): return metadata -DATA = utils.LargeData("cante100_index.json", _load_metadata) +DATA = core.LargeData("cante100_index.json", _load_metadata) class Track(core.Track): @@ -269,12 +267,12 @@ def spectrogram(self): """(np.ndarray, float): spectrogram""" return load_spectrogram(self.spectrogram_path) - @utils.cached_property + @core.cached_property def melody(self): """F0Data: audio signal, sample rate""" return load_melody(self.f0_path) - @utils.cached_property + @core.cached_property def notes(self): """NoteData: audio signal, sample rate""" return load_notes(self.notes_path) @@ -340,8 +338,8 @@ def load_melody(f0_path): times = [] freqs = [] - with open(f0_path, 'r') as fhandle: - reader = csv.reader(fhandle, delimiter=',') + with open(f0_path, "r") as fhandle: + reader = csv.reader(fhandle, delimiter=",") for line in reader: times.append(float(line[0])) freqs.append(float(line[1])) @@ -369,8 +367,8 @@ def load_notes(notes_path): intervals = [] pitches = [] confidence = [] - with open(notes_path, 'r') as fhandle: - reader = csv.reader(fhandle, delimiter=',') + with open(notes_path, "r") as fhandle: + reader = csv.reader(fhandle, delimiter=",") for line in reader: intervals.append([line[0], float(line[0]) + float(line[1])]) # Convert midi value to frequency @@ -382,3 +380,36 @@ def load_notes(notes_path): np.array(pitches, dtype="float"), np.array(confidence, dtype="float"), ) + + +@core.docstring_inherit(core.Dataset) +class Dataset(core.Dataset): + """The cante100 dataset + """ + + def __init__(self, data_home=None): + super().__init__( + data_home, + index=DATA.index, + name="cante100", + track_object=Track, + bibtex=BIBTEX, + remotes=REMOTES, + download_info=DOWNLOAD_INFO, + ) + + @core.copy_docs(load_audio) + def load_audio(self, *args, **kwargs): + return load_audio(*args, **kwargs) + + @core.copy_docs(load_spectrogram) + def load_spectrogram(self, *args, **kwargs): + return load_spectrogram(*args, **kwargs) + + @core.copy_docs(load_melody) + def load_melody(self, *args, **kwargs): + return load_melody(*args, **kwargs) + + @core.copy_docs(load_notes) + def load_notes(self, *args, **kwargs): + return load_notes(*args, **kwargs) diff --git a/mirdata/datasets/dali.py b/mirdata/datasets/dali.py index db189a07c..d03973d98 100644 --- a/mirdata/datasets/dali.py +++ b/mirdata/datasets/dali.py @@ -23,7 +23,6 @@ from mirdata import download_utils from mirdata import jams_utils from mirdata import core -from mirdata import utils from mirdata import annotations # this is the package, needed to load the annotations. @@ -83,7 +82,7 @@ def _load_metadata(data_home): return metadata_index -DATA = utils.LargeData("dali_index.json", _load_metadata) +DATA = core.LargeData("dali_index.json", _load_metadata) class Track(core.Track): @@ -159,27 +158,27 @@ def __init__(self, track_id, data_home): self.language = None self.audio_path = None - @utils.cached_property + @core.cached_property def notes(self): """NoteData: note-aligned lyrics""" return load_annotations_granularity(self.annotation_path, "notes") - @utils.cached_property + @core.cached_property def words(self): """LyricData: word-aligned lyric""" return load_annotations_granularity(self.annotation_path, "words") - @utils.cached_property + @core.cached_property def lines(self): """LyricData: line-aligned lyrics""" return load_annotations_granularity(self.annotation_path, "lines") - @utils.cached_property + @core.cached_property def paragraphs(self): """LyricData: paragraph-aligned lyrics""" return load_annotations_granularity(self.annotation_path, "paragraphs") - @utils.cached_property + @core.cached_property def annotation_object(self): """DALI.Annotations: DALI Annotations object""" return load_annotations_class(self.annotation_path) @@ -278,3 +277,32 @@ def load_annotations_class(annotations_path): with gzip.open(annotations_path, "r") as f: output = pickle.load(f) return output + + +@core.docstring_inherit(core.Dataset) +class Dataset(core.Dataset): + """The dali dataset + """ + + def __init__(self, data_home=None): + super().__init__( + data_home, + index=DATA.index, + name="dali", + track_object=Track, + bibtex=BIBTEX, + remotes=REMOTES, + download_info=DOWNLOAD_INFO, + ) + + @core.copy_docs(load_audio) + def load_audio(self, *args, **kwargs): + return load_audio(*args, **kwargs) + + @core.copy_docs(load_annotations_granularity) + def load_annotations_granularity(self, *args, **kwargs): + return load_annotations_granularity(*args, **kwargs) + + @core.copy_docs(load_annotations_class) + def load_annotations_class(self, *args, **kwargs): + return load_annotations_class(*args, **kwargs) diff --git a/mirdata/datasets/giantsteps_key.py b/mirdata/datasets/giantsteps_key.py index ca552362c..e9b91bec8 100644 --- a/mirdata/datasets/giantsteps_key.py +++ b/mirdata/datasets/giantsteps_key.py @@ -33,7 +33,6 @@ from mirdata import download_utils from mirdata import jams_utils from mirdata import core -from mirdata import utils BIBTEX = """@inproceedings{knees2015two, title={Two data sets for tempo estimation and key detection in electronic dance music annotated from user corrections}, @@ -63,7 +62,7 @@ ), } -DATA = utils.LargeData("giantsteps_key_index.json") +DATA = core.LargeData("giantsteps_key_index.json") class Track(core.Track): @@ -82,7 +81,7 @@ class Track(core.Track): """ def __init__(self, track_id, data_home): - if track_id not in DATA.index['tracks']: + if track_id not in DATA.index["tracks"]: raise ValueError( "{} is not a valid track ID in giantsteps_key".format(track_id) ) @@ -90,7 +89,7 @@ def __init__(self, track_id, data_home): self.track_id = track_id self._data_home = data_home - self._track_paths = DATA.index['tracks'][track_id] + self._track_paths = DATA.index["tracks"][track_id] self.audio_path = os.path.join(self._data_home, self._track_paths["audio"][0]) self.keys_path = os.path.join(self._data_home, self._track_paths["key"][0]) self.metadata_path = ( @@ -100,22 +99,22 @@ def __init__(self, track_id, data_home): ) self.title = self.audio_path.replace(".mp3", "").split("/")[-1] - @utils.cached_property + @core.cached_property def key(self): """String: key annotation""" return load_key(self.keys_path) - @utils.cached_property + @core.cached_property def artists(self): """Dict: artist annotation""" return load_artist(self.metadata_path) - @utils.cached_property + @core.cached_property def genres(self): """Dict: genre annotation""" return load_genre(self.metadata_path) - @utils.cached_property + @core.cached_property def tempo(self): """int: tempo beatports crowdsourced annotation""" return load_tempo(self.metadata_path) @@ -243,3 +242,39 @@ def load_artist(metadata_path): meta = json.load(json_file) return [artist["name"] for artist in meta["artists"]] + + +@core.docstring_inherit(core.Dataset) +class Dataset(core.Dataset): + """The giantsteps_key dataset + """ + + def __init__(self, data_home=None): + super().__init__( + data_home, + index=DATA.index, + name="giantsteps_key", + track_object=Track, + bibtex=BIBTEX, + remotes=REMOTES, + ) + + @core.copy_docs(load_audio) + def load_audio(self, *args, **kwargs): + return load_audio(*args, **kwargs) + + @core.copy_docs(load_key) + def load_key(self, *args, **kwargs): + return load_key(*args, **kwargs) + + @core.copy_docs(load_tempo) + def load_tempo(self, *args, **kwargs): + return load_tempo(*args, **kwargs) + + @core.copy_docs(load_genre) + def load_genre(self, *args, **kwargs): + return load_genre(*args, **kwargs) + + @core.copy_docs(load_artist) + def load_artist(self, *args, **kwargs): + return load_artist(*args, **kwargs) diff --git a/mirdata/datasets/giantsteps_tempo.py b/mirdata/datasets/giantsteps_tempo.py index 357b0aabb..edf5dd94e 100644 --- a/mirdata/datasets/giantsteps_tempo.py +++ b/mirdata/datasets/giantsteps_tempo.py @@ -62,16 +62,15 @@ 3419452.LOFI.mp3 119 3577631.LOFI.mp3 119 """ +import os +import jams import librosa -import os +import numpy as np from mirdata import download_utils from mirdata import core -from mirdata import utils from mirdata import annotations -import numpy as np -import jams BIBTEX = """@inproceedings{knees2015two, @@ -90,7 +89,7 @@ url-pdf={http://www.tagtraum.com/download/2018_schreiber_tempo_giantsteps.pdf}, }""" -DATA = utils.LargeData("giantsteps_tempo_index.json") +DATA = core.LargeData("giantsteps_tempo_index.json") REMOTES = { "annotations": download_utils.RemoteFileMetadata( @@ -123,6 +122,7 @@ class Track(core.Track): track_id (str): track id annotation_v1_path (str): track annotation v1 path annotation_v2_path (str): track annotation v2 path + """ def __init__(self, track_id, data_home): @@ -145,17 +145,17 @@ def __init__(self, track_id, data_home): self.title = self.audio_path.replace(".mp3", "").split("/")[-1].split(".")[0] - @utils.cached_property + @core.cached_property def genre(self): """genre: human-labeled metadata annotation""" return load_genre(self.annotation_v1_path) - @utils.cached_property + @core.cached_property def tempo(self): """TempoData: tempo annotation ordered by confidence""" return load_tempo(self.annotation_v1_path) - @utils.cached_property + @core.cached_property def tempo_v2(self): """TempoData: tempos annotation ordered by confidence""" return load_tempo(self.annotation_v2_path) @@ -232,3 +232,32 @@ def load_tempo(tempo_path): np.array([t.value for t in tempo]), np.array([t.confidence for t in tempo]), ) + + +@core.docstring_inherit(core.Dataset) +class Dataset(core.Dataset): + """The giantsteps_tempo dataset + """ + + def __init__(self, data_home=None): + super().__init__( + data_home, + index=DATA.index, + name="giantsteps_tempo", + track_object=Track, + bibtex=BIBTEX, + remotes=REMOTES, + download_info=DOWNLOAD_INFO, + ) + + @core.copy_docs(load_audio) + def load_audio(self, *args, **kwargs): + return load_audio(*args, **kwargs) + + @core.copy_docs(load_genre) + def load_genre(self, *args, **kwargs): + return load_genre(*args, **kwargs) + + @core.copy_docs(load_tempo) + def load_tempo(self, *args, **kwargs): + return load_tempo(*args, **kwargs) diff --git a/mirdata/datasets/groove_midi.py b/mirdata/datasets/groove_midi.py index d1482afdb..4390f3bb7 100644 --- a/mirdata/datasets/groove_midi.py +++ b/mirdata/datasets/groove_midi.py @@ -52,7 +52,7 @@ import numpy as np import pretty_midi -from mirdata import download_utils, jams_utils, core, utils, annotations +from mirdata import download_utils, jams_utils, core, annotations BIBTEX = """@inproceedings{groove2019, @@ -225,7 +225,7 @@ def _load_metadata(data_home): return metadata_index -DATA = utils.LargeData("groove_midi_index.json", _load_metadata) +DATA = core.LargeData("groove_midi_index.json", _load_metadata) class Track(core.Track): @@ -290,7 +290,7 @@ def __init__(self, track_id, data_home): self.midi_path = os.path.join(self._data_home, self._track_paths["midi"][0]) - self.audio_path = utils.none_path_join( + self.audio_path = core.none_path_join( [self._data_home, self._track_paths["audio"][0]] ) @@ -299,17 +299,17 @@ def audio(self): """(np.ndarray, float): audio signal, sample rate""" return load_audio(self.audio_path) - @utils.cached_property + @core.cached_property def beats(self): """BeatData: machine-generated beat annotation""" return load_beats(self.midi_path, self.midi) - @utils.cached_property + @core.cached_property def drum_events(self): """EventData: annotated drum kit events""" return load_drum_events(self.midi_path, self.midi) - @utils.cached_property + @core.cached_property def midi(self): """(obj): prettyMIDI obj""" return load_midi(self.midi_path) @@ -369,7 +369,7 @@ def load_beats(midi_path, midi=None): if None, the midi object is loaded using midi_path Returns: - beat_data (BeatData) + beat_data (annotations.BeatData) """ if midi is None: @@ -390,7 +390,7 @@ def load_drum_events(midi_path, midi=None): if None, the midi object is loaded using midi_path Returns: - drum_events (EventData) + drum_events (annotations.EventData) """ if midi is None: @@ -407,43 +407,70 @@ def load_drum_events(midi_path, midi=None): return annotations.EventData(np.array([start_times, end_times]).T, events) -def _download( - save_dir, remotes, partial_download, info_message, force_overwrite, cleanup -): - """Download the dataset. +@core.docstring_inherit(core.Dataset) +class Dataset(core.Dataset): + """The groove_midi dataset + """ - Args: - save_dir (str): - The directory to download the data - remotes (dict or None): - A dictionary of RemoteFileMetadata tuples of data in zip format. - If None, there is no data to download - partial_download (list or None): - A list of keys to partially download the remote objects of the download dict. - If None, all data is downloaded - info_message (str or None): - A string of info to print when this function is called. - If None, no string is printed. - force_overwrite (bool): - If True, existing files are overwritten by the downloaded files. - cleanup (bool): - Whether to delete the zip/tar file after extracting. + def __init__(self, data_home=None): + super().__init__( + data_home, + index=DATA.index, + name="groove_midi", + track_object=Track, + bibtex=BIBTEX, + remotes=REMOTES, + ) - """ - download_utils.downloader( - save_dir, - remotes=remotes, - info_message=None, - force_overwrite=force_overwrite, - cleanup=cleanup, - ) + @core.copy_docs(load_audio) + def load_audio(self, *args, **kwargs): + return load_audio(*args, **kwargs) + + @core.copy_docs(load_midi) + def load_midi(self, *args, **kwargs): + return load_midi(*args, **kwargs) + + @core.copy_docs(load_beats) + def load_beats(self, *args, **kwargs): + return load_beats(*args, **kwargs) + + @core.copy_docs(load_drum_events) + def load_drum_events(self, *args, **kwargs): + return load_drum_events(*args, **kwargs) + + def download(self, partial_download=None, force_overwrite=False, cleanup=True): + """Download the dataset + + Args: + partial_download (list or None): + A list of keys of remotes to partially download. + If None, all data is downloaded + force_overwrite (bool): + If True, existing files are overwritten by the downloaded files. + By default False. + cleanup (bool): + Whether to delete any zip/tar files after extracting. + + Raises: + ValueError: if invalid keys are passed to partial_download + IOError: if a downloaded file's checksum is different from expected + + """ + download_utils.downloader( + self.data_home, + partial_download=partial_download, + remotes=self.remotes, + info_message=None, + force_overwrite=force_overwrite, + cleanup=cleanup, + ) - # files get downloaded to a folder called groove - move everything up a level - groove_dir = os.path.join(save_dir, "groove") - groove_files = glob.glob(os.path.join(groove_dir, "*")) + # files get downloaded to a folder called groove - move everything up a level + groove_dir = os.path.join(self.data_home, "groove") + groove_files = glob.glob(os.path.join(groove_dir, "*")) - for fpath in groove_files: - shutil.move(fpath, save_dir) + for fpath in groove_files: + shutil.move(fpath, self.data_home) - if os.path.exists(groove_dir): - shutil.rmtree(groove_dir) + if os.path.exists(groove_dir): + shutil.rmtree(groove_dir) diff --git a/mirdata/datasets/gtzan_genre.py b/mirdata/datasets/gtzan_genre.py index 09773a954..7460ba9ca 100644 --- a/mirdata/datasets/gtzan_genre.py +++ b/mirdata/datasets/gtzan_genre.py @@ -16,7 +16,6 @@ from mirdata import download_utils from mirdata import jams_utils from mirdata import core -from mirdata import utils BIBTEX = """@article{tzanetakis2002gtzan, @@ -34,7 +33,7 @@ ) } -DATA = utils.LargeData("gtzan_genre_index.json") +DATA = core.LargeData("gtzan_genre_index.json") class Track(core.Track): @@ -51,7 +50,7 @@ class Track(core.Track): """ def __init__(self, track_id, data_home): - if track_id not in DATA.index['tracks']: + if track_id not in DATA.index["tracks"]: raise ValueError( "{} is not a valid track ID in GTZAN-Genre".format(track_id) ) @@ -59,7 +58,7 @@ def __init__(self, track_id, data_home): self.track_id = track_id self._data_home = data_home - self._track_paths = DATA.index['tracks'][track_id] + self._track_paths = DATA.index["tracks"][track_id] self.genre = track_id.split(".")[0] if self.genre == "hiphop": @@ -101,3 +100,23 @@ def load_audio(audio_path): raise IOError("audio_path {} does not exist".format(audio_path)) audio, sr = librosa.load(audio_path, sr=22050, mono=True) return audio, sr + + +@core.docstring_inherit(core.Dataset) +class Dataset(core.Dataset): + """The gtzan_genre dataset + """ + + def __init__(self, data_home=None): + super().__init__( + data_home, + index=DATA.index, + name="gtzan_genre", + track_object=Track, + bibtex=BIBTEX, + remotes=REMOTES, + ) + + @core.copy_docs(load_audio) + def load_audio(self, *args, **kwargs): + return load_audio(*args, **kwargs) diff --git a/mirdata/datasets/guitarset.py b/mirdata/datasets/guitarset.py index fc2aec96e..127234d60 100644 --- a/mirdata/datasets/guitarset.py +++ b/mirdata/datasets/guitarset.py @@ -56,7 +56,6 @@ from mirdata import download_utils from mirdata import core -from mirdata import utils from mirdata import annotations @@ -107,7 +106,7 @@ "Funk": "Funk", } _GUITAR_STRINGS = ["E", "A", "D", "G", "B", "e"] -DATA = utils.LargeData("guitarset_index.json") +DATA = core.LargeData("guitarset_index.json") class Track(core.Track): @@ -163,12 +162,12 @@ def __init__(self, track_id, data_home): self.tempo = float(tempo) self.style = _STYLE_DICT[style[:-1]] - @utils.cached_property + @core.cached_property def beats(self): """BeatData: the track's beat positions""" return load_beats(self.jams_path) - @utils.cached_property + @core.cached_property def leadsheet_chords(self): """ChordData: the track's chords as written in the leadsheet""" if self.mode == "solo": @@ -177,7 +176,7 @@ def leadsheet_chords(self): ) return load_chords(self.jams_path, leadsheet_version=True) - @utils.cached_property + @core.cached_property def inferred_chords(self): """ChordData: the track's chords inferred from played transcription""" if self.mode == "solo": @@ -186,14 +185,15 @@ def inferred_chords(self): ) return load_chords(self.jams_path, leadsheet_version=False) - @utils.cached_property + @core.cached_property def key_mode(self): """KeyData: the track's key and mode""" return load_key_mode(self.jams_path) - @utils.cached_property + @core.cached_property def pitch_contours(self): """(dict): a dict that contains 6 F0Data. + From Low E string to high e string. - 'E': F0Data(...), - 'A': F0Data(...), @@ -207,9 +207,10 @@ def pitch_contours(self): contours[_GUITAR_STRINGS[i]] = load_pitch_contour(self.jams_path, i) return contours - @utils.cached_property + @core.cached_property def notes(self): """dict: a dict that contains 6 NoteData. + From Low E string to high e string. - 'E': NoteData(...), - 'A': NoteData(...), @@ -219,7 +220,7 @@ def notes(self): notes = {} # iterate over 6 strings for i in range(6): - notes[_GUITAR_STRINGS[i]] = load_note_ann(self.jams_path, i) + notes[_GUITAR_STRINGS[i]] = load_notes(self.jams_path, i) return notes @property @@ -284,6 +285,15 @@ def load_multitrack_audio(audio_path): def load_beats(jams_path): + """Load a Guitarset beats annotation. + + Args: + jams_path (str): Path of the jams annotation file + + Returns: + (annotations.BeatData): Beat data + + """ if not os.path.exists(jams_path): raise IOError("jams_path {} does not exist".format(jams_path)) jam = jams.load(jams_path) @@ -294,15 +304,17 @@ def load_beats(jams_path): def load_chords(jams_path, leadsheet_version=True): - """ + """Load a guitarset chord annotation. + Args: jams_path (str): Path of the jams annotation file - leadsheet_version (Bool) + leadsheet_version (Bool): Whether or not to load the leadsheet version of the chord annotation If False, load the infered version. Returns: - (ChordData): Chord data + (annotations.ChordData): Chord data + """ if not os.path.exists(jams_path): raise IOError("jams_path {} does not exist".format(jams_path)) @@ -316,6 +328,15 @@ def load_chords(jams_path, leadsheet_version=True): def load_key_mode(jams_path): + """Load a Guitarset key-mode annotation. + + Args: + jams_path (str): Path of the jams annotation file + + Returns: + (annotations.KeyData): Key data + + """ if not os.path.exists(jams_path): raise IOError("jams_path {} does not exist".format(jams_path)) jam = jams.load(jams_path) @@ -325,12 +346,16 @@ def load_key_mode(jams_path): def load_pitch_contour(jams_path, string_num): - """ + """Load a guitarset pitch contour annotation for a given string + Args: jams_path (str): Path of the jams annotation file + string_num (int), in range(6): Which string to load. + 0 is the Low E string, 5 is the high e string. + + Returns: + (annotations.F0Data): Pitch contour data for the given string - string_num (int), in range(6): Which string to load. - 0 is the Low E string, 5 is the high e string. """ if not os.path.exists(jams_path): raise IOError("jams_path {} does not exist".format(jams_path)) @@ -344,13 +369,17 @@ def load_pitch_contour(jams_path, string_num): return annotations.F0Data(times, np.array(frequencies)) -def load_note_ann(jams_path, string_num): - """ +def load_notes(jams_path, string_num): + """Load a guitarset note annotation for a given string + Args: jams_path (str): Path of the jams annotation file + string_num (int), in range(6): Which string to load. + 0 is the Low E string, 5 is the high e string. + + Returns: + (annotations.NoteData): Note data for the given string - string_num (int), in range(6): Which string to load. - 0 is the Low E string, 5 is the high e string. """ if not os.path.exists(jams_path): raise IOError("jams_path {} does not exist".format(jams_path)) @@ -361,3 +390,47 @@ def load_note_ann(jams_path, string_num): if len(values) == 0: return annotations.NoteData(None, None) return annotations.NoteData(intervals, np.array(values)) + + +@core.docstring_inherit(core.Dataset) +class Dataset(core.Dataset): + """The guitarset dataset + """ + + def __init__(self, data_home=None): + super().__init__( + data_home, + index=DATA.index, + name="guitarset", + track_object=Track, + bibtex=BIBTEX, + remotes=REMOTES, + ) + + @core.copy_docs(load_audio) + def load_audio(self, *args, **kwargs): + return load_audio(*args, **kwargs) + + @core.copy_docs(load_multitrack_audio) + def load_multitrack_audio(self, *args, **kwargs): + return load_multitrack_audio(*args, **kwargs) + + @core.copy_docs(load_beats) + def load_beats(self, *args, **kwargs): + return load_beats(*args, **kwargs) + + @core.copy_docs(load_chords) + def load_chords(self, *args, **kwargs): + return load_chords(*args, **kwargs) + + @core.copy_docs(load_key_mode) + def load_key_mode(self, *args, **kwargs): + return load_key_mode(*args, **kwargs) + + @core.copy_docs(load_pitch_contour) + def load_pitch_contour(self, *args, **kwargs): + return load_pitch_contour(*args, **kwargs) + + @core.copy_docs(load_notes) + def load_notes(self, *args, **kwargs): + return load_notes(*args, **kwargs) diff --git a/mirdata/datasets/ikala.py b/mirdata/datasets/ikala.py index ce2fd81ce..d99c43dec 100644 --- a/mirdata/datasets/ikala.py +++ b/mirdata/datasets/ikala.py @@ -20,7 +20,6 @@ from mirdata import download_utils from mirdata import jams_utils from mirdata import core -from mirdata import utils from mirdata import annotations @@ -76,7 +75,7 @@ def _load_metadata(data_home): return singer_map -DATA = utils.LargeData("ikala_index.json", _load_metadata) +DATA = core.LargeData("ikala_index.json", _load_metadata) class Track(core.Track): @@ -118,12 +117,12 @@ def __init__(self, track_id, data_home): else: self.singer_id = None - @utils.cached_property + @core.cached_property def f0(self): """F0Data: The human-annotated singing voice pitch""" return load_f0(self.f0_path) - @utils.cached_property + @core.cached_property def lyrics(self): """LyricData: The human-annotated lyrics""" return load_lyrics(self.lyrics_path) @@ -251,8 +250,43 @@ def load_lyrics(lyrics_path): pronunciations.append("") lyrics_data = annotations.LyricData( - np.array([start_times, end_times]).T, - lyrics, - pronunciations, + np.array([start_times, end_times]).T, lyrics, pronunciations, ) return lyrics_data + + +@core.docstring_inherit(core.Dataset) +class Dataset(core.Dataset): + """The ikala dataset + """ + + def __init__(self, data_home=None): + super().__init__( + data_home, + index=DATA.index, + name="ikala", + track_object=Track, + bibtex=BIBTEX, + remotes=REMOTES, + download_info=DOWNLOAD_INFO, + ) + + @core.copy_docs(load_vocal_audio) + def load_vocal_audio(self, *args, **kwargs): + return load_vocal_audio(*args, **kwargs) + + @core.copy_docs(load_instrumental_audio) + def load_instrumental_audio(self, *args, **kwargs): + return load_instrumental_audio(*args, **kwargs) + + @core.copy_docs(load_mix_audio) + def load_mix_audio(self, *args, **kwargs): + return load_mix_audio(*args, **kwargs) + + @core.copy_docs(load_f0) + def load_f0(self, *args, **kwargs): + return load_f0(*args, **kwargs) + + @core.copy_docs(load_lyrics) + def load_lyrics(self, *args, **kwargs): + return load_lyrics(*args, **kwargs) diff --git a/mirdata/datasets/irmas.py b/mirdata/datasets/irmas.py index 97316728f..1b5378876 100644 --- a/mirdata/datasets/irmas.py +++ b/mirdata/datasets/irmas.py @@ -86,7 +86,6 @@ from mirdata import download_utils from mirdata import jams_utils from mirdata import core -from mirdata import utils BIBTEX = """ @dataset{juan_j_bosch_2014_1290750, @@ -128,7 +127,7 @@ } -DATA = utils.LargeData("irmas_index.json") +DATA = core.LargeData("irmas_index.json") INST_DICT = [ @@ -220,7 +219,7 @@ def __init__(self, track_id, data_home): else: self.train = False - @utils.cached_property + @core.cached_property def instrument(self): """(list, string): predominant instrument""" if self.predominant_instrument is not None: @@ -287,3 +286,27 @@ def load_pred_inst(annotation_path): pred_inst.append(inst_code) return pred_inst + + +@core.docstring_inherit(core.Dataset) +class Dataset(core.Dataset): + """The irmas dataset + """ + + def __init__(self, data_home=None): + super().__init__( + data_home, + index=DATA.index, + name="irmas", + track_object=Track, + bibtex=BIBTEX, + remotes=REMOTES, + ) + + @core.copy_docs(load_audio) + def load_audio(self, *args, **kwargs): + return load_audio(*args, **kwargs) + + @core.copy_docs(load_pred_inst) + def load_pred_inst(self, *args, **kwargs): + return load_pred_inst(*args, **kwargs) diff --git a/mirdata/datasets/maestro.py b/mirdata/datasets/maestro.py index 8304ffd99..143172258 100644 --- a/mirdata/datasets/maestro.py +++ b/mirdata/datasets/maestro.py @@ -40,7 +40,6 @@ from mirdata import download_utils from mirdata import jams_utils from mirdata import core -from mirdata import utils from mirdata import annotations @@ -96,7 +95,7 @@ def _load_metadata(data_home): return metadata -DATA = utils.LargeData("maestro_index.json", _load_metadata) +DATA = core.LargeData("maestro_index.json", _load_metadata) class Track(core.Track): @@ -145,12 +144,12 @@ def __init__(self, track_id, data_home): self.year = None self.duration = None - @utils.cached_property + @core.cached_property def midi(self): """output type: description of output""" return load_midi(self.midi_path) - @utils.cached_property + @core.cached_property def notes(self): """NoteData: annotated piano notes""" return load_notes(self.midi_path, self.midi) @@ -194,7 +193,7 @@ def load_notes(midi_path, midi=None): if None, the midi object is loaded using midi_path Returns: - note_data (NoteData) + note_data (annotations.NoteData) """ if midi is None: @@ -228,52 +227,72 @@ def load_audio(audio_path): return librosa.load(audio_path, sr=None, mono=True) -def _download( - save_dir, remotes, partial_download, info_message, force_overwrite, cleanup -): - """Download the dataset. - Args: - save_dir (str): - The directory to download the data - remotes (dict or None): - A dictionary of RemoteFileMetadata tuples of data in zip format. - If None, there is no data to download - partial_download (list or None): - List indicating what to partially download. The list can include any of: - * 'all': audio, midi and metadata - * 'midi': midi and metadata only - * 'metadata': metadata only - If None, all data is downloaded - info_message (str or None): - A string of info to print when this function is called. - If None, no string is printed. - force_overwrite (bool): - If True, existing files are overwritten by the downloaded files. - cleanup (bool): - Whether to delete the zip/tar file after extracting. - +@core.docstring_inherit(core.Dataset) +class Dataset(core.Dataset): + """The maestro dataset """ - # in MAESTRO "metadata" is contained in "midi" is contained in "all" - if partial_download is None or "all" in partial_download: - partial_download = ["all"] - elif "midi" in partial_download: - partial_download = ["midi"] - - download_utils.downloader( - save_dir, - remotes=remotes, - partial_download=partial_download, - force_overwrite=force_overwrite, - cleanup=cleanup, - ) - # files get downloaded to a folder called maestro-v2.0.0 - # move everything up a level - maestro_dir = os.path.join(save_dir, "maestro-v2.0.0") - maestro_files = glob.glob(os.path.join(maestro_dir, "*")) + def __init__(self, data_home=None): + super().__init__( + data_home, + index=DATA.index, + name="maestro", + track_object=Track, + bibtex=BIBTEX, + remotes=REMOTES, + ) + + @core.copy_docs(load_audio) + def load_audio(self, *args, **kwargs): + return load_audio(*args, **kwargs) + + @core.copy_docs(load_midi) + def load_midi(self, *args, **kwargs): + return load_midi(*args, **kwargs) + + @core.copy_docs(load_notes) + def load_notes(self, *args, **kwargs): + return load_notes(*args, **kwargs) + + def download(self, partial_download=None, force_overwrite=False, cleanup=True): + """Download the dataset + + Args: + partial_download (list or None): + A list of keys of remotes to partially download. + If None, all data is downloaded + force_overwrite (bool): + If True, existing files are overwritten by the downloaded files. + By default False. + cleanup (bool): + Whether to delete any zip/tar files after extracting. + + Raises: + ValueError: if invalid keys are passed to partial_download + IOError: if a downloaded file's checksum is different from expected + + """ + # in MAESTRO "metadata" is contained in "midi" is contained in "all" + if partial_download is None or "all" in partial_download: + partial_download = ["all"] + elif "midi" in partial_download: + partial_download = ["midi"] + + download_utils.downloader( + self.data_home, + remotes=self.remotes, + partial_download=partial_download, + force_overwrite=force_overwrite, + cleanup=cleanup, + ) + + # files get downloaded to a folder called maestro-v2.0.0 + # move everything up a level + maestro_dir = os.path.join(self.data_home, "maestro-v2.0.0") + maestro_files = glob.glob(os.path.join(maestro_dir, "*")) - for fpath in maestro_files: - shutil.move(fpath, save_dir) + for fpath in maestro_files: + shutil.move(fpath, self.data_home) - if os.path.exists(maestro_dir): - shutil.rmtree(maestro_dir) + if os.path.exists(maestro_dir): + shutil.rmtree(maestro_dir) diff --git a/mirdata/datasets/medley_solos_db.py b/mirdata/datasets/medley_solos_db.py index 4a9494132..ba2813ad6 100644 --- a/mirdata/datasets/medley_solos_db.py +++ b/mirdata/datasets/medley_solos_db.py @@ -31,7 +31,6 @@ from mirdata import download_utils from mirdata import jams_utils from mirdata import core -from mirdata import utils BIBTEX = """@inproceedings{lostanlen2019ismir, title={Deep Convolutional Networks in the Pitch Spiral for Musical Instrument Recognition}, @@ -82,7 +81,7 @@ def _load_metadata(data_home): return metadata_index -DATA = utils.LargeData("medley_solos_db_index.json", _load_metadata) +DATA = core.LargeData("medley_solos_db_index.json", _load_metadata) class Track(core.Track): @@ -102,7 +101,7 @@ class Track(core.Track): """ def __init__(self, track_id, data_home): - if track_id not in DATA.index['tracks']: + if track_id not in DATA.index["tracks"]: raise ValueError( "{} is not a valid track ID in Medley-solos-DB".format(track_id) ) @@ -110,7 +109,7 @@ def __init__(self, track_id, data_home): self.track_id = track_id self._data_home = data_home - self._track_paths = DATA.index['tracks'][track_id] + self._track_paths = DATA.index["tracks"][track_id] metadata = DATA.metadata(data_home) if metadata is not None and track_id in metadata: @@ -157,3 +156,23 @@ def load_audio(audio_path): raise IOError("audio_path {} does not exist".format(audio_path)) return librosa.load(audio_path, sr=22050, mono=True) + + +@core.docstring_inherit(core.Dataset) +class Dataset(core.Dataset): + """The medley_solos_db dataset + """ + + def __init__(self, data_home=None): + super().__init__( + data_home, + index=DATA.index, + name="medley_solos_db", + track_object=Track, + bibtex=BIBTEX, + remotes=REMOTES, + ) + + @core.copy_docs(load_audio) + def load_audio(self, *args, **kwargs): + return load_audio(*args, **kwargs) diff --git a/mirdata/datasets/medleydb_melody.py b/mirdata/datasets/medleydb_melody.py index db7d503b0..b55386782 100644 --- a/mirdata/datasets/medleydb_melody.py +++ b/mirdata/datasets/medleydb_melody.py @@ -21,7 +21,6 @@ from mirdata import download_utils from mirdata import jams_utils from mirdata import core -from mirdata import utils from mirdata import annotations BIBTEX = """@inproceedings{bittner2014medleydb, @@ -56,7 +55,7 @@ def _load_metadata(data_home): return metadata -DATA = utils.LargeData("medleydb_melody_index.json", _load_metadata) +DATA = core.LargeData("medleydb_melody_index.json", _load_metadata) class Track(core.Track): @@ -121,17 +120,17 @@ def __init__(self, track_id, data_home): self.is_instrumental = self._track_metadata["is_instrumental"] self.n_sources = self._track_metadata["n_sources"] - @utils.cached_property + @core.cached_property def melody1(self): """F0Data: The pitch of the single most predominant source (often the voice)""" return load_melody(self.melody1_path) - @utils.cached_property + @core.cached_property def melody2(self): """F0Data: The pitch of the predominant source for each point in time""" return load_melody(self.melody2_path) - @utils.cached_property + @core.cached_property def melody3(self): """MultiF0Data: The pitch of any melodic source. Allows for more than one f0 value at a time.""" return load_melody3(self.melody3_path) @@ -204,3 +203,31 @@ def load_melody3(melody_path): times = np.array(times) melody_data = annotations.MultiF0Data(times, freqs_list, conf_list) return melody_data + + +@core.docstring_inherit(core.Dataset) +class Dataset(core.Dataset): + """The medleydb_melody dataset + """ + + def __init__(self, data_home=None): + super().__init__( + data_home, + index=DATA.index, + name="medleydb_melody", + track_object=Track, + bibtex=BIBTEX, + download_info=DOWNLOAD_INFO, + ) + + @core.copy_docs(load_audio) + def load_audio(self, *args, **kwargs): + return load_audio(*args, **kwargs) + + @core.copy_docs(load_melody) + def load_melody(self, *args, **kwargs): + return load_melody(*args, **kwargs) + + @core.copy_docs(load_melody3) + def load_melody3(self, *args, **kwargs): + return load_melody3(*args, **kwargs) diff --git a/mirdata/datasets/medleydb_pitch.py b/mirdata/datasets/medleydb_pitch.py index ea57551d2..3d2cdf234 100644 --- a/mirdata/datasets/medleydb_pitch.py +++ b/mirdata/datasets/medleydb_pitch.py @@ -21,7 +21,6 @@ from mirdata import download_utils from mirdata import jams_utils from mirdata import core -from mirdata import utils from mirdata import annotations @@ -57,7 +56,7 @@ def _load_metadata(data_home): return metadata -DATA = utils.LargeData("medleydb_pitch_index.json", _load_metadata) +DATA = core.LargeData("medleydb_pitch_index.json", _load_metadata) class Track(core.Track): @@ -106,7 +105,7 @@ def __init__(self, track_id, data_home): self.title = self._track_metadata["title"] self.genre = self._track_metadata["genre"] - @utils.cached_property + @core.cached_property def pitch(self): """F0Data: The human-annotated pitch""" return load_pitch(self.pitch_path) @@ -159,3 +158,27 @@ def load_pitch(pitch_path): confidence = (freqs > 0).astype(float) pitch_data = annotations.F0Data(times, freqs, confidence) return pitch_data + + +@core.docstring_inherit(core.Dataset) +class Dataset(core.Dataset): + """The medleydb_pitch dataset + """ + + def __init__(self, data_home=None): + super().__init__( + data_home, + index=DATA.index, + name="medleydb_pitch", + track_object=Track, + bibtex=BIBTEX, + download_info=DOWNLOAD_INFO, + ) + + @core.copy_docs(load_audio) + def load_audio(self, *args, **kwargs): + return load_audio(*args, **kwargs) + + @core.copy_docs(load_pitch) + def load_pitch(self, *args, **kwargs): + return load_pitch(*args, **kwargs) diff --git a/mirdata/datasets/mridangam_stroke.py b/mirdata/datasets/mridangam_stroke.py index 58cd04ac3..5ef5be486 100644 --- a/mirdata/datasets/mridangam_stroke.py +++ b/mirdata/datasets/mridangam_stroke.py @@ -40,7 +40,6 @@ from mirdata import download_utils from mirdata import jams_utils from mirdata import core -from mirdata import utils BIBTEX = """@article{Anantapadmanabhan2013, author = {Anantapadmanabhan, Akshay and Bellur, Ashwin and Murthy, Hema A.}, @@ -64,7 +63,7 @@ ), } -DATA = utils.LargeData("mridangam_stroke_index.json") +DATA = core.LargeData("mridangam_stroke_index.json") STROKE_DICT = { @@ -145,3 +144,23 @@ def load_audio(audio_path): if not os.path.exists(audio_path): raise IOError("audio_path {} does not exist".format(audio_path)) return librosa.load(audio_path, sr=44100, mono=True) + + +@core.docstring_inherit(core.Dataset) +class Dataset(core.Dataset): + """The mridangam_stroke dataset + """ + + def __init__(self, data_home=None): + super().__init__( + data_home, + index=DATA.index, + name="mridangam_stroke", + track_object=Track, + bibtex=BIBTEX, + remotes=REMOTES, + ) + + @core.copy_docs(load_audio) + def load_audio(self, *args, **kwargs): + return load_audio(*args, **kwargs) diff --git a/mirdata/datasets/orchset.py b/mirdata/datasets/orchset.py index 24142fb78..2d81cdf02 100644 --- a/mirdata/datasets/orchset.py +++ b/mirdata/datasets/orchset.py @@ -21,7 +21,6 @@ from mirdata import download_utils from mirdata import jams_utils from mirdata import core -from mirdata import utils from mirdata import annotations BIBTEX = """@article{bosch2016evaluation, @@ -104,7 +103,7 @@ def _load_metadata(data_home): return metadata_index -DATA = utils.LargeData("orchset_index.json", _load_metadata) +DATA = core.LargeData("orchset_index.json", _load_metadata) class Track(core.Track): @@ -181,7 +180,7 @@ def __init__(self, track_id, data_home): self.only_winds = self._track_metadata["only_winds"] self.only_brass = self._track_metadata["only_brass"] - @utils.cached_property + @core.cached_property def melody(self): """F0Data: melody annotation""" return load_melody(self.melody_path) @@ -239,45 +238,6 @@ def load_audio_stereo(audio_path): return librosa.load(audio_path, sr=None, mono=False) -def _download( - save_dir, remotes, partial_download, info_message, force_overwrite, cleanup -): - """Download the dataset. - - Args: - save_dir (str): - The directory to download the data - remotes (dict or None): - A dictionary of RemoteFileMetadata tuples of data in zip format. - If None, there is no data to download - partial_download (list or None): - A list of keys to partially download the remote objects of the download dict. - If None, all data is downloaded - info_message (str or None): - A string of info to print when this function is called. - If None, no string is printed. - force_overwrite (bool): - If True, existing files are overwritten by the downloaded files. - cleanup (bool): - Whether to delete the zip/tar file after extracting. - - """ - download_utils.downloader( - save_dir, - remotes=remotes, - info_message=None, - force_overwrite=force_overwrite, - cleanup=cleanup, - ) - # files get downloaded to a folder called Orchset - move everything up a level - duplicated_orchset_dir = os.path.join(save_dir, "Orchset") - orchset_files = glob.glob(os.path.join(duplicated_orchset_dir, "*")) - for fpath in orchset_files: - shutil.move(fpath, save_dir) - if os.path.exists(duplicated_orchset_dir): - shutil.rmtree(duplicated_orchset_dir) - - def load_melody(melody_path): if not os.path.exists(melody_path): raise IOError("melody_path {} does not exist".format(melody_path)) @@ -296,3 +256,65 @@ def load_melody(melody_path): np.array(times), np.array(freqs), np.array(confidence) ) return melody_data + + +@core.docstring_inherit(core.Dataset) +class Dataset(core.Dataset): + """The orchset dataset + """ + + def __init__(self, data_home=None): + super().__init__( + data_home, + index=DATA.index, + name="orchset", + track_object=Track, + bibtex=BIBTEX, + remotes=REMOTES, + ) + + @core.copy_docs(load_audio_mono) + def load_audio_mono(self, *args, **kwargs): + return load_audio_mono(*args, **kwargs) + + @core.copy_docs(load_audio_stereo) + def load_audio_stereo(self, *args, **kwargs): + return load_audio_stereo(*args, **kwargs) + + @core.copy_docs(load_melody) + def load_melody(self, *args, **kwargs): + return load_melody(*args, **kwargs) + + def download(self, partial_download=None, force_overwrite=False, cleanup=True): + """Download the dataset + + Args: + partial_download (list or None): + A list of keys of remotes to partially download. + If None, all data is downloaded + force_overwrite (bool): + If True, existing files are overwritten by the downloaded files. + By default False. + cleanup (bool): + Whether to delete any zip/tar files after extracting. + + Raises: + ValueError: if invalid keys are passed to partial_download + IOError: if a downloaded file's checksum is different from expected + + """ + download_utils.downloader( + self.data_home, + remotes=self.remotes, + info_message=None, + force_overwrite=force_overwrite, + cleanup=cleanup, + ) + # files get downloaded to a folder called Orchset - move everything up a level + duplicated_orchset_dir = os.path.join(self.data_home, "Orchset") + orchset_files = glob.glob(os.path.join(duplicated_orchset_dir, "*")) + for fpath in orchset_files: + shutil.move(fpath, self.data_home) + if os.path.exists(duplicated_orchset_dir): + shutil.rmtree(duplicated_orchset_dir) + diff --git a/mirdata/datasets/rwc_classical.py b/mirdata/datasets/rwc_classical.py index dd8db5dac..3905ea6bb 100644 --- a/mirdata/datasets/rwc_classical.py +++ b/mirdata/datasets/rwc_classical.py @@ -47,7 +47,6 @@ from mirdata import download_utils from mirdata import jams_utils from mirdata import core -from mirdata import utils from mirdata import annotations BIBTEX = """@inproceedings{goto2002rwc, @@ -132,7 +131,7 @@ def _load_metadata(data_home): return metadata_index -DATA = utils.LargeData("rwc_classical_index.json", _load_metadata) +DATA = core.LargeData("rwc_classical_index.json", _load_metadata) class Track(core.Track): @@ -198,12 +197,12 @@ def __init__(self, track_id, data_home): self.duration = self._track_metadata["duration"] self.category = self._track_metadata["category"] - @utils.cached_property + @core.cached_property def sections(self): """SectionData: human labeled section annotations""" return load_sections(self.sections_path) - @utils.cached_property + @core.cached_property def beats(self): """BeatData: human labeled beat annotations""" return load_beats(self.beats_path) @@ -241,6 +240,15 @@ def load_audio(audio_path): def load_sections(sections_path): + """Load rwc section data from a file + + Args: + sections_path (str): path to sections annotation file + + Returns: + (annotations.SectionData): section data + + """ if not os.path.exists(sections_path): raise IOError("sections_path {} does not exist".format(sections_path)) @@ -259,8 +267,16 @@ def load_sections(sections_path): def _position_in_bar(beat_positions, beat_times): - """ - Mapping to beat position in bar (e.g. 1, 2, 3, 4). + """Map raw rwc eat data to beat position in bar (e.g. 1, 2, 3, 4). + + Args: + beat_positions (np.ndarray): raw rwc beat positions + beat_times (np.ndarray): raw rwc time stamps + + Returns: + beat_positions_corrected (np.ndarray): normalized beat positions + beat_times_corrected (np.ndarray): normalized time stamps + """ # Remove -1 _beat_positions = np.delete(beat_positions, np.where(beat_positions == -1)) @@ -288,6 +304,15 @@ def _position_in_bar(beat_positions, beat_times): def load_beats(beats_path): + """Load rwc beat data from a file + + Args: + beats_path (str): path to beats annotation file + + Returns: + (annotations.BeatData): beat data + + """ if not os.path.exists(beats_path): raise IOError("beats_path {} does not exist".format(beats_path)) @@ -307,6 +332,15 @@ def load_beats(beats_path): def _duration_to_sec(duration): + """Convert min:sec duration values to seconds + + Args: + duration (str): duration in form min:sec + + Returns: + (float): duration in seconds + + """ if type(duration) == str: if ":" in duration: if len(duration.split(":")) <= 2: @@ -317,3 +351,36 @@ def _duration_to_sec(duration): ) # mistake in annotation in RM-J044 total_secs = float(minutes) * 60 + float(secs) return total_secs + else: + raise ValueError( + "Expected duration to have type str, got {}".format(type(duration)) + ) + + +@core.docstring_inherit(core.Dataset) +class Dataset(core.Dataset): + """The rwc_classical dataset + """ + + def __init__(self, data_home=None): + super().__init__( + data_home, + index=DATA.index, + name="rwc_classical", + track_object=Track, + bibtex=BIBTEX, + remotes=REMOTES, + download_info=DOWNLOAD_INFO, + ) + + @core.copy_docs(load_audio) + def load_audio(self, *args, **kwargs): + return load_audio(*args, **kwargs) + + @core.copy_docs(load_sections) + def load_sections(self, *args, **kwargs): + return load_sections(*args, **kwargs) + + @core.copy_docs(load_beats) + def load_beats(self, *args, **kwargs): + return load_beats(*args, **kwargs) diff --git a/mirdata/datasets/rwc_jazz.py b/mirdata/datasets/rwc_jazz.py index c27077c40..67bab37e0 100644 --- a/mirdata/datasets/rwc_jazz.py +++ b/mirdata/datasets/rwc_jazz.py @@ -40,7 +40,6 @@ from mirdata import download_utils from mirdata import jams_utils from mirdata import core -from mirdata import utils # these functions are identical for all rwc datasets from mirdata.datasets.rwc_classical import ( @@ -132,7 +131,7 @@ def _load_metadata(data_home): return metadata_index -DATA = utils.LargeData("rwc_jazz_index.json", _load_metadata) +DATA = core.LargeData("rwc_jazz_index.json", _load_metadata) class Track(core.Track): @@ -196,12 +195,12 @@ def __init__(self, track_id, data_home): self.variation = self._track_metadata["variation"] self.instruments = self._track_metadata["instruments"] - @utils.cached_property + @core.cached_property def sections(self): """SectionData: human-labeled section data""" return load_sections(self.sections_path) - @utils.cached_property + @core.cached_property def beats(self): """BeatData: human-labeled beat data""" return load_beats(self.beats_path) @@ -219,3 +218,32 @@ def to_jams(self): section_data=[(self.sections, None)], metadata=self._track_metadata, ) + + +@core.docstring_inherit(core.Dataset) +class Dataset(core.Dataset): + """The rwc_jazz dataset + """ + + def __init__(self, data_home=None): + super().__init__( + data_home, + index=DATA.index, + name="rwc_jazz", + track_object=Track, + bibtex=BIBTEX, + remotes=REMOTES, + download_info=DOWNLOAD_INFO, + ) + + @core.copy_docs(load_audio) + def load_audio(self, *args, **kwargs): + return load_audio(*args, **kwargs) + + @core.copy_docs(load_sections) + def load_sections(self, *args, **kwargs): + return load_sections(*args, **kwargs) + + @core.copy_docs(load_beats) + def load_beats(self, *args, **kwargs): + return load_beats(*args, **kwargs) diff --git a/mirdata/datasets/rwc_popular.py b/mirdata/datasets/rwc_popular.py index 45837006c..2dd363139 100644 --- a/mirdata/datasets/rwc_popular.py +++ b/mirdata/datasets/rwc_popular.py @@ -19,7 +19,6 @@ from mirdata import download_utils from mirdata import jams_utils from mirdata import core -from mirdata import utils from mirdata import annotations # these functions are identical for all rwc datasets @@ -143,7 +142,7 @@ def _load_metadata(data_home): return metadata_index -DATA = utils.LargeData("rwc_popular_index.json", _load_metadata) +DATA = core.LargeData("rwc_popular_index.json", _load_metadata) class Track(core.Track): @@ -223,25 +222,25 @@ def __init__(self, track_id, data_home): self.instruments = self._track_metadata["instruments"] self.drum_information = self._track_metadata["drum_information"] - @utils.cached_property + @core.cached_property def sections(self): """SectionData: human-labeled section annotation""" return load_sections(self.sections_path) - @utils.cached_property + @core.cached_property def beats(self): """BeatData: human-labeled beat annotation""" return load_beats(self.beats_path) - @utils.cached_property + @core.cached_property def chords(self): """ChordData: human-labeled chord annotation""" return load_chords(self.chords_path) - @utils.cached_property + @core.cached_property def vocal_instrument_activity(self): """EventData: human-labeled vocal/instrument activity""" - return load_voca_inst(self.voca_inst_path) + return load_vocal_activity(self.voca_inst_path) @property def audio(self): @@ -260,6 +259,15 @@ def to_jams(self): def load_chords(chords_path): + """Load rwc chord data from a file + + Args: + chords_path (str): path to chord annotation file + + Returns: + (annotations.ChordData): chord data + + """ if not os.path.exists(chords_path): raise IOError("chords_path {} does not exist".format(chords_path)) @@ -278,15 +286,26 @@ def load_chords(chords_path): return annotations.ChordData(np.array([begs, ends]).T, chords) -def load_voca_inst(voca_inst_path): - if not os.path.exists(voca_inst_path): - raise IOError("voca_inst_path {} does not exist".format(voca_inst_path)) +def load_vocal_activity(vocal_activity_path): + """Load rwc vocal activity data from a file + + Args: + vocal_activity_path (str): path to vocal activity annotation file + + Returns: + (annotations.EventData): vocal activity data + + """ + if not os.path.exists(vocal_activity_path): + raise IOError( + "vocal_activity_path {} does not exist".format(vocal_activity_path) + ) begs = [] # timestamps of vocal-instrument activity beginnings ends = [] # timestamps of vocal-instrument activity endings events = [] # vocal-instrument activity labels - with open(voca_inst_path, "r") as fhandle: + with open(vocal_activity_path, "r") as fhandle: reader = csv.reader(fhandle, delimiter="\t") raw_data = [] for line in reader: @@ -301,3 +320,40 @@ def load_voca_inst(voca_inst_path): events.append(raw_data[i][1]) return annotations.EventData(np.array([begs, ends]).T, events) + + +@core.docstring_inherit(core.Dataset) +class Dataset(core.Dataset): + """The rwc_popular dataset + """ + + def __init__(self, data_home=None): + super().__init__( + data_home, + index=DATA.index, + name="rwc_popular", + track_object=Track, + bibtex=BIBTEX, + remotes=REMOTES, + download_info=DOWNLOAD_INFO, + ) + + @core.copy_docs(load_audio) + def load_audio(self, *args, **kwargs): + return load_audio(*args, **kwargs) + + @core.copy_docs(load_sections) + def load_sections(self, *args, **kwargs): + return load_sections(*args, **kwargs) + + @core.copy_docs(load_beats) + def load_beats(self, *args, **kwargs): + return load_beats(*args, **kwargs) + + @core.copy_docs(load_chords) + def load_chords(self, *args, **kwargs): + return load_chords(*args, **kwargs) + + @core.copy_docs(load_vocal_activity) + def load_vocal_activity(self, *args, **kwargs): + return load_vocal_activity(*args, **kwargs) diff --git a/mirdata/datasets/salami.py b/mirdata/datasets/salami.py index 090149d4b..84bb87ddd 100644 --- a/mirdata/datasets/salami.py +++ b/mirdata/datasets/salami.py @@ -21,7 +21,6 @@ from mirdata import download_utils from mirdata import jams_utils from mirdata import core -from mirdata import utils from mirdata import annotations BIBTEX = """@inproceedings{smith2011salami, @@ -96,7 +95,7 @@ def _load_metadata(data_home): return metadata_index -DATA = utils.LargeData("salami_index.json", _load_metadata) +DATA = core.LargeData("salami_index.json", _load_metadata) class Track(core.Track): @@ -132,16 +131,16 @@ def __init__(self, track_id, data_home): self._data_home = data_home self._track_paths = DATA.index["tracks"][track_id] - self.sections_annotator1_uppercase_path = utils.none_path_join( + self.sections_annotator1_uppercase_path = core.none_path_join( [self._data_home, self._track_paths["annotator_1_uppercase"][0]] ) - self.sections_annotator1_lowercase_path = utils.none_path_join( + self.sections_annotator1_lowercase_path = core.none_path_join( [self._data_home, self._track_paths["annotator_1_lowercase"][0]] ) - self.sections_annotator2_uppercase_path = utils.none_path_join( + self.sections_annotator2_uppercase_path = core.none_path_join( [self._data_home, self._track_paths["annotator_2_uppercase"][0]] ) - self.sections_annotator2_lowercase_path = utils.none_path_join( + self.sections_annotator2_lowercase_path = core.none_path_join( [self._data_home, self._track_paths["annotator_2_lowercase"][0]] ) @@ -174,28 +173,28 @@ def __init__(self, track_id, data_home): self.broad_genre = self._track_metadata["class"] self.genre = self._track_metadata["genre"] - @utils.cached_property + @core.cached_property def sections_annotator_1_uppercase(self): """SectionData: annotations in hierarchy level 0 from annotator 1""" if self.sections_annotator1_uppercase_path is None: return None return load_sections(self.sections_annotator1_uppercase_path) - @utils.cached_property + @core.cached_property def sections_annotator_1_lowercase(self): """SectionData: annotations in hierarchy level 1 from annotator 1""" if self.sections_annotator1_lowercase_path is None: return None return load_sections(self.sections_annotator1_lowercase_path) - @utils.cached_property + @core.cached_property def sections_annotator_2_uppercase(self): """SectionData: annotations in hierarchy level 0 from annotator 2""" if self.sections_annotator2_uppercase_path is None: return None return load_sections(self.sections_annotator2_uppercase_path) - @utils.cached_property + @core.cached_property def sections_annotator_2_lowercase(self): """SectionData: annotations in hierarchy level 1 from annotator 2""" if self.sections_annotator2_lowercase_path is None: @@ -249,6 +248,15 @@ def load_audio(audio_path): def load_sections(sections_path): + """Load salami sections data from a file + + Args: + sections_path (str): path to sectin annotation file + + Returns: + (annotations.SectionData): section data + + """ if sections_path is None: return None @@ -271,3 +279,28 @@ def load_sections(sections_path): return annotations.SectionData( np.array([times_revised[:-1], times_revised[1:]]).T, list(secs_revised[:-1]) ) + + +@core.docstring_inherit(core.Dataset) +class Dataset(core.Dataset): + """The salami dataset + """ + + def __init__(self, data_home=None): + super().__init__( + data_home, + index=DATA.index, + name="salami", + track_object=Track, + bibtex=BIBTEX, + remotes=REMOTES, + download_info=DOWNLOAD_INFO, + ) + + @core.copy_docs(load_audio) + def load_audio(self, *args, **kwargs): + return load_audio(*args, **kwargs) + + @core.copy_docs(load_sections) + def load_sections(self, *args, **kwargs): + return load_sections(*args, **kwargs) diff --git a/mirdata/datasets/saraga_carnatic.py b/mirdata/datasets/saraga_carnatic.py index 8b09bf13d..b942a0e16 100644 --- a/mirdata/datasets/saraga_carnatic.py +++ b/mirdata/datasets/saraga_carnatic.py @@ -34,7 +34,6 @@ from mirdata import download_utils from mirdata import jams_utils from mirdata import core -from mirdata import utils from mirdata import annotations BIBTEX = """ @@ -76,7 +75,7 @@ def _load_metadata(metadata_path): return metadata -DATA = utils.LargeData("saraga_carnatic_index.json", _load_metadata) +DATA = core.LargeData("saraga_carnatic_index.json", _load_metadata) class Track(core.Track): @@ -142,28 +141,28 @@ def __init__(self, track_id, data_home): ) # Annotation paths - self.ctonic_path = utils.none_path_join( + self.ctonic_path = core.none_path_join( [self._data_home, self._track_paths["ctonic"][0]] ) - self.pitch_path = utils.none_path_join( + self.pitch_path = core.none_path_join( [self._data_home, self._track_paths["pitch"][0]] ) - self.pitch_vocal_path = utils.none_path_join( + self.pitch_vocal_path = core.none_path_join( [self._data_home, self._track_paths["pitch-vocal"][0]] ) - self.tempo_path = utils.none_path_join( + self.tempo_path = core.none_path_join( [self._data_home, self._track_paths["tempo"][0]] ) - self.sama_path = utils.none_path_join( + self.sama_path = core.none_path_join( [self._data_home, self._track_paths["sama"][0]] ) - self.sections_path = utils.none_path_join( + self.sections_path = core.none_path_join( [self._data_home, self._track_paths["sections"][0]] ) - self.phrases_path = utils.none_path_join( + self.phrases_path = core.none_path_join( [self._data_home, self._track_paths["phrases"][0]] ) - self.metadata_path = utils.none_path_join( + self.metadata_path = core.none_path_join( [self._data_home, self._track_paths["metadata"][0]] ) @@ -219,37 +218,37 @@ def __init__(self, track_id, data_home): else None ) - @utils.cached_property + @core.cached_property def tonic(self): """Float: tonic annotation""" return load_tonic(self.ctonic_path) - @utils.cached_property + @core.cached_property def pitch(self): """F0Data: pitch annotation""" return load_pitch(self.pitch_path) - @utils.cached_property + @core.cached_property def pitch_vocal(self): """F0Data: pitch vocal annotations""" return load_pitch(self.pitch_vocal_path) - @utils.cached_property + @core.cached_property def tempo(self): """Dict: tempo annotations""" return load_tempo(self.tempo_path) - @utils.cached_property + @core.cached_property def sama(self): """BeatData: sama section annotations""" return load_sama(self.sama_path) - @utils.cached_property + @core.cached_property def sections(self): """SectionData: track section annotations""" return load_sections(self.sections_path) - @utils.cached_property + @core.cached_property def phrases(self): """EventData: phrase annotations""" return load_phrases(self.phrases_path) @@ -507,3 +506,47 @@ def load_phrases(phrases_path): return None return annotations.EventData(np.array([start_times, end_times]).T, events) + + +@core.docstring_inherit(core.Dataset) +class Dataset(core.Dataset): + """The saraga_carnatic dataset + """ + + def __init__(self, data_home=None): + super().__init__( + data_home, + index=DATA.index, + name="saraga_carnatic", + track_object=Track, + bibtex=BIBTEX, + remotes=REMOTES, + ) + + @core.copy_docs(load_audio) + def load_audio(self, *args, **kwargs): + return load_audio(*args, **kwargs) + + @core.copy_docs(load_tonic) + def load_tonic(self, *args, **kwargs): + return load_tonic(*args, **kwargs) + + @core.copy_docs(load_pitch) + def load_pitch(self, *args, **kwargs): + return load_pitch(*args, **kwargs) + + @core.copy_docs(load_tempo) + def load_tempo(self, *args, **kwargs): + return load_tempo(*args, **kwargs) + + @core.copy_docs(load_sama) + def load_sama(self, *args, **kwargs): + return load_sama(*args, **kwargs) + + @core.copy_docs(load_sections) + def load_sections(self, *args, **kwargs): + return load_sections(*args, **kwargs) + + @core.copy_docs(load_phrases) + def load_phrases(self, *args, **kwargs): + return load_phrases(*args, **kwargs) diff --git a/mirdata/datasets/saraga_hindustani.py b/mirdata/datasets/saraga_hindustani.py index 7a9f51b0e..9ab56ee63 100644 --- a/mirdata/datasets/saraga_hindustani.py +++ b/mirdata/datasets/saraga_hindustani.py @@ -33,7 +33,7 @@ from mirdata import download_utils from mirdata import jams_utils from mirdata import core -from mirdata import utils, annotations +from mirdata import annotations BIBTEX = """ @dataset{bozkurt_b_2018_4301737, @@ -74,7 +74,7 @@ def _load_metadata(metadata_path): return metadata -DATA = utils.LargeData("saraga_hindustani_index.json", _load_metadata) +DATA = core.LargeData("saraga_hindustani_index.json", _load_metadata) class Track(core.Track): @@ -113,25 +113,25 @@ def __init__(self, track_id, data_home): self.audio_path = os.path.join(self._data_home, self._track_paths["audio"][0]) # Annotation paths - self.ctonic_path = utils.none_path_join( + self.ctonic_path = core.none_path_join( [self._data_home, self._track_paths["ctonic"][0]] ) - self.pitch_path = utils.none_path_join( + self.pitch_path = core.none_path_join( [self._data_home, self._track_paths["pitch"][0]] ) - self.tempo_path = utils.none_path_join( + self.tempo_path = core.none_path_join( [self._data_home, self._track_paths["tempo"][0]] ) - self.sama_path = utils.none_path_join( + self.sama_path = core.none_path_join( [self._data_home, self._track_paths["sama"][0]] ) - self.sections_path = utils.none_path_join( + self.sections_path = core.none_path_join( [self._data_home, self._track_paths["sections"][0]] ) - self.phrases_path = utils.none_path_join( + self.phrases_path = core.none_path_join( [self._data_home, self._track_paths["phrases"][0]] ) - self.metadata_path = utils.none_path_join( + self.metadata_path = core.none_path_join( [self._data_home, self._track_paths["metadata"][0]] ) @@ -193,32 +193,32 @@ def __init__(self, track_id, data_home): else None ) - @utils.cached_property + @core.cached_property def tonic(self): """Float: tonic annotation""" return load_tonic(self.ctonic_path) - @utils.cached_property + @core.cached_property def pitch(self): """F0Data: pitch annotation""" return load_pitch(self.pitch_path) - @utils.cached_property + @core.cached_property def tempo(self): """Dict: tempo annotations""" return load_tempo(self.tempo_path) - @utils.cached_property + @core.cached_property def sama(self): """BeatData: sama section annotations""" return load_sama(self.sama_path) - @utils.cached_property + @core.cached_property def sections(self): """SectionData: track section annotations""" return load_sections(self.sections_path) - @utils.cached_property + @core.cached_property def phrases(self): """EventData: phrase annotations""" return load_phrases(self.phrases_path) @@ -279,8 +279,8 @@ def load_tonic(tonic_path): if not os.path.exists(tonic_path): raise IOError("tonic_path {} does not exist".format(tonic_path)) - with open(tonic_path, 'r') as fhandle: - reader = csv.reader(fhandle, delimiter='\t') + with open(tonic_path, "r") as fhandle: + reader = csv.reader(fhandle, delimiter="\t") for line in reader: tonic = float(line[0]) @@ -305,8 +305,8 @@ def load_pitch(pitch_path): times = [] freqs = [] - with open(pitch_path, 'r') as fhandle: - reader = csv.reader(fhandle, delimiter='\t') + with open(pitch_path, "r") as fhandle: + reader = csv.reader(fhandle, delimiter="\t") for line in reader: times.append(float(line[0])) freqs.append(float(line[1])) @@ -351,14 +351,14 @@ def load_tempo(tempo_path): sections = [] with open(sections_abs_path, "r") as fhandle: - reader = csv.reader(fhandle, delimiter=',') + reader = csv.reader(fhandle, delimiter=",") for line in reader: if line != "\n": sections.append(line[3]) section_count = 0 - with open(tempo_path, 'r') as fhandle: - reader = csv.reader(fhandle, delimiter=',') + with open(tempo_path, "r") as fhandle: + reader = csv.reader(fhandle, delimiter=",") for line in reader: if "NaN" in line: @@ -411,8 +411,8 @@ def load_sama(sama_path): beat_times = [] beat_positions = [] - with open(sama_path, 'r') as fhandle: - reader = csv.reader(fhandle, delimiter='\t') + with open(sama_path, "r") as fhandle: + reader = csv.reader(fhandle, delimiter="\t") for line in reader: beat_times.append(float(line[0])) beat_positions.append(1) @@ -443,20 +443,13 @@ def load_sections(sections_path): section_labels = [] with open(sections_path, "r") as fhandle: - reader = csv.reader(fhandle, delimiter=',') + reader = csv.reader(fhandle, delimiter=",") for line in reader: if line: intervals.append( - [ - float(line[0]), - float(line[0]) + float(line[2]), - ] - ) - section_labels.append( - str(line[3]) - + "-" - + str(line[1]) + [float(line[0]), float(line[0]) + float(line[2]),] ) + section_labels.append(str(line[3]) + "-" + str(line[1])) # Return None if sections file is empty if not intervals: @@ -485,19 +478,61 @@ def load_phrases(phrases_path): start_times = [] end_times = [] events = [] - with open(phrases_path, 'r') as fhandle: - reader = csv.reader(fhandle, delimiter='\t') + with open(phrases_path, "r") as fhandle: + reader = csv.reader(fhandle, delimiter="\t") for line in reader: start_times.append(float(line[0])) - end_times.append( - float(line[0]) + float(line[2]) - ) + end_times.append(float(line[0]) + float(line[2])) if len(line) == 4: - events.append(str(line[3].split('\n')[0])) + events.append(str(line[3].split("\n")[0])) else: - events.append('') + events.append("") if not start_times: return None return annotations.EventData(np.array([start_times, end_times]).T, events) + + +@core.docstring_inherit(core.Dataset) +class Dataset(core.Dataset): + """The saraga_hindustani dataset + """ + + def __init__(self, data_home=None): + super().__init__( + data_home, + index=DATA.index, + name="saraga_hindustani", + track_object=Track, + bibtex=BIBTEX, + remotes=REMOTES, + ) + + @core.copy_docs(load_audio) + def load_audio(self, *args, **kwargs): + return load_audio(*args, **kwargs) + + @core.copy_docs(load_tonic) + def load_tonic(self, *args, **kwargs): + return load_tonic(*args, **kwargs) + + @core.copy_docs(load_pitch) + def load_pitch(self, *args, **kwargs): + return load_pitch(*args, **kwargs) + + @core.copy_docs(load_tempo) + def load_tempo(self, *args, **kwargs): + return load_tempo(*args, **kwargs) + + @core.copy_docs(load_sama) + def load_sama(self, *args, **kwargs): + return load_sama(*args, **kwargs) + + @core.copy_docs(load_sections) + def load_sections(self, *args, **kwargs): + return load_sections(*args, **kwargs) + + @core.copy_docs(load_phrases) + def load_phrases(self, *args, **kwargs): + return load_phrases(*args, **kwargs) diff --git a/mirdata/datasets/tinysol.py b/mirdata/datasets/tinysol.py index 390d92289..3297ea48a 100644 --- a/mirdata/datasets/tinysol.py +++ b/mirdata/datasets/tinysol.py @@ -49,7 +49,6 @@ from mirdata import download_utils from mirdata import jams_utils from mirdata import core -from mirdata import utils BIBTEX = """@inproceedings{cella2020preprint, author={Cella, Carmine Emanuele and Ghisi, Daniele and Lostanlen, Vincent and @@ -112,7 +111,7 @@ def _load_metadata(data_home): return metadata_index -DATA = utils.LargeData("tinysol_index.json", _load_metadata) +DATA = core.LargeData("tinysol_index.json", _load_metadata) class Track(core.Track): @@ -141,13 +140,13 @@ class Track(core.Track): """ def __init__(self, track_id, data_home): - if track_id not in DATA.index['tracks']: + if track_id not in DATA.index["tracks"]: raise ValueError("{} is not a valid track ID in TinySOL".format(track_id)) self.track_id = track_id self._data_home = data_home - self._track_paths = DATA.index['tracks'][track_id] + self._track_paths = DATA.index["tracks"][track_id] metadata = DATA.metadata(data_home) if metadata is not None and track_id in metadata: @@ -213,3 +212,23 @@ def load_audio(audio_path): raise IOError("audio_path {} does not exist".format(audio_path)) return librosa.load(audio_path, sr=None, mono=True) + + +@core.docstring_inherit(core.Dataset) +class Dataset(core.Dataset): + """The tinysol dataset + """ + + def __init__(self, data_home=None): + super().__init__( + data_home, + index=DATA.index, + name="tinysol", + track_object=Track, + bibtex=BIBTEX, + remotes=REMOTES, + ) + + @core.copy_docs(load_audio) + def load_audio(self, *args, **kwargs): + return load_audio(*args, **kwargs) diff --git a/mirdata/datasets/tonality_classicaldb.py b/mirdata/datasets/tonality_classicaldb.py index b05b96750..1b334e04e 100644 --- a/mirdata/datasets/tonality_classicaldb.py +++ b/mirdata/datasets/tonality_classicaldb.py @@ -29,7 +29,7 @@ import numpy as np import csv -from mirdata import jams_utils, download_utils, core, utils +from mirdata import jams_utils, download_utils, core BIBTEX = """@article{gomez2006tonal, @@ -76,11 +76,11 @@ > musicbrainz_metadata/ and copy the folder to {} directory """ -DATA = utils.LargeData("tonality_classicaldb_index.json") +DATA = core.LargeData("tonality_classicaldb_index.json") class Track(core.Track): - """classicalDB track class + """tonality_classicaldb track class Args: track_id (str): track id of the track @@ -94,7 +94,7 @@ class Track(core.Track): """ def __init__(self, track_id, data_home): - if track_id not in DATA.index['tracks']: + if track_id not in DATA.index["tracks"]: raise ValueError( "{} is not a valid track ID in Tonality classicalDB".format(track_id) ) @@ -102,35 +102,35 @@ def __init__(self, track_id, data_home): self.track_id = track_id self._data_home = data_home - self._track_paths = DATA.index['tracks'][track_id] + self._track_paths = DATA.index["tracks"][track_id] self.audio_path = os.path.join(self._data_home, self._track_paths["audio"][0]) self.key_path = os.path.join(self._data_home, self._track_paths["key"][0]) self.spectrum_path = os.path.join( self._data_home, self._track_paths["spectrum"][0] ) self.mb_path = os.path.join(self._data_home, self._track_paths["mb"][0]) - self.HPCP_path = os.path.join(self._data_home, self._track_paths["HPCP"][0]) + self.hpcp_path = os.path.join(self._data_home, self._track_paths["HPCP"][0]) self.title = self.audio_path.replace(".wav", "").split("/")[-1] - @utils.cached_property + @core.cached_property def key(self): """String: key annotation""" return load_key(self.key_path) - @utils.cached_property + @core.cached_property def spectrum(self): """np.array: spectrum""" return load_spectrum(self.spectrum_path) - @utils.cached_property - def HPCP(self): + @core.cached_property + def hpcp(self): """np.array: HPCP""" - return load_HPCP(self.HPCP_path) + return load_hpcp(self.hpcp_path) - @utils.cached_property + @core.cached_property def mb_metadata(self): """Dict: musicbrainz metadata""" - return load_mb(self.mb_path) + return load_musicbrainz(self.mb_path) @property def audio(self): @@ -145,7 +145,7 @@ def to_jams(self): "title": self.title, "key": self.key, "spectrum": self.spectrum, - "HPCP": self.HPCP, + "hpcp": self.hpcp, "musicbrainz_metatada": self.mb_metadata, }, ) @@ -183,11 +183,11 @@ def load_key(keys_path): if not os.path.exists(keys_path): raise IOError("keys_path {} does not exist".format(keys_path)) - with open(keys_path, 'r') as fhandle: - reader = csv.reader(fhandle, delimiter='\n') + with open(keys_path, "r") as fhandle: + reader = csv.reader(fhandle, delimiter="\n") key = next(reader)[0] - return key.replace('\t', ' ') + return key.replace("\t", " ") def load_spectrum(spectrum_path): @@ -209,33 +209,34 @@ def load_spectrum(spectrum_path): with open(spectrum_path) as f: data = json.load(f) - spectrum = [list(map(complex, x)) for x in data['spectrum']] + spectrum = [list(map(complex, x)) for x in data["spectrum"]] return np.array(spectrum) -def load_HPCP(HPCP_path): +def load_hpcp(hpcp_path): """Load Tonality classicalDB HPCP feature from a file Args: - HPCP_path (str): path to HPCP file + hpcp_path (str): path to HPCP file Returns: (np.array): loaded HPCP data """ - if HPCP_path is None: + if hpcp_path is None: return None - if not os.path.exists(HPCP_path): - raise IOError("HPCP_path {} does not exist".format(HPCP_path)) + if not os.path.exists(hpcp_path): + raise IOError("hpcp_path {} does not exist".format(hpcp_path)) - with open(HPCP_path) as f: + with open(hpcp_path) as f: data = json.load(f) return np.array(data["hpcp"]) -def load_mb(mb_path): +def load_musicbrainz(mb_path): """Load Tonality classicalDB musicbraiz metadata from a file + Args: mb_path (str): path to musicbrainz metadata file @@ -252,3 +253,40 @@ def load_mb(mb_path): with open(mb_path) as f: data = json.load(f) return data + + +@core.docstring_inherit(core.Dataset) +class Dataset(core.Dataset): + """The tonality_classicaldb dataset + """ + + def __init__(self, data_home=None): + super().__init__( + data_home, + index=DATA.index, + name="tonality_classicaldb", + track_object=Track, + bibtex=BIBTEX, + remotes=REMOTES, + download_info=DOWNLOAD_INFO, + ) + + @core.copy_docs(load_audio) + def load_audio(self, *args, **kwargs): + return load_audio(*args, **kwargs) + + @core.copy_docs(load_key) + def load_key(self, *args, **kwargs): + return load_key(*args, **kwargs) + + @core.copy_docs(load_spectrum) + def load_spectrum(self, *args, **kwargs): + return load_spectrum(*args, **kwargs) + + @core.copy_docs(load_hpcp) + def load_hpcp(self, *args, **kwargs): + return load_hpcp(*args, **kwargs) + + @core.copy_docs(load_musicbrainz) + def load_musicbrainz(self, *args, **kwargs): + return load_musicbrainz(*args, **kwargs) diff --git a/mirdata/download_utils.py b/mirdata/download_utils.py index 1877cf89c..482186c1a 100644 --- a/mirdata/download_utils.py +++ b/mirdata/download_utils.py @@ -13,11 +13,11 @@ import tarfile import zipfile -from mirdata.utils import md5 +from mirdata.validate import md5 # destination dir should be a relative path to save the file/s, or None RemoteFileMetadata = namedtuple( - 'RemoteFileMetadata', ['filename', 'url', 'checksum', 'destination_dir'] + "RemoteFileMetadata", ["filename", "url", "checksum", "destination_dir"] ) @@ -59,7 +59,7 @@ def downloader( [k not in remotes for k in partial_download] ): raise ValueError( - 'partial_download must be a list which is a subset of {}'.format( + "partial_download must be a list which is a subset of {}".format( remotes.keys() ) ) @@ -72,9 +72,9 @@ def downloader( for k in objs_to_download: print("> downloading {}".format(k)) extension = os.path.splitext(remotes[k].filename)[-1] - if '.zip' in extension: + if ".zip" in extension: download_zip_file(remotes[k], save_dir, force_overwrite, cleanup) - elif '.gz' in extension or '.tar' in extension or '.bz2' in extension: + elif ".gz" in extension or ".tar" in extension or ".bz2" in extension: download_tar_file(remotes[k], save_dir, force_overwrite, cleanup) else: download_from_remote(remotes[k], save_dir, force_overwrite) @@ -133,7 +133,7 @@ def download_from_remote(remote, save_dir, force_overwrite=False, clean_up=True) ): # If file doesn't exist or we want to overwrite, download it with DownloadProgressBar( - unit='B', unit_scale=True, unit_divisor=1024, miniters=1 + unit="B", unit_scale=True, unit_divisor=1024, miniters=1 ) as t: try: urllib.request.urlretrieve( @@ -158,9 +158,9 @@ def download_from_remote(remote, save_dir, force_overwrite=False, clean_up=True) checksum = md5(download_path) if remote.checksum != checksum: raise IOError( - '{} has an MD5 checksum ({}) ' - 'differing from expected ({}), ' - 'file may be corrupted.'.format(download_path, checksum, remote.checksum) + "{} has an MD5 checksum ({}) " + "differing from expected ({}), " + "file may be corrupted.".format(download_path, checksum, remote.checksum) ) return download_path @@ -196,8 +196,8 @@ def extractall_unicode(zfile, out_dir): for m in zfile.infolist(): data = zfile.read(m) # extract zipped data into memory - if m.filename.encode('cp437').decode() != m.filename.encode('utf8').decode(): - disk_file_name = os.path.join(out_dir, m.filename.encode('cp437').decode()) + if m.filename.encode("cp437").decode() != m.filename.encode("utf8").decode(): + disk_file_name = os.path.join(out_dir, m.filename.encode("cp437").decode()) else: disk_file_name = os.path.join(out_dir, m.filename) @@ -206,7 +206,7 @@ def extractall_unicode(zfile, out_dir): os.makedirs(dir_name) if not os.path.isdir(disk_file_name): - with open(disk_file_name, 'wb') as fd: + with open(disk_file_name, "wb") as fd: fd.write(data) @@ -218,7 +218,7 @@ def unzip(zip_path, cleanup=True): cleanup (bool): If True, remove zipfile after unzipping. Default=False """ - zfile = zipfile.ZipFile(zip_path, 'r') + zfile = zipfile.ZipFile(zip_path, "r") extractall_unicode(zfile, os.path.dirname(zip_path)) zfile.close() if cleanup: @@ -247,7 +247,7 @@ def untar(tar_path, cleanup=True): tar_path (str): Path to tar file cleanup (bool): If True, remove tarfile after untarring. Default=False """ - tfile = tarfile.open(tar_path, 'r') + tfile = tarfile.open(tar_path, "r") tfile.extractall(os.path.dirname(tar_path)) tfile.close() if cleanup: diff --git a/mirdata/initialize.py b/mirdata/initialize.py new file mode 100644 index 000000000..3da0a45a9 --- /dev/null +++ b/mirdata/initialize.py @@ -0,0 +1,34 @@ +"""Top-level load function for any mirdata dataset +""" +import importlib + +from mirdata import DATASETS + + +def initialize(dataset_name, data_home=None): + """Load a mirdata dataset by name + + Usage example: + + orchset = mirdata.dataset('orchset') # get the orchset dataset + orchset.download() # download orchset + orchset.validate() # validate orchset + track = orchset.choice_track() # load a random track + print(track) # see what data a track contains + orchset.track_ids() # load all track ids + + Args: + dataset_name (str): the dataset's name + see mirdata.DATASETS for a complete list of possibilities + data_home (str or None): path where the data lives. If None + uses the default location. + + Returns + (core.Dataset): a Dataset object + + """ + if dataset_name not in DATASETS: + raise ValueError("Invalid dataset {}".format(dataset_name)) + + module = importlib.import_module("mirdata.datasets.{}".format(dataset_name)) + return module.Dataset(data_home=data_home) diff --git a/mirdata/jams_utils.py b/mirdata/jams_utils.py index eb2a96b5e..dbbf6fe2d 100644 --- a/mirdata/jams_utils.py +++ b/mirdata/jams_utils.py @@ -28,52 +28,51 @@ def jams_converter( ): """Convert annotations from a track to JAMS format. - Parameters - ---------- - audio_path (str or None): - A path to the corresponding audio file, or None. If provided, - the audio file will be read to compute the duration. If None, - 'duration' must be a field in the metadata dictionary, or the - resulting jam object will not validate. - spectrum_cante100_path (str or None): - A path to the corresponding spectrum file, or None. - beat_data (list or None): - A list of tuples of (BeatData, str), where str describes the annotation (e.g. 'beats_1'). - chord_data (list or None): - A list of tuples of (ChordData, str), where str describes the annotation. - note_data (list or None): - A list of tuples of (NoteData, str), where str describes the annotation. - f0_data (list or None): - A list of tuples of (F0Data, str), where str describes the annotation. - section_data (list or None): - A list of tuples of (SectionData, str), where str describes the annotation. - multi_section_data (list or None): - A list of tuples. Tuples in multi_section_data should contain another - list of tuples, indicating annotations in the different levels - e.g. ([(segments0, level0), '(segments1, level1)], annotator) and a str - indicating the annotator - tempo_data (list or None): - A list of tuples of (float, str), where float gives the tempo in bpm - and str describes the annotation. - event_data (list or None): - A list of tuples of (EventData, str), where str describes the annotation. - key_data (list or None): - A list of tuples of (KeyData, str), where str describes the annotation. - lyrics_data (list or None): - A list of tuples of (LyricData, str), where str describes the annotation. - tags_gtzan_data (list or None): - A list of tuples of (str, str), where the first srt is the tag and the second - is a descriptor of the annotation. - tags_open_data (list or None): - A list of tuples of (str, str), where the first srt is the tag and the second - is a descriptor of the annotation. - metadata (dict or None): - A dictionary containing the track metadata. - - Returns - ------- - jam: JAM object - A JAM object with all the annotations. + Args: + audio_path (str or None): + A path to the corresponding audio file, or None. If provided, + the audio file will be read to compute the duration. If None, + 'duration' must be a field in the metadata dictionary, or the + resulting jam object will not validate. + spectrum_cante100_path (str or None): + A path to the corresponding spectrum file, or None. + beat_data (list or None): + A list of tuples of (annotations.BeatData, str), where str describes + the annotation (e.g. 'beats_1'). + chord_data (list or None): + A list of tuples of (annotations.ChordData, str), where str describes the annotation. + note_data (list or None): + A list of tuples of (annotations.NoteData, str), where str describes the annotation. + f0_data (list or None): + A list of tuples of (annotations.F0Data, str), where str describes the annotation. + section_data (list or None): + A list of tuples of (annotations.SectionData, str), where str describes the annotation. + multi_section_data (list or None): + A list of tuples. Tuples in multi_section_data should contain another + list of tuples, indicating annotations in the different levels + e.g. ([(segments0, level0), '(segments1, level1)], annotator) and a str + indicating the annotator + tempo_data (list or None): + A list of tuples of (float, str), where float gives the tempo in bpm + and str describes the annotation. + event_data (list or None): + A list of tuples of (annotations.EventData, str), where str describes the annotation. + key_data (list or None): + A list of tuples of (annotations.KeyData, str), where str describes the annotation. + lyrics_data (list or None): + A list of tuples of (annotations.LyricData, str), where str describes the annotation. + tags_gtzan_data (list or None): + A list of tuples of (str, str), where the first srt is the tag and the second + is a descriptor of the annotation. + tags_open_data (list or None): + A list of tuples of (str, str), where the first srt is the tag and the second + is a descriptor of the annotation. + metadata (dict or None): + A dictionary containing the track metadata. + + Returns: + jam (jams.JAM): JAM object + A JAM object with all the annotations. """ jam = jams.JAMS() @@ -279,7 +278,7 @@ def beats_to_jams(beat_data, description=None): """Convert beat annotations into jams format. Args: - beat_data (BeatData): beat data object + beat_data (annotations.BeatData): beat data object description (str): annotation description Returns: @@ -303,7 +302,7 @@ def sections_to_jams(section_data, description=None): """Convert section annotations into jams format. Args: - section_data (SectionData): section data object + section_data (annotations.SectionData): section data object description (str): annotation description Returns: @@ -327,7 +326,7 @@ def chords_to_jams(chord_data, description=None): """Convert chord annotations into jams format. Args: - chord_data (ChordData): chord data object + chord_data (annotations.ChordData): chord data object description (str): annotation description Returns: @@ -353,7 +352,7 @@ def notes_to_jams(note_data, description): """Convert note annotations into jams format. Args: - note_data (NoteData): note data object + note_data (annotations.NoteData): note data object description (str): annotation description Returns: @@ -379,7 +378,7 @@ def keys_to_jams(key_data, description): """Convert key annotations into jams format. Args: - key_data (KeyData): key data object + key_data (annotations.KeyData): key data object description (str): annotation description Returns: @@ -435,7 +434,7 @@ def tempos_to_jams(tempo_data, description=None): """Convert tempo annotations into jams format. Args: - tempo_data (TempoData): tempo data object + tempo_data (annotations.TempoData): tempo data object description (str): annotation description Returns: @@ -457,7 +456,7 @@ def events_to_jams(event_data, description=None): """Convert events annotations into jams format. Args: - event_data (EventData): event data object + event_data (annotations.EventData): event data object description (str): annotation description Returns: @@ -483,7 +482,7 @@ def f0s_to_jams(f0_data, description=None): """Convert f0 annotations into jams format. Args: - f0_data (F0Data): f0 annotation object + f0_data (annotations.F0Data): f0 annotation object description (str): annotation descriptoin Returns: @@ -512,7 +511,7 @@ def lyrics_to_jams(lyric_data, description=None): """Convert lyric annotations into jams format. Args: - lyric_data (LyricData): lyric annotation object + lyric_data (annotations.LyricData): lyric annotation object description (str): annotation descriptoin Returns: @@ -538,7 +537,7 @@ def tag_to_jams(tag_data, namespace="tag_open", description=None): """Convert lyric annotations into jams format. Args: - lyric_data (LyricData): lyric annotation object + lyric_data (annotations.LyricData): lyric annotation object namespace (str): the jams-compatible tag namespace description (str): annotation descriptoin diff --git a/mirdata/utils.py b/mirdata/validate.py similarity index 65% rename from mirdata/utils.py rename to mirdata/validate.py index dd05c8c64..8539ad140 100644 --- a/mirdata/utils.py +++ b/mirdata/validate.py @@ -1,12 +1,9 @@ # -*- coding: utf-8 -*- """Utility functions for mirdata""" -from collections import namedtuple import hashlib import os -import json import tqdm -from mirdata import download_utils def md5(file_path): @@ -26,23 +23,6 @@ def md5(file_path): return hash_md5.hexdigest() -def none_path_join(partial_path_list): - """Join a list of partial paths. If any part of the path is None, - returns None. - - Args: - partial_path_list (list): List of partial paths - - Returns: - path or None (str or None): joined path string or None - - """ - if None in partial_path_list: - return None - else: - return os.path.join(*partial_path_list) - - def log_message(message, verbose=True): """Helper function to log message @@ -119,27 +99,21 @@ def check_index(dataset_index, data_home, verbose=True): # check index if "metadata" in dataset_index and dataset_index["metadata"] is not None: missing_metadata, invalid_metadata = check_metadata( - dataset_index["metadata"], - data_home, - verbose, + dataset_index["metadata"], data_home, verbose, ) missing_files["metadata"] = missing_metadata invalid_checksums["metadata"] = invalid_metadata if "tracks" in dataset_index and dataset_index["tracks"] is not None: missing_tracks, invalid_tracks = check_files( - dataset_index["tracks"], - data_home, - verbose, + dataset_index["tracks"], data_home, verbose, ) missing_files["tracks"] = missing_tracks invalid_checksums["tracks"] = invalid_tracks if "multitracks" in dataset_index and dataset_index["multitracks"] is not None: missing_multitracks, invalid_multitracks = check_files( - dataset_index["multitracks"], - data_home, - verbose, + dataset_index["multitracks"], data_home, verbose, ) missing_files["multitracks"] = missing_multitracks invalid_checksums["multitracks"] = invalid_multitracks @@ -195,68 +169,3 @@ def validator(dataset_index, data_home, verbose=True): return missing_files, invalid_checksums - -def load_json_index(filename): - working_dir = os.path.dirname(os.path.realpath(__file__)) - with open(os.path.join(working_dir, "datasets/indexes", filename)) as f: - return json.load(f) - - -class cached_property(object): - """A property that is only computed once per instance and then replaces - itself with an ordinary attribute. Deleting the attribute resets the - property. - Source: https://github.com/bottlepy/bottle/commit/fa7733e075da0d790d809aa3d2f53071897e6f76 - """ - - def __init__(self, func): - self.__doc__ = getattr(func, "__doc__") - self.func = func - - def __get__(self, obj, cls): - # type: (Any, type) -> Any - if obj is None: - return self - value = obj.__dict__[self.func.__name__] = self.func(obj) - return value - - -class LargeData(object): - def __init__(self, index_file, metadata_load_fn=None, remote_index=None): - """Object which loads and caches large data the first time it's - accessed. - - Parameters - ---------- - index_file: str - File name of checksum index file to be passed to `load_json_index` - metadata_load_fn: function - Function which returns a metadata dictionary. - If None, assume the dataset has no metadata. When the - `metadata` attribute is called, raises a NotImplementedError - - """ - self._metadata = None - self.index_file = index_file - self.metadata_load_fn = metadata_load_fn - self.remote_index = remote_index - - @cached_property - def index(self): - if self.remote_index is not None: - working_dir = os.path.dirname(os.path.realpath(__file__)) - path_index_file = os.path.join( - working_dir, "datasets/indexes", self.index_file - ) - if not os.path.isfile(path_index_file): - path_indexes = os.path.join(working_dir, "datasets/indexes") - download_utils.downloader(path_indexes, remotes=self.remote_index) - return load_json_index(self.index_file) - - def metadata(self, data_home): - if self.metadata_load_fn is None: - raise NotImplementedError - - if self._metadata is None or self._metadata["data_home"] != data_home: - self._metadata = self.metadata_load_fn(data_home) - return self._metadata diff --git a/scripts/print_track_docstring.py b/scripts/print_track_docstring.py index 5d3bdf8b4..84daeea54 100644 --- a/scripts/print_track_docstring.py +++ b/scripts/print_track_docstring.py @@ -37,7 +37,7 @@ def get_attributes_and_properties(class_instance): continue attr = getattr(class_instance.__class__, val) - if isinstance(attr, mirdata.utils.cached_property): + if isinstance(attr, mirdata.core.cached_property): cached_properties.append(val) elif isinstance(attr, property): properties.append(val) diff --git a/scripts/update_index.py b/scripts/update_index.py index bde432059..1ed2e7476 100644 --- a/scripts/update_index.py +++ b/scripts/update_index.py @@ -25,7 +25,7 @@ from tqdm import tqdm from mirdata.utils import md5 -INDEXES_PATH = '../mirdata/datasets/indexes/' +INDEXES_PATH = "../mirdata/datasets/indexes/" ALL_INDEXES = os.listdir(INDEXES_PATH) DATASETS = mirdata.DATASETS @@ -42,30 +42,44 @@ def get_metadata_paths(module): """ customized_paths = { - 'beatles': None, - 'beatport_key': None, - 'cante100': {'cante100Meta':'cante100Meta.xml'}, - 'dali': {'dali_metadata': 'dali_metadata.json'}, - 'giantsteps_key': None, - 'giantsteps_tempo': None, - 'groove_midi': {'info': 'info.csv'}, - 'gtzan_genre': None, - 'guitarset': None, - 'ikala': {'id_mapping': 'id_mapping.txt'}, - 'irmas': None, - 'maestro': {'maestro-v2.0.0': 'maestro-v2.0.0.json'}, - 'medley_solos_db': {'Medley-solos-DB_metadata': os.path.join("annotation", "Medley-solos-DB_metadata.csv")}, - 'medleydb_melody': {'medleydb_melody_metadata': 'medleydb_melody_metadata.json'}, - 'medleydb_pitch': {'medleydb_pitch_metadata': 'medleydb_pitch_metadata.json'}, - 'mridangam_stroke': None, - 'orchset': {'Orchset - Predominant Melodic Instruments': 'Orchset - Predominant Melodic Instruments.csv'}, - 'rwc_classical': {'rwc-c': os.path.join("metadata-master", "rwc-c.csv")}, - 'rwc_jazz': {'rwc-j': os.path.join("metadata-master", "rwc-j.csv")}, - 'rwc_popular': {'rwc-p': os.path.join("metadata-master", "rwc-p.csv")}, - 'salami': {'metadata': os.path.join("salami-data-public-hierarchy-corrections", "metadata", "metadata.csv")}, - 'saraga': None, - 'tinysol': {'TinySOL_metadata': os.path.join('annotation', 'TinySOL_metadata.csv')}, - } + "beatles": None, + "beatport_key": None, + "cante100": {"cante100Meta": "cante100Meta.xml"}, + "dali": {"dali_metadata": "dali_metadata.json"}, + "giantsteps_key": None, + "giantsteps_tempo": None, + "groove_midi": {"info": "info.csv"}, + "gtzan_genre": None, + "guitarset": None, + "ikala": {"id_mapping": "id_mapping.txt"}, + "irmas": None, + "maestro": {"maestro-v2.0.0": "maestro-v2.0.0.json"}, + "medley_solos_db": { + "Medley-solos-DB_metadata": os.path.join( + "annotation", "Medley-solos-DB_metadata.csv" + ) + }, + "medleydb_melody": { + "medleydb_melody_metadata": "medleydb_melody_metadata.json" + }, + "medleydb_pitch": {"medleydb_pitch_metadata": "medleydb_pitch_metadata.json"}, + "mridangam_stroke": None, + "orchset": { + "Orchset - Predominant Melodic Instruments": "Orchset - Predominant Melodic Instruments.csv" + }, + "rwc_classical": {"rwc-c": os.path.join("metadata-master", "rwc-c.csv")}, + "rwc_jazz": {"rwc-j": os.path.join("metadata-master", "rwc-j.csv")}, + "rwc_popular": {"rwc-p": os.path.join("metadata-master", "rwc-p.csv")}, + "salami": { + "metadata": os.path.join( + "salami-data-public-hierarchy-corrections", "metadata", "metadata.csv" + ) + }, + "saraga": None, + "tinysol": { + "TinySOL_metadata": os.path.join("annotation", "TinySOL_metadata.csv") + }, + } return customized_paths[module] @@ -83,29 +97,29 @@ def get_dataset_version(module): # All this websites linked to currently supported versions were accessed on 11/02/20 customized_versions = { - 'beatles': '1.2', # http://isophonics.net/content/reference-annotations-beatles - 'beatport_key': '1.0', # https://zenodo.org/record/1101082/export/xd#.X6BFXpNKi3J - 'cante100': '1.0', # https://zenodo.org/record/1324183 - 'dali': '1.0', # https://zenodo.org/record/2577915#.X6BGZJNKi3I - 'giantsteps_key': '+', # https://zenodo.org/record/1095691#.X6BGrZNKi3J - 'giantsteps_tempo': '2.0', # https://github.com/GiantSteps/giantsteps-tempo-dataset - 'groove_midi': '1.0.0', # https://magenta.tensorflow.org/datasets/groove - 'gtzan_genre': None, # http://marsyas.info/downloads/datasets.html - 'guitarset': '1.1.0', # https://zenodo.org/record/3371780#.X6BIZpNKi3I - 'ikala': None, # http://mac.citi.sinica.edu.tw/ikala/ - 'irmas': '1.0', # https://zenodo.org/record/1290750/ - 'maestro': '2.0.0', # https://magenta.tensorflow.org/datasets/maestro - 'medley_solos_db': None, # https://mirdata.readthedocs.io/en/latest/source/mirdata.html - 'medleydb_melody': '5.0', # https://zenodo.org/record/2628782#.X6BKOJNKi3J - 'medleydb_pitch': '2.0', # https://zenodo.org/record/2620624#.XKZc7hNKh24 - 'mridangam_stroke': '1.5', # https://zenodo.org/record/1265188#.X6BKhpNKi3J - 'orchset': '1.0', # https://zenodo.org/record/1289786#.X6BK3pNKi3L - 'rwc_classical': None, # https://staff.aist.go.jp/m.goto/RWC-MDB/ - 'rwc_jazz': None, # https://staff.aist.go.jp/m.goto/RWC-MDB/ - 'rwc_popular': None, # https://staff.aist.go.jp/m.goto/RWC-MDB/ - 'salami': '2.0-corrected', # https://github.com/DDMAL/salami-data-public/pull/15 - 'saraga': '1.0', # https://zenodo.org/record/1256127/#.X65rnZNKhUI - 'tinysol': '6.0' # https://zenodo.org/record/1101082/export/xd#.X6BFXpNKi3J + "beatles": "1.2", # http://isophonics.net/content/reference-annotations-beatles + "beatport_key": "1.0", # https://zenodo.org/record/1101082/export/xd#.X6BFXpNKi3J + "cante100": "1.0", # https://zenodo.org/record/1324183 + "dali": "1.0", # https://zenodo.org/record/2577915#.X6BGZJNKi3I + "giantsteps_key": "+", # https://zenodo.org/record/1095691#.X6BGrZNKi3J + "giantsteps_tempo": "2.0", # https://github.com/GiantSteps/giantsteps-tempo-dataset + "groove_midi": "1.0.0", # https://magenta.tensorflow.org/datasets/groove + "gtzan_genre": None, # http://marsyas.info/downloads/datasets.html + "guitarset": "1.1.0", # https://zenodo.org/record/3371780#.X6BIZpNKi3I + "ikala": None, # http://mac.citi.sinica.edu.tw/ikala/ + "irmas": "1.0", # https://zenodo.org/record/1290750/ + "maestro": "2.0.0", # https://magenta.tensorflow.org/datasets/maestro + "medley_solos_db": None, # https://mirdata.readthedocs.io/en/latest/source/mirdata.html + "medleydb_melody": "5.0", # https://zenodo.org/record/2628782#.X6BKOJNKi3J + "medleydb_pitch": "2.0", # https://zenodo.org/record/2620624#.XKZc7hNKh24 + "mridangam_stroke": "1.5", # https://zenodo.org/record/1265188#.X6BKhpNKi3J + "orchset": "1.0", # https://zenodo.org/record/1289786#.X6BK3pNKi3L + "rwc_classical": None, # https://staff.aist.go.jp/m.goto/RWC-MDB/ + "rwc_jazz": None, # https://staff.aist.go.jp/m.goto/RWC-MDB/ + "rwc_popular": None, # https://staff.aist.go.jp/m.goto/RWC-MDB/ + "salami": "2.0-corrected", # https://github.com/DDMAL/salami-data-public/pull/15 + "saraga": "1.0", # https://zenodo.org/record/1256127/#.X65rnZNKhUI + "tinysol": "6.0", # https://zenodo.org/record/1101082/export/xd#.X6BFXpNKi3J } return customized_versions[module] @@ -120,25 +134,29 @@ def update_index(all_indexes): """ for index_name in tqdm(all_indexes): - module = index_name.replace('_index.json', '') + module = index_name.replace("_index.json", "") # load old index - old_index = mirdata.Dataset(module)._index + old_index = mirdata.initialize(module)._index # avoid modifying when running multiple times - if 'tracks' in old_index.keys(): - old_index = old_index['tracks'] + if "tracks" in old_index.keys(): + old_index = old_index["tracks"] - data_home = mirdata.Dataset(module).data_home + data_home = mirdata.initialize(module).data_home # get metadata checksum metadata_files = get_metadata_paths(module) metadata_checksums = None if metadata_files is not None: - metadata_checksums = {key: [metadata_files[key], - md5(os.path.join(data_home, metadata_files[key]))] - for key in metadata_files.keys()} + metadata_checksums = { + key: [ + metadata_files[key], + md5(os.path.join(data_home, metadata_files[key])), + ] + for key in metadata_files.keys() + } # get version of dataset version = get_dataset_version(module) @@ -146,13 +164,12 @@ def update_index(all_indexes): # Some datasets have a single metadata file, some have multiple. # The computation of the checksum should be customized in the make_index # of each dataset. This is a patch to convert previous indexes to the new format. - new_index = {'version': version, - 'tracks': old_index} + new_index = {"version": version, "tracks": old_index} if metadata_files is not None: - new_index['metadata'] = metadata_checksums + new_index["metadata"] = metadata_checksums - with open(os.path.join(INDEXES_PATH, index_name), 'w') as fhandle: + with open(os.path.join(INDEXES_PATH, index_name), "w") as fhandle: json.dump(new_index, fhandle, indent=2) @@ -164,10 +181,10 @@ def test_index(dataset_names): """ - mandatory_keys = ['version'] + mandatory_keys = ["version"] for module in dataset_names: - index = mirdata.Dataset(module)._index - assert type(index['tracks']) == dict + index = mirdata.initialize(module)._index + assert type(index["tracks"]) == dict assert set(mandatory_keys) <= set([*index.keys()]) @@ -179,28 +196,36 @@ def test_track_load(dataset_names): """ for module in dataset_names: - dataset = mirdata.Dataset(module) + dataset = mirdata.initialize(module) dataset.load_tracks() + def main(): print(DATASETS) # Download metadata from all datasets for computing metadata checksums for module in DATASETS: - if module not in ['dali', 'beatles', 'groove_midi']: - dataset = mirdata.Dataset(module) + if module not in ["dali", "beatles", "groove_midi"]: + dataset = mirdata.initialize(module) if dataset._remotes is not None: - dataset.download(partial_download=['metadata' if 'metadata' in dataset._remotes - else key for key in dataset._remotes if key is not 'audio' - and 'training' not in key and 'testing' not in key]) + dataset.download( + partial_download=[ + "metadata" if "metadata" in dataset._remotes else key + for key in dataset._remotes + if key is not "audio" + and "training" not in key + and "testing" not in key + ] + ) # Update index to new format - print('Updating indexes...\n') + print("Updating indexes...\n") update_index(ALL_INDEXES) # Check new indexes are shaped as expected - print('Quick check on datasets...\n') + print("Quick check on datasets...\n") test_index(DATASETS) test_track_load(DATASETS) -if __name__ == '__main__': + +if __name__ == "__main__": main() diff --git a/tests/test_acousticbrainz_genre.py b/tests/test_acousticbrainz_genre.py index 7f49aea12..00992ea36 100644 --- a/tests/test_acousticbrainz_genre.py +++ b/tests/test_acousticbrainz_genre.py @@ -1,8 +1,8 @@ import os import shutil +import pytest - -from mirdata import utils, jams_utils, download_utils +from mirdata import jams_utils, download_utils, core from mirdata.datasets import acousticbrainz_genre from tests.test_utils import run_track_tests @@ -12,22 +12,29 @@ def test_track(httpserver): data_home = "tests/resources/mir_datasets/acousticbrainz_genre" httpserver.serve_content( - open("tests/resources/download/acousticbrainz_genre_dataset_little_test.json.zip", "rb").read() + open( + "tests/resources/download/acousticbrainz_genre_dataset_little_test.json.zip", + "rb", + ).read() ) remote_index = { "index": download_utils.RemoteFileMetadata( filename="acousticbrainz_genre_dataset_little_test.json.zip", url=httpserver.url, - checksum='c5fbdd4f8b7de383796a34143cb44c4f', - destination_dir='', + checksum="c5fbdd4f8b7de383796a34143cb44c4f", + destination_dir="", ) } - track = acousticbrainz_genre.Track(default_trackid, data_home=data_home, remote_index=remote_index, - remote_index_name='acousticbrainz_genre_dataset_little_test.json') + track = acousticbrainz_genre.Track( + default_trackid, + data_home=data_home, + remote_index=remote_index, + remote_index_name="acousticbrainz_genre_dataset_little_test.json", + ) expected_attributes = { "path": "tests/resources/mir_datasets/acousticbrainz_genre/acousticbrainz-mediaeval-validation/be/be9e01e5-8f93-494d-bbaa-ddcc5a52f629.json", - "track_id": "tagtraum#validation#be9e01e5-8f93-494d-bbaa-ddcc5a52f629#2b6bfcfd-46a5-3f98-a58f-2c51d7c9e960#trance########" + "track_id": "tagtraum#validation#be9e01e5-8f93-494d-bbaa-ddcc5a52f629#2b6bfcfd-46a5-3f98-a58f-2c51d7c9e960#trance########", } expected_property_types = { @@ -42,878 +49,3875 @@ def test_track(httpserver): "tracknumber": str, "tonal": dict, "low_level": dict, - "rhythm": dict + "rhythm": dict, } run_track_tests(track, expected_attributes, expected_property_types) - os.remove(os.path.join("mirdata", "datasets/indexes", 'acousticbrainz_genre_dataset_little_test.json')) + os.remove( + os.path.join( + "mirdata", + "datasets/indexes", + "acousticbrainz_genre_dataset_little_test.json", + ) + ) -features = {"tonal": { - "thpcp": [1, 0.579320728779, 0.214836657047, 0.410239934921, 0.421927720308, 0.225528225303, 0.183076187968, - 0.202793732285, 0.191496774554, 0.195926904678, 0.19538384676, 0.17725071311, 0.19343534112, - 0.195846363902, 0.193740859628, 0.209312275052, 0.166110798717, 0.12996301055, 0.183770611882, - 0.209641098976, 0.162735670805, 0.137884125113, 0.142696648836, 0.222093731165, 0.687183618546, - 0.865788459778, 0.439368784428, 0.291335314512, 0.285592496395, 0.168208643794, 0.112465105951, - 0.0973277166486, 0.106767326593, 0.139660894871, 0.141137599945, 0.563603103161], "hpcp": { - "dmean2": [0.261957257986, 0.248936057091, 0.227226093411, 0.214822933078, 0.185719549656, 0.166620016098, - 0.19218352437, 0.213925108314, 0.201654553413, 0.195705741644, 0.195796221495, 0.232935741544, - 0.340740889311, 0.380624711514, 0.310503959656, 0.275244802237, 0.25047698617, 0.184646636248, - 0.150202214718, 0.127092003822, 0.123402029276, 0.145707964897, 0.156906038523, 0.343307852745, - 0.575405955315, 0.357600450516, 0.212107673287, 0.278686583042, 0.2768920362, 0.204572796822, - 0.232681691647, 0.274391710758, 0.267259836197, 0.257940381765, 0.254153877497, 0.250754475594], - "median": [0.00702382624149, 0.0104925427586, 0.0265087448061, 0.0359445922077, 0.025654386729, - 0.00958184618503, 0.0113075301051, 0.013004174456, 0.0103413462639, 0.00578989461064, - 0.00591916590929, 0.0359903424978, 0.216057181358, 0.279158771038, 0.127309978008, 0.0242714583874, - 0.0206926688552, 0.01287034899, 0.00521051790565, 0.00470173824579, 0.00891952775419, - 0.0112975630909, 0.00772325787693, 0.171776384115, 0.294544279575, 0.182794481516, 0.0341288149357, - 0.0937796682119, 0.0891414806247, 0.0357652790844, 0.00981951318681, 0.00645823031664, - 0.00640677567571, 0.0101658720523, 0.0109609831125, 0.00720301363617], - "min": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0], - "dvar2": [0.20182004571, 0.181256204844, 0.160531163216, 0.138031870127, 0.116254262626, 0.105536788702, - 0.123104974627, 0.135154604912, 0.136645048857, 0.14191840589, 0.134744182229, 0.113522216678, - 0.123939432204, 0.141078904271, 0.126689687371, 0.146191120148, 0.134346649051, 0.113142922521, - 0.111554063857, 0.0928051173687, 0.0830625072122, 0.0921071469784, 0.102565199137, 0.122344501317, - 0.268501013517, 0.134693875909, 0.115629725158, 0.120229043067, 0.124573647976, 0.0989440754056, - 0.149035617709, 0.198961064219, 0.195493474603, 0.181768119335, 0.186205849051, 0.188829809427], - "dvar": [0.0709016770124, 0.0642212927341, 0.0540215522051, 0.0459277741611, 0.039158269763, 0.0358573682606, - 0.0441283173859, 0.0500697679818, 0.048032399267, 0.049877922982, 0.0475668683648, 0.0409390516579, - 0.0483189336956, 0.059373728931, 0.046393956989, 0.057118140161, 0.0552255362272, 0.040049944073, - 0.0385572277009, 0.0317769236863, 0.02851219289, 0.0318522453308, 0.0354646109045, 0.047548353672, - 0.122033506632, 0.0509799085557, 0.0392313636839, 0.0442327298224, 0.0466478951275, 0.034126713872, - 0.052664835006, 0.0715441480279, 0.0702358782291, 0.0655381903052, 0.0668850839138, 0.0668021589518], - "dmean": [0.137185156345, 0.131976485252, 0.119955100119, 0.114594981074, 0.0980019420385, 0.0876002237201, - 0.105321630836, 0.117977328598, 0.106846518815, 0.101396635175, 0.102731078863, 0.125963360071, - 0.199974015355, 0.221728652716, 0.173448696733, 0.153004571795, 0.140776693821, 0.0996030718088, - 0.0784875378013, 0.0666015073657, 0.066075257957, 0.0793278291821, 0.0844658911228, 0.192652150989, - 0.319886952639, 0.201404705644, 0.116125285625, 0.160826355219, 0.159044191241, 0.11338737607, - 0.123394109309, 0.144251897931, 0.139449134469, 0.135212510824, 0.133663699031, 0.130060389638], - "max": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1], - "var": [0.0449322424829, 0.0427629947662, 0.0326486118138, 0.0284581966698, 0.023814085871, 0.0215451624244, - 0.0332439541817, 0.0404991842806, 0.0301142297685, 0.0290783978999, 0.0284893140197, 0.0286722127348, - 0.0851084291935, 0.124972507358, 0.0465349033475, 0.0546792373061, 0.059368070215, 0.0267473664135, - 0.0226037502289, 0.0189583078027, 0.0179162640125, 0.0223223939538, 0.0250757019967, 0.0585578717291, - 0.175973117352, 0.0614937394857, 0.0289196409285, 0.0518814213574, 0.0589718073606, 0.0273308288306, - 0.0349330119789, 0.0468821898103, 0.043950650841, 0.0417246446013, 0.0426235720515, 0.0404398441315], - "mean": [0.0862462967634, 0.0873212888837, 0.0863825157285, 0.0933252871037, 0.0740632042289, 0.0579461269081, - 0.0819371193647, 0.0934718996286, 0.0725583508611, 0.0614778809249, 0.0636236220598, 0.0990241095424, - 0.306392014027, 0.386025875807, 0.19589972496, 0.129896596074, 0.127336069942, 0.0749985650182, - 0.0501444004476, 0.0433951467276, 0.0476039499044, 0.0622700825334, 0.0629284977913, 0.251291632652, - 0.445866286755, 0.258299589157, 0.0957884192467, 0.182912155986, 0.188123345375, 0.100555434823, - 0.0816275030375, 0.0904188901186, 0.0853819549084, 0.0873572006822, 0.0871150717139, 0.0790301188827]}, - "tuning_equal_tempered_deviation": 0.165096893907, "chords_changes_rate": 0.0786039158702, "key_key": "F#", - "tuning_diatonic_strength": 0.534535348415, "key_scale": "minor", "chords_number_rate": 0.000889855669811, - "tuning_frequency": 434.193115234, "tuning_nontempered_energy_ratio": 0.88192075491, - "chords_histogram": [24.7083244324, 1.89835870266, 2.62013053894, 0.108760133386, 0, 0, 0, 10.2135658264, - 8.15701007843, 36.1281394958, 0, 0, 0, 0, 0, 0.701997220516, 5.45778131485, 0, 0, 0, 0, - 0.425153255463, 7.3067035675, 2.27407550812], "key_strength": 0.546354293823, - "chords_key": "C#", - "chords_strength": {"dmean2": 0.0105424607173, "median": 0.444946020842, "min": -1, "dvar2": 0.000453131913673, - "dvar": 0.000237715838011, "dmean": 0.00846278760582, "max": 0.725530564785, - "var": 0.0112007251009, "mean": 0.450856178999}, "chords_scale": "major", - "hpcp_entropy": {"dmean2": 1.08373880386, "median": 2.00362324715, "min": 0, "dvar2": 0.735475599766, - "dvar": 0.2642352283, "dmean": 0.642614841461, "max": 4.56000328064, "var": 0.522367954254, - "mean": 2.03967022896}}, "metadata": { - "audio_properties": {"equal_loudness": 0, "codec": "mp3", "downmix": "mix", "sample_rate": 44100, - "analysis_sample_rate": 44100, "bit_rate": 320000, - "md5_encoded": "2bf9caa8bea8a46924db3280f8e8dab9", "length": 469.629394531, - "replay_gain": -12.2262840271, "lossless": False}, - "version": {"essentia_build_sha": "cead25079874084f62182a551b7393616cd33d87", "essentia": "2.1-beta2", - "extractor": "music 1.0", "essentia_git_sha": "v2.1_beta2-1-ge3940c0"}, - "tags": {"title": ["Still Dreaming (Anything Can Happen)"], "barcode": ["7296134204121"], "media": ["CD"], - "albumartist": ["Astral Projection"], "musicbrainz_recordingid": ["be9e01e5-8f93-494d-bbaa-ddcc5a52f629"], - "musicbrainz_workid": ["7295f0a8-e75d-36a0-bbeb-1dba0eea9916"], "composer": ["Lior Perlmutter/Avi Nissim"], - "musicbrainz_albumartistid": ["2ba31cc4-df9e-4c21-9dbc-bb8fa9af424f"], "discnumber": ["1/1"], - "album": ["Trust in Trance"], "catalognumber": ["2041-2"], "musicbrainz album release country": ["IL"], - "musicbrainz album type": ["album"], "musicbrainz album status": ["official"], - "work": ["Still Dreaming (Anything Can Happen)"], "date": ["1996"], - "file_name": "09 Still Dreaming (Anything Can Happen).mp3", - "musicbrainz_releasegroupid": ["2b6bfcfd-46a5-3f98-a58f-2c51d7c9e960"], "script": ["Latn"], - "originaldate": ["1996"], "musicbrainz_albumid": ["07118f6d-9643-4315-bd84-b248bd68c610"], - "artist": ["Astral Projection"], "artistsort": ["Astral Projection"], "tracknumber": ["9/9"], - "label": ["Phokol"], "albumartistsort": ["Astral Projection"], - "musicbrainz_artistid": ["2ba31cc4-df9e-4c21-9dbc-bb8fa9af424f"]}}, "rhythm": { - "bpm_histogram_first_peak_bpm": {"dmean2": 0, "median": 99, "min": 99, "dvar2": 0, "dvar": 0, "dmean": 0, "max": 99, - "var": 0, "mean": 99}, "bpm": 99.8474197388, - "bpm_histogram_second_peak_spread": {"dmean2": 0, "median": 0.285714268684, "min": 0.285714268684, "dvar2": 0, - "dvar": 0, "dmean": 0, "max": 0.285714268684, "var": 0, - "mean": 0.285714268684}, - "bpm_histogram_first_peak_weight": {"dmean2": 0, "median": 0.716302931309, "min": 0.716302931309, "dvar2": 0, - "dvar": 0, "dmean": 0, "max": 0.716302931309, "var": 0, "mean": 0.716302931309}, - "onset_rate": 5.58291912079, - "beats_position": [0.557278871536, 1.13777780533, 1.74149656296, 2.34521532059, 2.93732428551, 3.52943301201, - 4.13315200806, 4.73687076569, 5.34058952332, 5.94430828094, 6.54802703857, 7.1517457962, - 7.74385452271, 8.33596324921, 8.93968200684, 9.54340076447, 10.1471195221, 10.7508392334, - 11.3429479599, 11.9466667175, 12.538775444, 13.1424942017, 13.7462129593, 14.3499317169, - 14.9536504745, 15.5573692322, 16.1610889435, 16.7648067474, 17.3569164276, 17.9490242004, - 18.5527439117, 19.1564617157, 19.760181427, 20.363899231, 20.9676189423, 21.5713367462, - 22.1634464264, 22.7555541992, 23.3592739105, 23.9629936218, 24.5667114258, 25.1704311371, - 25.774148941, 26.3778686523, 26.9699764252, 27.5620861053, 28.1658039093, 28.7695236206, - 29.3732414246, 29.9769611359, 30.5690689087, 31.17278862, 31.7648983002, 32.3686180115, - 32.9723358154, 33.5760536194, 34.1797714233, 34.783493042, 35.3755989075, 35.9793205261, - 36.5714263916, 37.1751480103, 37.7788658142, 38.3825836182, 38.9863014221, 39.5900230408, - 40.1937408447, 40.7858505249, 41.3779602051, 41.981678009, 42.585395813, 43.1891136169, - 43.7928352356, 44.3849411011, 44.9770507812, 45.5807685852, 46.1844902039, 46.7882080078, - 47.3919258118, 47.9956436157, 48.5877532959, 49.1798629761, 49.78358078, 50.3873023987, - 50.9910202026, 51.5947380066, 52.1984558105, 52.8021774292, 53.3942832947, 53.9980049133, - 54.5901107788, 55.1938323975, 55.7975502014, 56.4012680054, 57.0049858093, 57.608707428, - 58.2008171082, 58.7929229736, 59.3966445923, 60.0003623962, 60.6040802002, 61.2077980042, - 61.8115196228, 62.4036254883, 62.9957351685, 63.5994529724, 64.2031707764, 64.806892395, - 65.4106140137, 66.0143280029, 66.6180496216, 67.2101593018, 67.8022689819, 68.4059829712, - 69.0097045898, 69.6134262085, 70.2171401978, 70.8208618164, 71.4129714966, 72.0166854858, - 72.608795166, 73.2125167847, 73.8162307739, 74.4199523926, 75.0120620728, 75.6041717529, - 76.2078933716, 76.8116073608, 77.4153289795, 78.0190429688, 78.6227645874, 79.2264862061, - 79.8418121338, 80.433921814, 81.0260314941, 81.6181411743, 82.2218551636, 82.8255767822, - 83.4292984009, 84.0214080811, 84.6135101318, 85.2172317505, 85.8209533691, 86.4246673584, - 87.0283889771, 87.6321105957, 88.235824585, 88.8279342651, 89.4200439453, 90.023765564, - 90.6158676147, 91.2195892334, 91.8233108521, 92.4270248413, 93.0191345215, 93.6228561401, - 94.2265777588, 94.830291748, 95.4340133667, 96.037727356, 96.6414489746, 97.2451705933, - 97.8488845825, 98.4409942627, 99.0331039429, 99.6368255615, 100.240539551, 100.844261169, - 101.447982788, 102.051696777, 102.655418396, 103.247528076, 103.839637756, 104.443351746, - 105.047073364, 105.650794983, 106.254508972, 106.858230591, 107.450340271, 108.05405426, - 108.64616394, 109.249885559, 109.853607178, 110.457321167, 111.061042786, 111.653152466, - 112.245262146, 112.848976135, 113.452697754, 114.056411743, 114.660133362, 115.26385498, - 115.855964661, 116.448066711, 117.05178833, 117.655509949, 118.259223938, 118.862945557, - 119.466667175, 120.070381165, 120.662490845, 121.254600525, 121.858322144, 122.462036133, - 123.065757751, 123.66947937, 124.273193359, 124.876914978, 125.469024658, 126.061134338, - 126.664848328, 127.268569946, 127.872291565, 128.476013184, 129.079727173, 129.671829224, - 130.263946533, 130.867660522, 131.471374512, 132.07510376, 132.678817749, 133.282531738, - 133.886260986, 134.478363037, 135.070480347, 135.674194336, 136.277908325, 136.881637573, - 137.485351562, 138.089065552, 138.681182861, 139.284896851, 139.876998901, 140.480728149, - 141.084442139, 141.688156128, 142.291885376, 142.895599365, 143.487701416, 144.079818726, - 144.683532715, 145.287246704, 145.890975952, 146.494689941, 147.098403931, 147.69052124, - 148.282623291, 148.886352539, 149.490066528, 150.093780518, 150.697509766, 151.301223755, - 151.893325806, 152.497055054, 153.089157104, 153.692871094, 154.296600342, 154.900314331, - 155.50402832, 156.107757568, 156.699859619, 157.291976929, 157.895690918, 158.499404907, - 159.103118896, 159.706848145, 160.310562134, 160.914276123, 161.506393433, 162.098495483, - 162.702224731, 163.305938721, 163.90965271, 164.513381958, 165.117095947, 165.720809937, - 166.312927246, 166.905029297, 167.508743286, 168.112472534, 168.716186523, 169.319900513, - 169.923629761, 170.515731812, 171.107849121, 171.71156311, 172.3152771, 172.919006348, - 173.522720337, 174.126434326, 174.730148315, 175.322265625, 175.914367676, 176.518096924, - 177.121810913, 177.725524902, 178.32925415, 178.93296814, 179.536682129, 180.128799438, - 180.720901489, 181.324615479, 181.928344727, 182.532058716, 183.135772705, 183.739501953, - 184.331604004, 184.923721313, 185.527435303, 186.131149292, 186.73487854, 187.338592529, - 187.942306519, 188.534423828, 189.126525879, 189.730239868, 190.333969116, 190.937683105, - 191.541397095, 192.145126343, 192.737228394, 193.329345703, 193.933059692, 194.536773682, - 195.140487671, 195.744216919, 196.347930908, 196.951644897, 197.543762207, 198.135864258, - 198.739593506, 199.343307495, 199.947021484, 200.550750732, 201.142852783, 201.746566772, - 202.338684082, 202.942398071, 203.546112061, 204.149841309, 204.753555298, 205.357269287, - 205.949386597, 206.541488647, 207.145217896, 207.748931885, 208.352645874, 208.956375122, - 209.560089111, 210.163803101, 210.75592041, 211.348022461, 211.95173645, 212.555465698, - 213.159179688, 213.762893677, 214.366622925, 214.970336914, 215.562438965, 216.154556274, - 216.758270264, 217.361984253, 217.965713501, 218.56942749, 219.173141479, 219.765258789, - 220.35736084, 220.961090088, 221.564804077, 222.168518066, 222.772247314, 223.375961304, - 223.979675293, 224.571792603, 225.163894653, 225.767608643, 226.371337891, 226.97505188, - 227.578765869, 228.182495117, 228.786209106, 229.378311157, 229.970428467, 230.574142456, - 231.177871704, 231.781585693, 232.385299683, 232.989013672, 233.581130981, 234.173233032, - 234.77696228, 235.38067627, 235.984390259, 236.588119507, 237.191833496, 237.795547485, - 238.387664795, 238.979766846, 239.583480835, 240.187210083, 240.790924072, 241.394638062, - 241.99836731, 242.602081299, 243.19418335, 243.786300659, 244.390014648, 244.993743896, - 245.597457886, 246.201171875, 246.804885864, 247.397003174, 247.989105225, 248.592834473, - 249.196548462, 249.800262451, 250.403991699, 251.007705688, 251.599807739, 252.191925049, - 252.795639038, 253.399353027, 254.003082275, 254.606796265, 255.210510254, 255.814239502, - 256.406341553, 256.998443604, 257.602172852, 258.2059021, 258.80960083, 259.413330078, - 260.017059326, 260.609161377, 261.201263428, 261.804992676, 262.408691406, 263.012420654, - 263.616149902, 264.219848633, 264.811981201, 265.404083252, 266.007781982, 266.61151123, - 267.192016602, 267.760894775, 268.329803467, 268.898681641, 269.479187012, 270.082885742, - 270.675018311, 271.278717041, 271.882446289, 272.486175537, 273.078277588, 273.681976318, - 274.274108887, 274.877807617, 275.481536865, 276.096862793, 276.700592041, 277.292694092, - 277.884796143, 278.488525391, 279.080627441, 279.684356689, 280.28805542, 280.891784668, - 281.483886719, 282.07598877, 282.679718018, 283.271820068, 283.875549316, 284.479278564, - 285.082977295, 285.675109863, 286.278808594, 286.882537842, 287.474639893, 288.078369141, - 288.682067871, 289.285797119, 289.889526367, 290.481628418, 291.085357666, 291.689056396, - 292.292785645, 292.896514893, 293.500213623, 294.103942871, 294.696044922, 295.29977417, - 295.891876221, 296.495605469, 297.099304199, 297.703033447, 298.306762695, 298.910461426, - 299.502593994, 300.106292725, 300.698394775, 301.302124023, 301.905853271, 302.509552002, - 303.10168457, 303.705383301, 304.297485352, 304.9012146, 305.504943848, 306.097045898, - 306.700775146, 307.292877197, 307.896606445, 308.500305176, 309.104034424, 309.707763672, - 310.311462402, 310.91519165, 311.507293701, 312.111022949, 312.703125, 313.306854248, - 313.910552979, 314.514282227, 315.118011475, 315.721710205, 316.313812256, 316.905944824, - 317.509643555, 318.113372803, 318.717102051, 319.320800781, 319.924530029, 320.528259277, - 321.120361328, 321.712463379, 322.316192627, 322.919891357, 323.523620605, 324.127349854, - 324.731048584, 325.323181152, 325.915283203, 326.518981934, 327.122711182, 327.72644043, - 328.33013916, 328.933868408, 329.537597656, 330.129699707, 330.721801758, 331.325531006, - 331.929260254, 332.532958984, 333.136688232, 333.728790283, 334.320892334, 334.924621582, - 335.52835083, 336.132049561, 336.735778809, 337.339508057, 337.943206787, 338.535308838, - 339.127441406, 339.731140137, 340.334869385, 340.938598633, 341.542297363, 342.146026611, - 342.749755859, 343.35345459, 343.980407715, 344.607330322, 345.234283447, 345.861206055, - 346.48815918, 347.091888428, 347.695587158, 348.299316406, 348.903045654, 349.506744385, - 350.110473633, 350.714202881, 351.294677734, 351.898406982, 352.50213623, 353.105834961, - 353.709564209, 354.313293457, 354.905395508, 355.497497559, 356.101226807, 356.704925537, - 357.308654785, 357.912384033, 358.516082764, 359.119812012, 359.72354126, 360.315643311, - 360.907745361, 361.511474609, 362.11517334, 362.718902588, 363.322631836, 363.926330566, - 364.518463135, 365.110565186, 365.714263916, 366.317993164, 366.921722412, 367.525421143, - 368.105926514, 368.709655762, 369.31338501, 369.91708374, 370.520812988, 371.124542236, - 371.728240967, 372.320343018, 372.912475586, 373.516174316, 374.119903564, 374.723632812, - 375.327331543, 375.919464111, 376.511566162, 377.115264893, 377.718994141, 378.322723389, - 378.926422119, 379.530151367, 380.122253418, 380.714355469, 381.318084717, 381.921813965, - 382.525512695, 383.129241943, 383.732971191, 384.336669922, 384.92880249, 385.520904541, - 386.124633789, 386.72833252, 387.332061768, 387.935760498, 388.539489746, 389.143218994, - 389.735321045, 390.327423096, 390.931152344, 391.534881592, 392.138580322, 392.74230957, - 393.346038818, 393.949737549, 394.5418396, 395.133972168, 395.737670898, 396.341400146, - 396.945129395, 397.548828125, 398.152557373, 398.744659424, 399.336761475, 399.940490723, - 400.544219971, 401.147918701, 401.751647949, 402.355377197, 402.959075928, 403.562805176, - 404.166534424, 404.770233154, 405.362365723, 405.954467773, 406.558166504, 407.161895752, - 407.765625, 408.36932373, 408.973052979, 409.565155029, 410.15725708, 410.760986328, - 411.364715576, 411.968414307, 412.572143555, 413.175872803, 413.767974854, 414.360076904, - 414.963806152, 415.5675354, 416.171234131, 416.774963379, 417.378662109, 417.982391357, - 418.574493408, 419.166625977, 419.770324707, 420.374053955, 420.977783203, 421.581481934, - 422.185211182, 422.78894043, 423.427490234, 424.066009521, 424.704559326, 425.319915771, - 425.946838379, 426.573791504, 427.200714111, 427.839263916, 428.466217041, 429.081542969, - 429.685241699, 430.288970947, 430.892700195, 431.496398926, 432.100128174, 432.692230225, - 433.284332275, 433.888061523, 434.491790771, 435.095489502, 435.69921875, 436.302947998, - 436.906646729, 437.498779297, 438.090881348, 438.694580078, 439.298309326, 439.902038574, - 440.505737305, 441.109466553, 441.713195801, 442.305297852, 442.897399902, 443.50112915, - 444.104858398, 444.708557129, 445.30065918, 445.892791748, 446.496490479, 447.100219727, - 447.692321777, 448.296051025, 448.899749756, 449.503479004, 450.107208252, 450.699310303, - 451.303039551, 451.906738281, 452.510467529, 453.114196777, 453.717895508, 454.310028076, - 454.902130127, 455.505828857, 456.109558105, 456.713287354, 457.316986084, 457.920715332, - 458.512817383, 459.104949951, 459.708648682, 460.31237793, 460.91607666, 461.519805908, - 462.18157959, 462.831726074, 463.470275879, 464.03918457, 464.619659424, 465.235015869, - 465.850341797, 466.465667725, 467.069366455, 467.673095703, 468.276824951, 468.892150879], - "beats_loudness": {"dmean2": 0.0825308188796, "median": 0.0359352231026, "min": 1.83989157243e-10, - "dvar2": 0.00314171635546, "dvar": 0.000814661907498, "dmean": 0.0418311133981, - "max": 0.121387630701, "var": 0.00122407265007, "mean": 0.049061499536}, - "danceability": 1.34079182148, - "bpm_histogram_second_peak_weight": {"dmean2": 0, "median": 0.00641848519444, "min": 0.00641848519444, "dvar2": 0, - "dvar": 0, "dmean": 0, "max": 0.00641848519444, "var": 0, - "mean": 0.00641848519444}, "beats_count": 780, - "bpm_histogram_second_peak_bpm": {"dmean2": 0, "median": 94, "min": 94, "dvar2": 0, "dvar": 0, "dmean": 0, - "max": 94, "var": 0, "mean": 94}, - "bpm_histogram_first_peak_spread": {"dmean2": 0, "median": 0.2734375, "min": 0.2734375, "dvar2": 0, "dvar": 0, - "dmean": 0, "max": 0.2734375, "var": 0, "mean": 0.2734375}, - "beats_loudness_band_ratio": { - "dmean2": [0.430711448193, 0.188225373626, 0.192341089249, 0.0548661835492, 0.0471438392997, 0.123224511743], - "median": [0.710864305496, 0.115177638829, 0.0495216995478, 0.020622305572, 0.00899726618081, 0.0268207900226], - "min": [0.00397313572466, 0.00232740468346, 0.000627535802778, 0.000159295930644, 3.33271077579e-06, - 2.05074557016e-05], - "dvar2": [0.0628691762686, 0.025976035744, 0.0532752200961, 0.0034635476768, 0.00604925304651, 0.0200368855149], - "dvar": [0.0190303269774, 0.00874643959105, 0.0149922650307, 0.00136204250157, 0.00214308989234, - 0.00627325056121], - "dmean": [0.220870420337, 0.104567043483, 0.099620424211, 0.0303768031299, 0.0256413463503, 0.0636089965701], - "max": [0.976348400116, 0.550616443157, 0.743173718452, 0.422599494457, 0.658635556698, 0.877433359623], - "var": [0.0393318757415, 0.0109097696841, 0.0161587037146, 0.00192682177294, 0.00177863473073, - 0.00867664348334], - "mean": [0.672453582287, 0.14296464622, 0.100197598338, 0.035744804889, 0.0233048740774, 0.0617416091263]}}, - "lowlevel": {"barkbands_spread": {"dmean2": 11.3085775375, "median": 12.6962938309, "min": 0.302790343761, - "dvar2": 220.751251221, "dvar": 103.028068542, "dmean": 7.43946075439, - "max": 113.481361389, "var": 325.057189941, "mean": 19.2823753357}, - "melbands_spread": {"dmean2": 10.1318311691, "median": 10.1432170868, "min": 0.279888927937, - "dvar2": 228.005065918, "dvar": 114.305671692, "dmean": 6.58419561386, - "max": 196.989822388, "var": 340.562133789, "mean": 15.8502044678}, - "hfc": {"dmean2": 9.66177272797, "median": 9.96537971497, "min": 1.07952132284e-16, - "dvar2": 322.719940186, "dvar": 157.343002319, "dmean": 7.03391361237, - "max": 154.550186157, "var": 353.103057861, "mean": 15.7598428726}, - "barkbands_kurtosis": {"dmean2": 15.5694160461, "median": 5.25297260284, "min": -1.94565689564, - "dvar2": 1111.80249023, "dvar": 458.765808105, "dmean": 9.81207084656, - "max": 485.822357178, "var": 826.78503418, "mean": 15.2445526123}, - "gfcc": {"mean": [-52.8757591248, 107.735832214, -81.0579147339, 31.3055839539, -45.5405044556, - 17.9729709625, -21.1462440491, 5.70709228516, -12.8363389969, 1.68357098103, - -9.73576259613, -2.00269675255, -7.53992891312], "icov": [ - [0.00010386921349, -0.000106655752461, 0.000111980138172, -0.000111873210699, - 0.000189964135643, -0.000229979938013, 0.000213177758269, -0.000271449534921, - 0.000279503467027, -6.60322839394e-05, 0.000166915968293, 5.55644219276e-05, - 0.00016976367624], - [-0.000106655752461, 0.00149726681411, -0.00029822596116, 0.000676356139593, - -0.000958638149314, 0.000967702420894, -0.000732818734832, 0.00196211785078, - -0.00184333114885, 0.00178882759064, -0.00155100796837, 0.00153711787425, - -0.00130420573987], - [0.000111980138172, -0.00029822596116, 0.00103786541149, -1.55373709276e-05, - 0.000404983060434, -0.000631500442978, 0.000882507534698, -0.000837513129227, - 0.000998365110718, -0.000635055708699, 0.000573393073864, 0.000478364148876, - -0.000210827318369], - [-0.000111873210699, 0.000676356139593, -1.55373709276e-05, 0.00213184463792, - -0.000775675289333, 0.000699523487128, -0.000228347169468, 0.000810330093373, - 0.000204399126233, -2.07752473216e-05, -0.000575851649046, 0.000312113843393, - 2.17651540879e-05], - [0.000189964135643, -0.000958638149314, 0.000404983060434, -0.000775675289333, - 0.00441662222147, -0.0018977324944, 0.00093678291887, -0.000779778463766, - -0.000238973618252, 0.00124784593936, -0.00172325293534, 0.000882573018316, - -0.000355818134267], - [-0.000229979938013, 0.000967702420894, -0.000631500442978, 0.000699523487128, - -0.0018977324944, 0.00470419740304, -0.00224701920524, 0.000846366921905, - 0.000901055056602, -0.00165795383509, 0.0019007694209, -0.00330009195022, - 0.000795492320322], - [0.000213177758269, -0.000732818734832, 0.000882507534698, -0.000228347169468, - 0.00093678291887, -0.00224701920524, 0.00696297176182, -0.0026064470876, - -8.30165154184e-05, 0.00128976954147, -0.00322702690028, 0.00428045261651, - -0.0017247867072], - [-0.000271449534921, 0.00196211785078, -0.000837513129227, 0.000810330093373, - -0.000779778463766, 0.000846366921905, -0.0026064470876, 0.010320478119, - -0.00472758943215, 0.000610328454059, 0.000745555968024, -0.000348137982655, - 0.00116989726666], - [0.000279503467027, -0.00184333114885, 0.000998365110718, 0.000204399126233, - -0.000238973618252, 0.000901055056602, -8.30165154184e-05, -0.00472758943215, - 0.0120761645958, -0.00565708614886, 0.00197687884793, 0.000191203667782, - 0.000477980007418], - [-6.60322839394e-05, 0.00178882759064, -0.000635055708699, -2.07752473216e-05, - 0.00124784593936, -0.00165795383509, 0.00128976954147, 0.000610328454059, - -0.00565708614886, 0.0153611283749, -0.0074116284959, 0.00313461828046, - -0.000616872508544], - [0.000166915968293, -0.00155100796837, 0.000573393073864, -0.000575851649046, - -0.00172325293534, 0.0019007694209, -0.00322702690028, 0.000745555968024, - 0.00197687884793, -0.0074116284959, 0.0204007960856, -0.00898791570216, 0.00370677234605], - [5.55644219276e-05, 0.00153711787425, 0.000478364148876, 0.000312113843393, - 0.000882573018316, -0.00330009195022, 0.00428045261651, -0.000348137982655, - 0.000191203667782, 0.00313461828046, -0.00898791570216, 0.0203682091087, - -0.00913562625647], - [0.00016976367624, -0.00130420573987, -0.000210827318369, 2.17651540879e-05, - -0.000355818134267, 0.000795492320322, -0.0017247867072, 0.00116989726666, - 0.000477980007418, -0.000616872508544, 0.00370677234605, -0.00913562625647, - 0.0166303087026]], "cov": [ - [17690.7089844, -4189.91357422, 126.300872803, 1082.3527832, -1009.1784668, 1426.14001465, - -691.036804199, 529.490356445, -788.191101074, 285.409301758, -406.658721924, - 264.882141113, -438.328033447], - [-4189.91357422, 5079.68652344, -852.493041992, -792.726806641, 834.966552734, - -1248.83447266, 554.589172363, -540.169067383, 608.643310547, -423.881378174, - 278.276367188, -389.223266602, 295.430206299], - [126.300872803, -852.493041992, 1537.67004395, 13.2496614456, -212.534973145, - 335.952209473, -228.548202515, 111.474601746, -184.409698486, 95.5868225098, - -111.175376892, 65.111869812, -31.4369678497], - [1082.3527832, -792.726806641, 13.2496614456, 688.815307617, -58.7191429138, 135.787139893, - -96.6784744263, 34.5018119812, -126.266029358, 56.3887863159, -19.1238422394, - 50.1215591431, -56.6393089294], - [-1009.1784668, 834.966552734, -212.534973145, -58.7191429138, 443.4609375, -114.242698669, - 106.349227905, -90.794921875, 100.969955444, -79.0163803101, 75.178276062, -45.6535148621, - 57.8662796021], - [1426.14001465, -1248.83447266, 335.952209473, 135.787139893, -114.242698669, - 665.476196289, -93.4698257446, 126.453094482, -192.028656006, 113.603408813, - -70.1643753052, 142.460281372, -57.6503334045], - [-691.036804199, 554.589172363, -228.548202515, -96.6784744263, 106.349227905, - -93.4698257446, 286.254364014, -7.24755954742, 101.515708923, -40.7418060303, - 53.4621047974, -71.0922241211, 29.3220424652], - [529.490356445, -540.169067383, 111.474601746, 34.5018119812, -90.794921875, 126.453094482, - -7.24755954742, 206.569717407, 0.97103369236, 60.0731735229, -37.1339569092, - 17.8584671021, -49.3860282898], - [-788.191101074, 608.643310547, -184.409698486, -126.266029358, 100.969955444, - -192.028656006, 101.515708923, 0.97103369236, 220.32913208, -4.45077848434, 39.7392883301, - -67.9825820923, 22.7107410431], - [285.409301758, -423.881378174, 95.5868225098, 56.3887863159, -79.0163803101, - 113.603408813, -40.7418060303, 60.0731735229, -4.45077848434, 133.429000854, - 5.01334619522, 26.9678840637, -31.8196659088], - [-406.658721924, 278.276367188, -111.175376892, -19.1238422394, 75.178276062, - -70.1643753052, 53.4621047974, -37.1339569092, 39.7392883301, 5.01334619522, - 96.0722427368, 6.16748142242, 18.7299880981], - [264.882141113, -389.223266602, 65.111869812, 50.1215591431, -45.6535148621, 142.460281372, - -71.0922241211, 17.8584671021, -67.9825820923, 26.9678840637, 6.16748142242, - 124.394592285, 21.0249347687], - [-438.328033447, 295.430206299, -31.4369678497, -56.6393089294, 57.8662796021, - -57.6503334045, 29.3220424652, -49.3860282898, 22.7107410431, -31.8196659088, - 18.7299880981, 21.0249347687, 103.502845764]]}, - "spectral_energyband_middle_low": {"dmean2": 0.0102198179811, "median": 0.00536039331928, - "min": 2.65123048843e-22, "dvar2": 0.000328054215061, - "dvar": 0.000197467088583, "dmean": 0.00720286648721, - "max": 0.119120843709, "var": 0.000343762105331, - "mean": 0.0114525295794}, - "melbands_crest": {"dmean2": 6.53237104416, "median": 17.9162158966, "min": 1.67271459103, - "dvar2": 31.6969070435, "dvar": 13.6536588669, "dmean": 4.13504600525, - "max": 36.3514518738, "var": 45.5407485962, "mean": 18.4556522369}, - "spectral_kurtosis": {"dmean2": 11.2094621658, "median": 3.03414392471, "min": -1.27646434307, - "dvar2": 1162.87890625, "dvar": 516.966552734, "dmean": 7.35913610458, - "max": 625.964172363, "var": 1592.42443848, "mean": 13.7717342377}, - "spectral_rms": {"dmean2": 0.00157959479839, "median": 0.00466633308679, - "min": 3.12093211517e-12, "dvar2": 2.90444609163e-06, - "dvar": 1.51608685428e-06, "dmean": 0.00108874298166, "max": 0.0143991792575, - "var": 8.33909598441e-06, "mean": 0.00527398148552}, - "zerocrossingrate": {"dmean2": 0.0154096977785, "median": 0.03369140625, "min": 0.001953125, - "dvar2": 0.000311016134219, "dvar": 0.000255326158367, - "dmean": 0.0135301901028, "max": 0.53173828125, "var": 0.00270974566229, - "mean": 0.0507398732007}, - "silence_rate_60dB": {"dmean2": 0.0973053127527, "median": 0, "min": 0, - "dvar2": 0.115952201188, "dvar": 0.0462943948805, - "dmean": 0.0486502535641, "max": 1, "var": 0.0738631635904, - "mean": 0.0802887231112}, - "erbbands_kurtosis": {"dmean2": 2.95349383354, "median": -0.0600297451019, - "min": -1.9039914608, "dvar2": 32.2196807861, "dvar": 14.8086624146, - "dmean": 1.914244771, "max": 109.734512329, "var": 22.2196083069, - "mean": 1.34698784351}, "erbbands": { - "dmean2": [0.428299844265, 2.28906655312, 5.51969909668, 12.5672893524, 21.8281002045, 29.313495636, - 16.3954944611, 10.3064498901, 8.35011768341, 14.7721195221, 31.08735466, 10.5252399445, - 13.8429956436, 10.2353038788, 12.4269170761, 15.4577627182, 7.70342493057, 9.83148288727, - 9.0091753006, 5.50162410736, 8.03603172302, 5.58365821838, 7.62825536728, 5.08629179001, - 4.8826174736, 6.02267599106, 5.06897115707, 3.89897060394, 4.18314743042, 3.49176216125, - 5.57253408432, 3.77836751938, 2.91096735001, 1.80456626415, 1.10676884651, - 0.416215091944, 0.128760591149, 0.0229548234493, 0.0030636980664, 0.000156342808623], - "median": [0.283721119165, 0.927432239056, 1.47792208195, 3.52597641945, 2.42209553719, - 3.7360265255, 4.3532910347, 3.73197412491, 2.65285634995, 5.40560531616, 8.99517536163, - 4.68354463577, 4.5760307312, 3.41258049011, 5.04569816589, 5.86556816101, 3.6113049984, - 3.37496948242, 2.82456660271, 2.26255869865, 2.13879799843, 1.67384028435, 1.41590988636, - 1.1372115612, 1.05508136749, 1.21863031387, 1.16889476776, 0.912000060081, - 0.915995657444, 0.67924708128, 0.686301469803, 0.477991074324, 0.319812089205, - 0.204466596246, 0.114510826766, 0.0470657609403, 0.0110522108153, 0.00186074071098, - 0.000260208500549, 8.15202583908e-05], - "min": [1.73851526564e-22, 3.92272553265e-21, 4.44086710627e-20, 2.42112437185e-20, - 1.94110467692e-19, 1.17262933093e-19, 1.98267761128e-19, 3.97561329613e-19, - 2.18353477084e-19, 8.14600849797e-19, 9.92887946907e-19, 2.17544613353e-18, - 1.40501031779e-18, 2.23168986569e-18, 3.23321078645e-18, 4.46148548777e-18, - 6.14916017127e-18, 5.52335130217e-18, 3.36392207364e-18, 8.55628346435e-18, - 9.33644961243e-18, 7.00916537849e-18, 8.54520089851e-18, 1.17213478032e-17, - 1.73005751558e-17, 1.7268897447e-17, 1.54648430008e-17, 1.47321280686e-17, - 2.49232910003e-17, 1.74896487915e-17, 1.97446026983e-17, 1.73287886321e-17, - 1.25015776442e-17, 9.77732860712e-18, 9.27149525483e-18, 5.97360887064e-18, - 2.9045715155e-18, 1.33250659293e-18, 3.08723036554e-19, 3.08572360436e-20], - "dvar2": [0.589720308781, 15.8781013489, 115.261634827, 894.74395752, 3623.12988281, 7216.13037109, - 1346.86328125, 395.219970703, 271.484313965, 883.684448242, 3534.11352539, 445.965484619, - 962.390808105, 561.608764648, 816.409118652, 1031.81359863, 194.976074219, 469.042724609, - 484.088256836, 167.000671387, 411.591308594, 267.27520752, 709.139465332, 153.441650391, - 139.300918579, 290.952606201, 140.435256958, 69.9862442017, 73.9900283813, 51.5217933655, - 215.226226807, 78.0563201904, 44.971824646, 18.3356552124, 10.0238132477, 1.39749252796, - 0.152415767312, 0.00447462266311, 8.89804796316e-05, 2.12016431078e-07], - "dvar": [0.215524703264, 7.72521686554, 80.2513198853, 455.896606445, 1555.41345215, 2612.75439453, - 480.685638428, 158.112503052, 99.4391098022, 426.479644775, 1852.37145996, 222.037109375, - 523.996582031, 305.131774902, 385.197235107, 484.387969971, 81.6952133179, 205.287582397, - 213.223922729, 66.5508499146, 173.345169067, 118.786193848, 367.967529297, 77.0198516846, - 67.1517333984, 160.670516968, 65.487197876, 35.6394195557, 35.1753883362, 23.6361217499, - 93.6900482178, 38.116645813, 22.9980621338, 9.08386993408, 4.69902420044, 0.651064157486, - 0.0717034339905, 0.00214108382352, 4.24883910455e-05, 9.9780372409e-08], - "dmean": [0.285809576511, 1.71466720104, 4.78485679626, 9.31142616272, 13.9938602448, 16.6350879669, - 9.57824516296, 6.50806808472, 5.05367469788, 9.50606632233, 20.6629753113, 6.76035642624, - 9.00918102264, 6.65080547333, 8.12446498871, 9.74140357971, 4.73407125473, 6.18055009842, - 5.77913284302, 3.41051983833, 5.03814935684, 3.6214363575, 4.92935085297, 3.33136463165, - 3.14136767387, 3.96647572517, 3.27122926712, 2.54569911957, 2.78428292274, 2.35334944725, - 3.64336013794, 2.66048502922, 2.00047636032, 1.23166310787, 0.78520399332, 0.289730489254, - 0.0912321954966, 0.015846285969, 0.00216961093247, 0.000110848726763], - "max": [9.64658355713, 31.4366493225, 96.8313522339, 196.806808472, 335.627746582, 405.507202148, - 318.389892578, 425.480987549, 155.056884766, 734.217224121, 942.432678223, 450.749542236, - 967.919799805, 676.453918457, 748.619262695, 896.790100098, 260.385131836, 327.264251709, - 355.615600586, 249.552474976, 314.737304688, 559.337402344, 506.524536133, 278.813781738, - 154.522460938, 336.360961914, 208.021591187, 148.887634277, 151.330780029, 101.265739441, - 153.754882812, 95.8621826172, 106.083877563, 54.0735244751, 36.8974952698, 10.6748008728, - 3.31087422371, 0.541660666466, 0.0808046162128, 0.00396120175719], - "var": [0.381921380758, 26.4123821259, 222.696472168, 638.73651123, 1439.33251953, 1684.1505127, - 392.004180908, 183.072143555, 90.0787277222, 885.989501953, 4406.39013672, 503.672363281, - 1249.47509766, 741.50958252, 774.553833008, 842.99206543, 140.2137146, 283.121612549, - 276.191925049, 91.2408294678, 259.221588135, 241.70489502, 608.700134277, 205.818191528, - 143.899810791, 318.06237793, 165.342025757, 84.3325576782, 81.7364196777, 55.5553512573, - 134.187164307, 77.3074874878, 48.5985832214, 18.1627349854, 8.14870166779, 0.956533193588, - 0.0977488458157, 0.00271429261193, 5.59098298254e-05, 1.41564086675e-07], - "mean": [0.477559149265, 3.27270174026, 7.60931921005, 11.1678476334, 12.6747789383, 13.5848760605, - 10.8409786224, 7.9783949852, 5.86515951157, 14.7864227295, 34.0759735107, 11.0554237366, - 14.3407850266, 10.1547403336, 12.8605480194, 14.7355899811, 7.50419521332, 8.41241931915, - 7.65559196472, 5.26523971558, 7.26457834244, 6.14167642593, 7.44393730164, 6.10683917999, - 5.52889490128, 6.9977273941, 6.09786462784, 4.76159763336, 5.06575870514, 4.18718147278, - 5.28951311111, 4.17526912689, 3.10808396339, 1.84764695168, 1.06080031395, 0.381296306849, - 0.113579489291, 0.0184997897595, 0.00259469938464, 0.000180276590982]}, - "spectral_strongpeak": {"dmean2": 0.464798301458, "median": 0.361429721117, "min": 0, - "dvar2": 0.545165300369, "dvar": 0.234720677137, - "dmean": 0.286188274622, "max": 11.5523529053, "var": 0.389024376869, - "mean": 0.591991603374}, - "spectral_energy": {"dmean2": 0.0197877436876, "median": 0.0223190300167, - "min": 9.98372264228e-21, "dvar2": 0.000644606188871, - "dvar": 0.000289402203634, "dmean": 0.0129658170044, "max": 0.2125197649, - "var": 0.00117197574582, "mean": 0.0370581746101}, - "average_loudness": 0.875494062901, - "spectral_rolloff": {"dmean2": 960.533081055, "median": 495.263671875, "min": 43.06640625, - "dvar2": 3546625.75, "dvar": 1597838.5, "dmean": 574.075500488, - "max": 19250.6835938, "var": 3974413.25, "mean": 1086.88134766}, - "spectral_centroid": {"dmean2": 420.67791748, "median": 810.38659668, "min": 108.107566833, - "dvar2": 241400.015625, "dvar": 134993.796875, "dmean": 284.24029541, - "max": 10686.7919922, "var": 578495.375, "mean": 1054.03820801}, - "pitch_salience": {"dmean2": 0.142301797867, "median": 0.513008773327, "min": 0.0365366339684, - "dvar2": 0.0186522137374, "dvar": 0.00812033563852, - "dmean": 0.0912069603801, "max": 0.904991447926, "var": 0.0302368402481, - "mean": 0.486002385616}, - "spectral_energyband_middle_high": {"dmean2": 0.00129647296853, "median": 0.00109805946704, - "min": 1.59428602143e-21, "dvar2": 3.59975365427e-06, - "dvar": 1.95909206013e-06, "dmean": 0.000891717558261, - "max": 0.0392765961587, "var": 5.41546842214e-06, - "mean": 0.00189269217663}, "spectral_contrast_coeffs": { - "dmean2": [0.078412592411, 0.0850035324693, 0.0669980943203, 0.0519671812654, 0.0410364679992, - 0.0324285030365], - "median": [-0.712934792042, -0.743565022945, -0.804856359959, -0.822204768658, -0.819852888584, - -0.799151182175], - "min": [-0.967198193073, -0.974618017673, -0.972245693207, -0.961651921272, -0.964111566544, - -0.961030483246], - "dvar2": [0.00545508880168, 0.00506833242252, 0.00283919996582, 0.00171206286177, 0.00133325520437, - 0.00108349311631], - "dvar": [0.00259663071483, 0.00218783551827, 0.00130078371149, 0.000817677413579, 0.000717440620065, - 0.000583040935453], - "dmean": [0.050219014287, 0.0553187951446, 0.0431638620794, 0.033497761935, 0.0269822217524, - 0.0216719079763], - "max": [-0.362060725689, -0.415127366781, -0.449471920729, -0.544864594936, -0.520337045193, - -0.484779447317], - "var": [0.00896039698273, 0.00595588609576, 0.00468455068767, 0.00240010186099, 0.00273609859869, - 0.00380731164478], - "mean": [-0.691217899323, -0.738405883312, -0.792845070362, -0.815919578075, -0.808208405972, - -0.783209085464]}, - "melbands_skewness": {"dmean2": 2.03852105141, "median": 3.49205732346, "min": -5.09098958969, - "dvar2": 5.59213733673, "dvar": 2.60251045227, "dmean": 1.34666419029, - "max": 27.9477214813, "var": 10.3399658203, "mean": 4.20400619507}, - "spectral_spread": {"dmean2": 1288822, "median": 5559910, "min": 202146.75, - "dvar2": 2488438882300.0, "dvar": 1429272657920.0, "dmean": 912083.75, - "max": 47627192, "var": 9248252624900.0, "mean": 5486277}, - "dissonance": {"dmean2": 0.0456466600299, "median": 0.461005300283, "min": 0.0437632985413, - "dvar2": 0.00274136965163, "dvar": 0.00109660299495, "dmean": 0.0279056765139, - "max": 0.500000059605, "var": 0.00284485798329, "mean": 0.445629894733}, - "spectral_skewness": {"dmean2": 0.794989943504, "median": 1.50365900993, - "min": -0.509248197079, "dvar2": 1.80770647526, "dvar": 0.896960437298, - "dmean": 0.536588907242, "max": 21.0161762238, "var": 4.03656053543, - "mean": 2.08940839767}, - "spectral_flux": {"dmean2": 0.0560869723558, "median": 0.0768227279186, - "min": 1.56993041855e-06, "dvar2": 0.00292630377226, - "dvar": 0.00139451096766, "dmean": 0.0342274866998, "max": 0.346184521914, - "var": 0.00482846889645, "mean": 0.0971085876226}, - "spectral_contrast_valleys": { - "dmean2": [0.721830368042, 0.903648912907, 0.712160050869, 0.610355079174, 0.583003401756, - 0.655298888683], - "median": [-6.59833145142, -6.94885444641, -7.49168157578, -8.04998779297, -8.20836257935, - -10.1902523041], - "min": [-27.0580844879, -26.7953968048, -27.0427837372, -27.444858551, -27.150718689, - -27.1886482239], - "dvar2": [0.450322687626, 0.736437559128, 0.416774332523, 0.365079373121, 0.383671492338, - 0.714411377907], - "dvar": [0.274560123682, 0.357804059982, 0.205317720771, 0.192964762449, 0.214226126671, - 0.383591622114], - "dmean": [0.495899945498, 0.603728413582, 0.457975208759, 0.399977326393, 0.413742393255, - 0.499295979738], - "max": [-5.08935785294, -4.38697957993, -5.28223896027, -5.58056020737, -6.22064733505, - -7.39333581924], - "var": [1.47113585472, 1.41246891022, 1.57198941708, 1.60442912579, 2.06623411179, - 4.46363019943], - "mean": [-6.87335252762, -7.15114831924, -7.72637891769, -8.31610107422, -8.46786499023, - -10.7827568054]}, - "erbbands_flatness_db": {"dmean2": 0.0375987179577, "median": 0.137290820479, - "min": 0.0375320166349, "dvar2": 0.00167702429462, - "dvar": 0.000914512726013, "dmean": 0.027081925422, - "max": 0.576275110245, "var": 0.00752041861415, - "mean": 0.161212623119}, - "spectral_energyband_high": {"dmean2": 0.000732991029508, "median": 0.000172440675669, - "min": 7.32384502664e-21, "dvar2": 2.84155316876e-06, - "dvar": 1.41091561545e-06, "dmean": 0.000526301038917, - "max": 0.017098184675, "var": 3.01054546981e-06, - "mean": 0.000937026168685}, - "spectral_entropy": {"dmean2": 0.404551714659, "median": 7.50951766968, "min": 3.83585262299, - "dvar2": 0.203517630696, "dvar": 0.113898038864, "dmean": 0.29108941555, - "max": 9.81510448456, "var": 0.692627191544, "mean": 7.35735177994}, - "silence_rate_20dB": {"dmean2": 0, "median": 1, "min": 1, "dvar2": 0, "dvar": 0, "dmean": 0, - "max": 1, "var": 0, "mean": 1}, - "melbands_flatness_db": {"dmean2": 0.0618936605752, "median": 0.276825994253, - "min": 0.002832879778, "dvar2": 0.00364537141286, - "dvar": 0.00214522774331, "dmean": 0.045175999403, - "max": 0.766786575317, "var": 0.0141341816634, - "mean": 0.288144052029}, "barkbands": { - "dmean2": [0.000780046277214, 0.0112598799169, 0.00605708220974, 0.00587175553665, 0.00767562072724, - 0.00122650107369, 0.000665556231979, 0.00140987348277, 0.000565772177652, - 0.000346536544384, 0.000235375904595, 0.000462280353531, 0.000173911525053, - 0.00019429254462, 0.000148159728269, 0.000128144325572, 0.000106870829768, - 0.000137910654303, 0.000100147895864, 0.000120911368867, 0.000115335969895, - 0.000109506108856, 0.000169414444827, 0.000173168242327, 0.000152851440362, - 7.42633710615e-05, 1.64063621924e-05], - "median": [0.00051947060274, 0.00655899569392, 0.00139943067916, 0.000909918686375, - 0.00112726807129, 0.000451086089015, 0.000139944080729, 0.000426110171247, - 0.000153119675815, 9.37489749049e-05, 6.31682341918e-05, 0.000157135087647, - 6.7123779445e-05, 5.83748333156e-05, 4.5447894081e-05, 3.86669562431e-05, - 2.67468385573e-05, 2.32060701819e-05, 1.99756977963e-05, 2.44901912083e-05, - 2.81980246655e-05, 2.38180637098e-05, 2.30469813687e-05, 2.0819465135e-05, - 1.68694987224e-05, 7.75625903771e-06, 1.76939909124e-06], - "min": [1.05992921059e-23, 1.01882080107e-23, 3.81650085531e-23, 9.58720013055e-24, - 6.05843723706e-23, 3.97942082707e-23, 1.94826602816e-23, 4.55673290334e-23, - 8.03923036692e-23, 6.13023998774e-23, 3.90747860578e-23, 1.36834159167e-22, - 1.19486830182e-22, 9.59428157712e-23, 7.36139500768e-23, 2.05417839863e-22, - 1.69648021278e-22, 1.62890563033e-22, 3.11427467418e-22, 3.05703189767e-22, - 3.80435328089e-22, 6.14622508647e-22, 6.26719974618e-22, 8.48117814015e-22, - 1.07863463304e-21, 1.69885611036e-21, 2.13010882298e-21], - "dvar2": [1.47044806909e-06, 0.000373879738618, 0.000165687393746, 0.000221965063247, - 0.000413867877796, 6.03771377428e-06, 2.01042939807e-06, 6.88658747094e-06, - 1.74298861566e-06, 5.89952264818e-07, 4.87073350541e-07, 1.03171248611e-06, - 1.07554612327e-07, 1.63596951097e-07, 1.26727968564e-07, 9.0355520399e-08, - 1.02161081372e-07, 1.85926893437e-07, 7.48928954408e-08, 1.11035916461e-07, - 6.02020833185e-08, 4.97267329536e-08, 1.73844824758e-07, 1.58650124149e-07, - 1.6659740254e-07, 4.58809203963e-08, 2.44244335867e-09], - "dvar": [5.69594305944e-07, 0.000150891966769, 0.000102631311165, 9.98085743049e-05, - 0.000165758596268, 2.23823212764e-06, 8.41339669932e-07, 3.64793049812e-06, - 9.1262540991e-07, 3.29465478899e-07, 2.32748931239e-07, 5.15360568443e-07, - 4.57060664871e-08, 7.06937512973e-08, 5.41987397185e-08, 3.7454729096e-08, 4.461882952e-08, - 9.44123073054e-08, 3.58138905199e-08, 6.19630355914e-08, 2.9774760435e-08, - 2.44501130453e-08, 7.74448452034e-08, 8.03016817486e-08, 7.94691246142e-08, - 2.18788205331e-08, 1.17777132491e-09], - "dmean": [0.000512506987434, 0.00804802589118, 0.00487215537578, 0.00382397091016, 0.00462136603892, - 0.000744397111703, 0.000406474980991, 0.000937627162784, 0.000366782565834, - 0.000220809830353, 0.000151705185999, 0.000295725563774, 0.000106656254502, - 0.00012199585035, 9.30279566091e-05, 7.9521589214e-05, 6.80271550664e-05, - 8.83774118847e-05, 6.44517785986e-05, 7.93256476754e-05, 7.51946136006e-05, - 7.46458317735e-05, 0.000111750843644, 0.000121858320199, 0.00010798213043, - 5.2450595831e-05, 1.15770853881e-05], - "max": [0.0238662660122, 0.195193648338, 0.0952763408422, 0.0813259333372, 0.0981372743845, - 0.0360920317471, 0.029116846621, 0.0528674200177, 0.032112069428, 0.0240354128182, - 0.0265638101846, 0.0361663326621, 0.00565500324592, 0.00523700891063, 0.00579286180437, - 0.00454595778137, 0.00979127082974, 0.00769131816924, 0.00685597769916, 0.0066013825126, - 0.00420426204801, 0.003395519685, 0.00438667321578, 0.00533647229895, 0.00484169786796, - 0.00184860487934, 0.000426471000537], - "var": [1.00052716334e-06, 0.000443879165687, 0.000208414290682, 9.92849600152e-05, - 0.000132293673232, 2.05686956178e-06, 1.2623826251e-06, 8.76024478202e-06, - 2.01141006073e-06, 8.06357945748e-07, 4.44669126409e-07, 9.52840196078e-07, - 7.04275890939e-08, 9.74497922357e-08, 6.93088750836e-08, 5.45285452347e-08, - 8.23804526817e-08, 1.70030460822e-07, 7.66214398595e-08, 1.23539535934e-07, - 7.75202835257e-08, 5.95994933406e-08, 1.22098853694e-07, 1.74581757051e-07, - 1.51459090603e-07, 3.05719431992e-08, 1.57505808396e-09], - "mean": [0.000792860577349, 0.0153801292181, 0.00665125902742, 0.00363414245658, 0.00425389688462, - 0.000888265087269, 0.00047852890566, 0.0015550450189, 0.000540278153494, 0.000325157860061, - 0.000214053303353, 0.000429682782851, 0.00015268351126, 0.00016140457592, - 0.000122115612612, 0.000112896683277, 0.000105671220808, 0.000135471418616, - 0.000110447574116, 0.000138279981911, 0.000139797382872, 0.000137177747092, - 0.000168910919456, 0.000193774962099, 0.000155140223796, 6.66902997182e-05, - 1.43114566526e-05]}, - "erbbands_skewness": {"dmean2": 0.806777954102, "median": 0.440305769444, - "min": -4.64436674118, "dvar2": 0.675009250641, "dvar": 0.328243792057, - "dmean": 0.546455204487, "max": 8.12401199341, "var": 1.04869437218, - "mean": 0.503021776676}, - "erbbands_spread": {"dmean2": 20.0970649719, "median": 42.1646537781, "min": 0.278548508883, - "dvar2": 522.817504883, "dvar": 262.181243896, "dmean": 13.6425132751, - "max": 183.475982666, "var": 954.214477539, "mean": 47.5880241394}, - "melbands_kurtosis": {"dmean2": 37.6371421814, "median": 17.5584392548, "min": -1.83117628098, - "dvar2": 5883.89160156, "dvar": 2582.94384766, "dmean": 24.0055179596, - "max": 1107.68518066, "var": 5390.95068359, "mean": 42.5645561218}, - "melbands": {"dmean2": [0.00329641532153, 0.0026374112349, 0.00187228771392, 0.00180036283564, - 0.0007303962484, 0.000222255082917, 0.000132661632961, - 0.00020058186783, 0.000218769302592, 7.24005949451e-05, - 7.06409045961e-05, 4.27709564974e-05, 3.79567354685e-05, - 5.88957736909e-05, 2.37249169004e-05, 1.84442196769e-05, - 1.82501553354e-05, 1.56433070515e-05, 9.16564476938e-06, - 7.00420378053e-06, 1.01661744338e-05, 6.29408714303e-06, - 6.71077714287e-06, 6.99026259099e-06, 4.12339386457e-06, - 4.15688373323e-06, 4.44842953584e-06, 3.88687976738e-06, - 3.67111715605e-06, 2.61515447164e-06, 2.38516872741e-06, - 2.41933616962e-06, 2.26173710871e-06, 2.03485728889e-06, - 3.53071436621e-06, 2.68972803497e-06, 2.38401025854e-06, - 2.23127585741e-06, 1.68457290783e-06, 1.60106765179e-06], - "median": [0.00216405838728, 0.00101412762888, 0.000571827986278, - 0.000202020863071, 0.00016626593424, 7.9059296695e-05, - 4.09869862779e-05, 7.25362333469e-05, 6.23455853201e-05, - 2.26373686019e-05, 2.20830006583e-05, 1.21264438349e-05, - 1.26217200886e-05, 1.92631814571e-05, 8.60928776092e-06, - 7.06569699105e-06, 5.57656539968e-06, 4.13972065871e-06, - 3.38378731612e-06, 2.46519289249e-06, 2.28213752962e-06, - 1.57693932579e-06, 1.32363095418e-06, 1.03902482351e-06, - 8.31881152408e-07, 6.98770861618e-07, 8.20869786367e-07, - 6.86328689881e-07, 7.16525391908e-07, 5.77442165195e-07, - 4.89849981022e-07, 4.82333689433e-07, 4.68203353421e-07, - 3.40057397352e-07, 4.30950535701e-07, 2.96965936286e-07, - 2.67273350119e-07, 2.37223986232e-07, 1.66473483887e-07, - 1.67262996342e-07], - "min": [2.54779412357e-24, 1.59138993003e-23, 9.79070021169e-24, - 1.23866726345e-23, 6.20370194956e-24, 8.31699838907e-24, - 3.46986464504e-24, 9.82299065512e-24, 8.27121290213e-24, 1.3206985424e-23, - 6.71308718543e-24, 9.21575629586e-24, 8.26029664492e-24, - 1.66434662644e-23, 1.14134225925e-23, 1.12782867751e-23, - 1.02581649846e-23, 4.38057261125e-24, 7.50343667118e-24, - 1.66349386781e-23, 1.01460639057e-23, 7.12410659402e-24, 8.232875051e-24, - 8.27436992347e-24, 9.45578063691e-24, 1.17401498467e-23, - 1.32374251998e-23, 1.02838187413e-23, 8.10053416782e-24, - 9.78477586629e-24, 7.83643694738e-24, 1.7413921467e-23, 8.2819603431e-24, - 9.63422728455e-24, 1.12002281997e-23, 1.24978428576e-23, - 9.36531012399e-24, 8.62730944791e-24, 8.31138879917e-24, - 8.07182751947e-24], - "dvar2": [3.41360646416e-05, 1.77424899448e-05, 1.60067065735e-05, - 2.49053100561e-05, 3.13707209898e-06, 1.89071258205e-07, - 6.62138788243e-08, 1.31598056896e-07, 1.75494065502e-07, - 2.65618265161e-08, 2.46251730118e-08, 1.05109352333e-08, - 1.12366285165e-08, 1.85752213611e-08, 2.04274308579e-09, - 1.38876810052e-09, 1.47249523685e-09, 1.39897116114e-09, - 3.35575400801e-10, 2.33118274684e-10, 6.82675915797e-10, - 4.3367004432e-10, 6.24023721585e-10, 3.55194929025e-10, - 1.20648546709e-10, 1.40170333673e-10, 1.71406291938e-10, - 1.14362519454e-10, 8.40982630756e-11, 3.15224409075e-11, - 2.62250204192e-11, 2.74679064216e-11, 2.2249901574e-11, - 1.64916916928e-11, 8.66626423401e-11, 4.29321578288e-11, - 3.092853057e-11, 2.80370379691e-11, 1.48893328222e-11, - 1.55275462627e-11], - "dvar": [1.25958504213e-05, 1.19361502584e-05, 9.92833702185e-06, - 1.01751447801e-05, 1.10249095542e-06, 7.38648679999e-08, - 2.46767069001e-08, 6.59268906134e-08, 9.28329342287e-08, - 1.36733522282e-08, 1.33950210923e-08, 5.78824854713e-09, - 5.27800469996e-09, 9.34593735735e-09, 8.1471057678e-10, - 6.13167738805e-10, 6.4058813809e-10, 6.15332840237e-10, - 1.42515957369e-10, 9.12699776867e-11, 2.86098922331e-10, - 1.81715559266e-10, 3.07557562751e-10, 1.68111913279e-10, - 6.04145206085e-11, 6.53835111053e-11, 9.30251431441e-11, - 6.14560000112e-11, 3.70867225818e-11, 1.61549211508e-11, - 1.28530094554e-11, 1.32515188059e-11, 1.05031313508e-11, - 7.0189813163e-12, 3.6923960417e-11, 2.02655461856e-11, 1.42444450332e-11, - 1.33324263088e-11, 7.44717742335e-12, 7.52735981185e-12], - "dmean": [0.00229502934963, 0.00207201717421, 0.00148841179907, 0.00110294274054, - 0.000417607021518, 0.000138642484671, 8.079289546e-05, - 0.000131005115691, 0.000145740428707, 4.67124446004e-05, - 4.60060946352e-05, 2.76701957773e-05, 2.46403087658e-05, - 3.7861718738e-05, 1.42134094858e-05, 1.14496015158e-05, - 1.1467674085e-05, 9.96491326077e-06, 5.73495390199e-06, - 4.29265037383e-06, 6.35433207208e-06, 3.98508973376e-06, - 4.25367534262e-06, 4.42740110884e-06, 2.68380449597e-06, - 2.6487989544e-06, 2.8972558539e-06, 2.54162932833e-06, 2.325889227e-06, - 1.69365830516e-06, 1.53014161697e-06, 1.59524222454e-06, - 1.51298979745e-06, 1.31523813707e-06, 2.27577038459e-06, - 1.79932794708e-06, 1.64016375948e-06, 1.49033098751e-06, - 1.15183547678e-06, 1.07529763227e-06], - "max": [0.0677252113819, 0.0378952510655, 0.0290289148688, 0.0254700183868, - 0.0128895640373, 0.00856050662696, 0.00286759086885, 0.00716800382361, - 0.00654651876539, 0.00379466195591, 0.00477699656039, 0.00299851293676, - 0.00376314716414, 0.00523377442732, 0.000584416906349, 0.000505314266775, - 0.000558701285627, 0.0005260904436, 0.000225639698328, 0.000301965657854, - 0.000398421369027, 0.000744273711462, 0.000533478625584, - 0.000286504684482, 0.000261136126937, 0.000268742762273, - 0.000268247065833, 0.000205783173442, 0.000170988860191, - 8.68624047143e-05, 7.21269097994e-05, 0.000123736841488, - 7.81475755502e-05, 4.78184156236e-05, 0.000100603712781, - 8.45123504405e-05, 5.73282668483e-05, 9.03406980797e-05, - 5.86272690271e-05, 5.47057570657e-05], - "var": [3.04177119688e-05, 4.68787911814e-05, 1.81959476322e-05, - 8.42998906592e-06, 7.75159548994e-07, 8.02486823659e-08, - 2.52603289397e-08, 1.48078854068e-07, 2.24927916292e-07, - 2.99575368956e-08, 3.19193311782e-08, 1.40635734169e-08, - 1.02791402057e-08, 1.71800866866e-08, 1.16958798202e-09, - 9.48678025026e-10, 8.88495277351e-10, 7.94154908501e-10, - 2.05291103561e-10, 1.29107141644e-10, 4.27535090664e-10, - 2.93017693442e-10, 4.73644123922e-10, 3.10595688058e-10, - 1.52411028242e-10, 1.2613242395e-10, 1.5855858293e-10, 1.29483784805e-10, - 7.99841026744e-11, 4.30840640941e-11, 2.8866565388e-11, 2.75744739542e-11, - 2.49805558183e-11, 1.52014841687e-11, 4.94557797492e-11, - 3.47199664852e-11, 2.74030364372e-11, 2.57780706503e-11, - 1.54394483309e-11, 1.40736120674e-11], - "mean": [0.00421799859032, 0.00423632748425, 0.00198257528245, 0.000957176904194, - 0.000434520887211, 0.000167578022229, 9.5177514595e-05, - 0.000210603539017, 0.00024211226264, 7.01813114574e-05, - 7.22835611668e-05, 4.05879654863e-05, 3.73676557501e-05, - 5.41154404345e-05, 2.00823214982e-05, 1.64985340234e-05, - 1.50245914483e-05, 1.25500946524e-05, 8.03009515948e-06, - 6.3551688072e-06, 8.80254174263e-06, 6.16126408204e-06, 6.2302265178e-06, - 6.67886297379e-06, 4.73709496873e-06, 4.31715216109e-06, - 4.50706738775e-06, 4.40146368419e-06, 4.02836485591e-06, - 2.9554471439e-06, 2.69067754743e-06, 2.76429022961e-06, - 2.71651742878e-06, 2.17673414227e-06, 3.17735816679e-06, - 2.68415283244e-06, 2.49323466051e-06, 2.23538791033e-06, - 1.75996285634e-06, 1.54595397817e-06]}, - "spectral_complexity": {"dmean2": 4.85211372375, "median": 11, "min": 0, - "dvar2": 21.6541137695, "dvar": 12.252790451, "dmean": 3.37941265106, - "max": 43, "var": 52.0905303955, "mean": 11.7429180145}, - "spectral_energyband_low": {"dmean2": 0.0149820484221, "median": 0.0116189969704, - "min": 5.17603856995e-23, "dvar2": 0.00048074303777, - "dvar": 0.000204645111808, "dmean": 0.0103260846809, - "max": 0.209965258837, "var": 0.00083902978804, - "mean": 0.0249669943005}, - "erbbands_crest": {"dmean2": 5.19815206528, "median": 8.93636989594, "min": 2.15950489044, - "dvar2": 22.1311225891, "dvar": 10.3251180649, "dmean": 3.33805418015, - "max": 33.2750091553, "var": 31.5032939911, "mean": 10.3855142593}, - "silence_rate_30dB": {"dmean2": 0.0619035847485, "median": 1, "min": 0, - "dvar2": 0.0776470303535, "dvar": 0.0299905408174, - "dmean": 0.0309502612799, "max": 1, "var": 0.0223165713251, - "mean": 0.977159261703}, - "barkbands_skewness": {"dmean2": 1.44653308392, "median": 2.15599632263, "min": -4.99289512634, - "dvar2": 2.84916734695, "dvar": 1.25199246407, "dmean": 0.951523184776, - "max": 18.4443359375, "var": 5.02271461487, "mean": 2.63306665421}, - "barkbands_flatness_db": {"dmean2": 0.0515989176929, "median": 0.178841590881, - "min": 0.0207624137402, "dvar2": 0.00268978346139, - "dvar": 0.00151978223585, "dmean": 0.0371669046581, - "max": 0.588909327984, "var": 0.00901084393263, - "mean": 0.189883828163}, "dynamic_complexity": 3.91312026978, - "mfcc": {"mean": [-700.66998291, 135.489395142, 28.421787262, 23.1075897217, 8.46113491058, - 14.6377601624, 6.19332933426, 8.12203979492, 3.99862265587, 6.61921405792, - 2.94504475594, 5.26969957352, 1.69772768021], "icov": [ - [0.000107419175038, 8.07790347608e-05, 4.01940233132e-05, 1.41072532642e-05, - 3.17661724694e-05, -7.08577063051e-05, -9.35970456339e-06, -0.000100402481621, - 0.000114859867608, -9.32187540457e-05, 7.22726763343e-05, -7.69687903812e-05, - 0.00014752781135], - [8.07790347608e-05, 0.000406299368478, 0.000213704173802, 3.07764312311e-05, - -0.00013552600285, 0.000182592688361, 0.00012160334154, 0.000219605542952, - -0.000212934159208, -4.89489757456e-05, 1.42763483382e-05, 0.000134202622576, - 0.000169955193996], - [4.01940233132e-05, 0.000213704173802, 0.000946900865529, 0.000225221272558, - -0.000283261353616, 4.93922234455e-05, -0.000170131010236, 0.00063844473334, - -0.000424777012086, 5.35618892172e-06, -3.6012417695e-05, 0.000732303771656, - -0.000106887986476], - [1.41072532642e-05, 3.07764312311e-05, 0.000225221272558, 0.00193217326887, - -0.000282399530988, 0.000215311141801, 2.67071982307e-07, 0.00030652814894, - 0.000730566098355, -0.000450449471828, 0.000128779895022, -0.000382249534596, - 0.00046093785204], - [3.17661724694e-05, -0.00013552600285, -0.000283261353616, -0.000282399530988, - 0.00403568474576, -0.00131330266595, 0.000184118820471, 6.65877596475e-05, - -0.000588293594774, 0.0022953953594, -0.00182200025301, 0.00155140575953, - -0.00139354949351], - [-7.08577063051e-05, 0.000182592688361, 4.93922234455e-05, 0.000215311141801, - -0.00131330266595, 0.00576621666551, -0.00270392908715, -0.000217271212023, - -1.60099043569e-05, -7.43252239772e-05, 0.00248048570938, -0.00210075359792, - -0.000226830641623], - [-9.35970456339e-06, 0.00012160334154, -0.000170131010236, 2.67071982307e-07, - 0.000184118820471, -0.00270392908715, 0.0077719129622, -0.00278255506419, - 0.000178223548573, 0.000260046246694, -0.00136796431616, 0.00183528801426, - -0.00172712933272], - [-0.000100402481621, 0.000219605542952, 0.00063844473334, 0.00030652814894, - 6.65877596475e-05, -0.000217271212023, -0.00278255506419, 0.0108746550977, - -0.00441821618006, 0.00173715199344, -0.000915269250982, 0.000479113426991, - -0.000192808452994], - [0.000114859867608, -0.000212934159208, -0.000424777012086, 0.000730566098355, - -0.000588293594774, -1.60099043569e-05, 0.000178223548573, -0.00441821618006, - 0.0135310757905, -0.00714344065636, 0.00168303831015, -0.0014511711197, 0.00106327817775], - [-9.32187540457e-05, -4.89489757456e-05, 5.35618892172e-06, -0.000450449471828, - 0.0022953953594, -7.43252239772e-05, 0.000260046246694, 0.00173715199344, - -0.00714344065636, 0.0186834186316, -0.00981860049069, 0.00231390399858, - -0.00192968046758], - [7.22726763343e-05, 1.42763483382e-05, -3.6012417695e-05, 0.000128779895022, - -0.00182200025301, 0.00248048570938, -0.00136796431616, -0.000915269250982, - 0.00168303831015, -0.00981860049069, 0.0199193935841, -0.0106352949515, 0.00361294415779], - [-7.69687903812e-05, 0.000134202622576, 0.000732303771656, -0.000382249534596, - 0.00155140575953, -0.00210075359792, 0.00183528801426, 0.000479113426991, - -0.0014511711197, 0.00231390399858, -0.0106352949515, 0.0232046339661, -0.0109363310039], - [0.00014752781135, 0.000169955193996, -0.000106887986476, 0.00046093785204, - -0.00139354949351, -0.000226830641623, -0.00172712933272, -0.000192808452994, - 0.00106327817775, -0.00192968046758, 0.00361294415779, -0.0109363310039, - 0.0196638610214]], "cov": [ - [12126.3984375, -2809.12280273, -96.7183837891, -85.6093063354, -142.921066284, - 369.096466064, 244.115966797, 210.12538147, -83.0255813599, -16.950138092, -48.6743812561, - 47.0859146118, -9.6302986145], - [-2809.12280273, 3659.98071289, -633.989257812, 86.3335189819, 19.0077934265, - -274.307128906, -212.871582031, -111.485351562, 41.133228302, 37.7287139893, - 31.5271949768, -30.5362644196, -58.9328155518], - [-96.7183837891, -633.989257812, 1356.80432129, -153.434661865, 98.7311553955, - 48.7583999634, 48.0191307068, -39.584274292, 21.167137146, -17.4020252228, -33.5541763306, - -60.2577857971, -1.63439774513], - [-85.6093063354, 86.3335189819, -153.434661865, 567.058959961, 11.0189790726, - -40.2089500427, -34.1776237488, -36.5306549072, -42.4389686584, 2.53039526939, - 9.81129646301, 8.50957870483, -11.8001689911], - [-142.921066284, 19.0077934265, 98.7311553955, 11.0189790726, 312.80770874, 82.4246749878, - 31.4400959015, 4.76846504211, -5.12284135818, -42.4019470215, -8.1498708725, - -10.4739961624, 18.9017391205], - [369.096466064, -274.307128906, 48.7583999634, -40.2089500427, 82.4246749878, - 282.404968262, 117.230125427, 44.6262054443, 0.698531210423, -29.1598892212, - -30.9757270813, 13.9199514389, 31.1762313843], - [244.115966797, -212.871582031, 48.0191307068, -34.1776237488, 31.4400959015, - 117.230125427, 200.592071533, 64.6621398926, 13.1711330414, -6.63176584244, - -2.64764499664, 2.61026930809, 23.4787330627], - [210.12538147, -111.485351562, -39.584274292, -36.5306549072, 4.76846504211, 44.6262054443, - 64.6621398926, 133.662643433, 42.5779304504, 5.81215953827, 6.34349679947, 7.00799417496, - 8.87113571167], - [-83.0255813599, 41.133228302, 21.167137146, -42.4389686584, -5.12284135818, - 0.698531210423, 13.1711330414, 42.5779304504, 116.71862793, 51.1233444214, 23.580953598, - 11.0932693481, 3.13923668861], - [-16.950138092, 37.7287139893, -17.4020252228, 2.53039526939, -42.4019470215, - -29.1598892212, -6.63176584244, 5.81215953827, 51.1233444214, 106.574928284, - 59.1461105347, 23.1877384186, 5.50347471237], - [-48.6743812561, 31.5271949768, -33.5541763306, 9.81129646301, -8.1498708725, - -30.9757270813, -2.64764499664, 6.34349679947, 23.580953598, 59.1461105347, 103.604682922, - 46.4150886536, 9.88276195526], - [47.0859146118, -30.5362644196, -60.2577857971, 8.50957870483, -10.4739961624, - 13.9199514389, 2.61026930809, 7.00799417496, 11.0932693481, 23.1877384186, 46.4150886536, - 85.4878540039, 39.7927474976], - [-9.6302986145, -58.9328155518, -1.63439774513, -11.8001689911, 18.9017391205, - 31.1762313843, 23.4787330627, 8.87113571167, 3.13923668861, 5.50347471237, 9.88276195526, - 39.7927474976, 76.2382049561]]}, - "spectral_decrease": {"dmean2": 5.08372233199e-09, "median": -5.58059509714e-09, - "min": -5.60004380645e-08, "dvar2": 4.32927042758e-17, - "dvar": 1.93053019642e-17, "dmean": 3.32266036907e-09, - "max": 2.9793302381e-18, "var": 7.8599522368e-17, - "mean": -9.43999456382e-09}, - "barkbands_crest": {"dmean2": 5.16687965393, "median": 12.3140182495, "min": 2.29649472237, - "dvar2": 21.2763710022, "dvar": 8.37867069244, "dmean": 3.1435611248, - "max": 25.9979152679, "var": 29.487985611, "mean": 13.2201347351}}} +features = { + "tonal": { + "thpcp": [ + 1, + 0.579320728779, + 0.214836657047, + 0.410239934921, + 0.421927720308, + 0.225528225303, + 0.183076187968, + 0.202793732285, + 0.191496774554, + 0.195926904678, + 0.19538384676, + 0.17725071311, + 0.19343534112, + 0.195846363902, + 0.193740859628, + 0.209312275052, + 0.166110798717, + 0.12996301055, + 0.183770611882, + 0.209641098976, + 0.162735670805, + 0.137884125113, + 0.142696648836, + 0.222093731165, + 0.687183618546, + 0.865788459778, + 0.439368784428, + 0.291335314512, + 0.285592496395, + 0.168208643794, + 0.112465105951, + 0.0973277166486, + 0.106767326593, + 0.139660894871, + 0.141137599945, + 0.563603103161, + ], + "hpcp": { + "dmean2": [ + 0.261957257986, + 0.248936057091, + 0.227226093411, + 0.214822933078, + 0.185719549656, + 0.166620016098, + 0.19218352437, + 0.213925108314, + 0.201654553413, + 0.195705741644, + 0.195796221495, + 0.232935741544, + 0.340740889311, + 0.380624711514, + 0.310503959656, + 0.275244802237, + 0.25047698617, + 0.184646636248, + 0.150202214718, + 0.127092003822, + 0.123402029276, + 0.145707964897, + 0.156906038523, + 0.343307852745, + 0.575405955315, + 0.357600450516, + 0.212107673287, + 0.278686583042, + 0.2768920362, + 0.204572796822, + 0.232681691647, + 0.274391710758, + 0.267259836197, + 0.257940381765, + 0.254153877497, + 0.250754475594, + ], + "median": [ + 0.00702382624149, + 0.0104925427586, + 0.0265087448061, + 0.0359445922077, + 0.025654386729, + 0.00958184618503, + 0.0113075301051, + 0.013004174456, + 0.0103413462639, + 0.00578989461064, + 0.00591916590929, + 0.0359903424978, + 0.216057181358, + 0.279158771038, + 0.127309978008, + 0.0242714583874, + 0.0206926688552, + 0.01287034899, + 0.00521051790565, + 0.00470173824579, + 0.00891952775419, + 0.0112975630909, + 0.00772325787693, + 0.171776384115, + 0.294544279575, + 0.182794481516, + 0.0341288149357, + 0.0937796682119, + 0.0891414806247, + 0.0357652790844, + 0.00981951318681, + 0.00645823031664, + 0.00640677567571, + 0.0101658720523, + 0.0109609831125, + 0.00720301363617, + ], + "min": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "dvar2": [ + 0.20182004571, + 0.181256204844, + 0.160531163216, + 0.138031870127, + 0.116254262626, + 0.105536788702, + 0.123104974627, + 0.135154604912, + 0.136645048857, + 0.14191840589, + 0.134744182229, + 0.113522216678, + 0.123939432204, + 0.141078904271, + 0.126689687371, + 0.146191120148, + 0.134346649051, + 0.113142922521, + 0.111554063857, + 0.0928051173687, + 0.0830625072122, + 0.0921071469784, + 0.102565199137, + 0.122344501317, + 0.268501013517, + 0.134693875909, + 0.115629725158, + 0.120229043067, + 0.124573647976, + 0.0989440754056, + 0.149035617709, + 0.198961064219, + 0.195493474603, + 0.181768119335, + 0.186205849051, + 0.188829809427, + ], + "dvar": [ + 0.0709016770124, + 0.0642212927341, + 0.0540215522051, + 0.0459277741611, + 0.039158269763, + 0.0358573682606, + 0.0441283173859, + 0.0500697679818, + 0.048032399267, + 0.049877922982, + 0.0475668683648, + 0.0409390516579, + 0.0483189336956, + 0.059373728931, + 0.046393956989, + 0.057118140161, + 0.0552255362272, + 0.040049944073, + 0.0385572277009, + 0.0317769236863, + 0.02851219289, + 0.0318522453308, + 0.0354646109045, + 0.047548353672, + 0.122033506632, + 0.0509799085557, + 0.0392313636839, + 0.0442327298224, + 0.0466478951275, + 0.034126713872, + 0.052664835006, + 0.0715441480279, + 0.0702358782291, + 0.0655381903052, + 0.0668850839138, + 0.0668021589518, + ], + "dmean": [ + 0.137185156345, + 0.131976485252, + 0.119955100119, + 0.114594981074, + 0.0980019420385, + 0.0876002237201, + 0.105321630836, + 0.117977328598, + 0.106846518815, + 0.101396635175, + 0.102731078863, + 0.125963360071, + 0.199974015355, + 0.221728652716, + 0.173448696733, + 0.153004571795, + 0.140776693821, + 0.0996030718088, + 0.0784875378013, + 0.0666015073657, + 0.066075257957, + 0.0793278291821, + 0.0844658911228, + 0.192652150989, + 0.319886952639, + 0.201404705644, + 0.116125285625, + 0.160826355219, + 0.159044191241, + 0.11338737607, + 0.123394109309, + 0.144251897931, + 0.139449134469, + 0.135212510824, + 0.133663699031, + 0.130060389638, + ], + "max": [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + ], + "var": [ + 0.0449322424829, + 0.0427629947662, + 0.0326486118138, + 0.0284581966698, + 0.023814085871, + 0.0215451624244, + 0.0332439541817, + 0.0404991842806, + 0.0301142297685, + 0.0290783978999, + 0.0284893140197, + 0.0286722127348, + 0.0851084291935, + 0.124972507358, + 0.0465349033475, + 0.0546792373061, + 0.059368070215, + 0.0267473664135, + 0.0226037502289, + 0.0189583078027, + 0.0179162640125, + 0.0223223939538, + 0.0250757019967, + 0.0585578717291, + 0.175973117352, + 0.0614937394857, + 0.0289196409285, + 0.0518814213574, + 0.0589718073606, + 0.0273308288306, + 0.0349330119789, + 0.0468821898103, + 0.043950650841, + 0.0417246446013, + 0.0426235720515, + 0.0404398441315, + ], + "mean": [ + 0.0862462967634, + 0.0873212888837, + 0.0863825157285, + 0.0933252871037, + 0.0740632042289, + 0.0579461269081, + 0.0819371193647, + 0.0934718996286, + 0.0725583508611, + 0.0614778809249, + 0.0636236220598, + 0.0990241095424, + 0.306392014027, + 0.386025875807, + 0.19589972496, + 0.129896596074, + 0.127336069942, + 0.0749985650182, + 0.0501444004476, + 0.0433951467276, + 0.0476039499044, + 0.0622700825334, + 0.0629284977913, + 0.251291632652, + 0.445866286755, + 0.258299589157, + 0.0957884192467, + 0.182912155986, + 0.188123345375, + 0.100555434823, + 0.0816275030375, + 0.0904188901186, + 0.0853819549084, + 0.0873572006822, + 0.0871150717139, + 0.0790301188827, + ], + }, + "tuning_equal_tempered_deviation": 0.165096893907, + "chords_changes_rate": 0.0786039158702, + "key_key": "F#", + "tuning_diatonic_strength": 0.534535348415, + "key_scale": "minor", + "chords_number_rate": 0.000889855669811, + "tuning_frequency": 434.193115234, + "tuning_nontempered_energy_ratio": 0.88192075491, + "chords_histogram": [ + 24.7083244324, + 1.89835870266, + 2.62013053894, + 0.108760133386, + 0, + 0, + 0, + 10.2135658264, + 8.15701007843, + 36.1281394958, + 0, + 0, + 0, + 0, + 0, + 0.701997220516, + 5.45778131485, + 0, + 0, + 0, + 0, + 0.425153255463, + 7.3067035675, + 2.27407550812, + ], + "key_strength": 0.546354293823, + "chords_key": "C#", + "chords_strength": { + "dmean2": 0.0105424607173, + "median": 0.444946020842, + "min": -1, + "dvar2": 0.000453131913673, + "dvar": 0.000237715838011, + "dmean": 0.00846278760582, + "max": 0.725530564785, + "var": 0.0112007251009, + "mean": 0.450856178999, + }, + "chords_scale": "major", + "hpcp_entropy": { + "dmean2": 1.08373880386, + "median": 2.00362324715, + "min": 0, + "dvar2": 0.735475599766, + "dvar": 0.2642352283, + "dmean": 0.642614841461, + "max": 4.56000328064, + "var": 0.522367954254, + "mean": 2.03967022896, + }, + }, + "metadata": { + "audio_properties": { + "equal_loudness": 0, + "codec": "mp3", + "downmix": "mix", + "sample_rate": 44100, + "analysis_sample_rate": 44100, + "bit_rate": 320000, + "md5_encoded": "2bf9caa8bea8a46924db3280f8e8dab9", + "length": 469.629394531, + "replay_gain": -12.2262840271, + "lossless": False, + }, + "version": { + "essentia_build_sha": "cead25079874084f62182a551b7393616cd33d87", + "essentia": "2.1-beta2", + "extractor": "music 1.0", + "essentia_git_sha": "v2.1_beta2-1-ge3940c0", + }, + "tags": { + "title": ["Still Dreaming (Anything Can Happen)"], + "barcode": ["7296134204121"], + "media": ["CD"], + "albumartist": ["Astral Projection"], + "musicbrainz_recordingid": ["be9e01e5-8f93-494d-bbaa-ddcc5a52f629"], + "musicbrainz_workid": ["7295f0a8-e75d-36a0-bbeb-1dba0eea9916"], + "composer": ["Lior Perlmutter/Avi Nissim"], + "musicbrainz_albumartistid": ["2ba31cc4-df9e-4c21-9dbc-bb8fa9af424f"], + "discnumber": ["1/1"], + "album": ["Trust in Trance"], + "catalognumber": ["2041-2"], + "musicbrainz album release country": ["IL"], + "musicbrainz album type": ["album"], + "musicbrainz album status": ["official"], + "work": ["Still Dreaming (Anything Can Happen)"], + "date": ["1996"], + "file_name": "09 Still Dreaming (Anything Can Happen).mp3", + "musicbrainz_releasegroupid": ["2b6bfcfd-46a5-3f98-a58f-2c51d7c9e960"], + "script": ["Latn"], + "originaldate": ["1996"], + "musicbrainz_albumid": ["07118f6d-9643-4315-bd84-b248bd68c610"], + "artist": ["Astral Projection"], + "artistsort": ["Astral Projection"], + "tracknumber": ["9/9"], + "label": ["Phokol"], + "albumartistsort": ["Astral Projection"], + "musicbrainz_artistid": ["2ba31cc4-df9e-4c21-9dbc-bb8fa9af424f"], + }, + }, + "rhythm": { + "bpm_histogram_first_peak_bpm": { + "dmean2": 0, + "median": 99, + "min": 99, + "dvar2": 0, + "dvar": 0, + "dmean": 0, + "max": 99, + "var": 0, + "mean": 99, + }, + "bpm": 99.8474197388, + "bpm_histogram_second_peak_spread": { + "dmean2": 0, + "median": 0.285714268684, + "min": 0.285714268684, + "dvar2": 0, + "dvar": 0, + "dmean": 0, + "max": 0.285714268684, + "var": 0, + "mean": 0.285714268684, + }, + "bpm_histogram_first_peak_weight": { + "dmean2": 0, + "median": 0.716302931309, + "min": 0.716302931309, + "dvar2": 0, + "dvar": 0, + "dmean": 0, + "max": 0.716302931309, + "var": 0, + "mean": 0.716302931309, + }, + "onset_rate": 5.58291912079, + "beats_position": [ + 0.557278871536, + 1.13777780533, + 1.74149656296, + 2.34521532059, + 2.93732428551, + 3.52943301201, + 4.13315200806, + 4.73687076569, + 5.34058952332, + 5.94430828094, + 6.54802703857, + 7.1517457962, + 7.74385452271, + 8.33596324921, + 8.93968200684, + 9.54340076447, + 10.1471195221, + 10.7508392334, + 11.3429479599, + 11.9466667175, + 12.538775444, + 13.1424942017, + 13.7462129593, + 14.3499317169, + 14.9536504745, + 15.5573692322, + 16.1610889435, + 16.7648067474, + 17.3569164276, + 17.9490242004, + 18.5527439117, + 19.1564617157, + 19.760181427, + 20.363899231, + 20.9676189423, + 21.5713367462, + 22.1634464264, + 22.7555541992, + 23.3592739105, + 23.9629936218, + 24.5667114258, + 25.1704311371, + 25.774148941, + 26.3778686523, + 26.9699764252, + 27.5620861053, + 28.1658039093, + 28.7695236206, + 29.3732414246, + 29.9769611359, + 30.5690689087, + 31.17278862, + 31.7648983002, + 32.3686180115, + 32.9723358154, + 33.5760536194, + 34.1797714233, + 34.783493042, + 35.3755989075, + 35.9793205261, + 36.5714263916, + 37.1751480103, + 37.7788658142, + 38.3825836182, + 38.9863014221, + 39.5900230408, + 40.1937408447, + 40.7858505249, + 41.3779602051, + 41.981678009, + 42.585395813, + 43.1891136169, + 43.7928352356, + 44.3849411011, + 44.9770507812, + 45.5807685852, + 46.1844902039, + 46.7882080078, + 47.3919258118, + 47.9956436157, + 48.5877532959, + 49.1798629761, + 49.78358078, + 50.3873023987, + 50.9910202026, + 51.5947380066, + 52.1984558105, + 52.8021774292, + 53.3942832947, + 53.9980049133, + 54.5901107788, + 55.1938323975, + 55.7975502014, + 56.4012680054, + 57.0049858093, + 57.608707428, + 58.2008171082, + 58.7929229736, + 59.3966445923, + 60.0003623962, + 60.6040802002, + 61.2077980042, + 61.8115196228, + 62.4036254883, + 62.9957351685, + 63.5994529724, + 64.2031707764, + 64.806892395, + 65.4106140137, + 66.0143280029, + 66.6180496216, + 67.2101593018, + 67.8022689819, + 68.4059829712, + 69.0097045898, + 69.6134262085, + 70.2171401978, + 70.8208618164, + 71.4129714966, + 72.0166854858, + 72.608795166, + 73.2125167847, + 73.8162307739, + 74.4199523926, + 75.0120620728, + 75.6041717529, + 76.2078933716, + 76.8116073608, + 77.4153289795, + 78.0190429688, + 78.6227645874, + 79.2264862061, + 79.8418121338, + 80.433921814, + 81.0260314941, + 81.6181411743, + 82.2218551636, + 82.8255767822, + 83.4292984009, + 84.0214080811, + 84.6135101318, + 85.2172317505, + 85.8209533691, + 86.4246673584, + 87.0283889771, + 87.6321105957, + 88.235824585, + 88.8279342651, + 89.4200439453, + 90.023765564, + 90.6158676147, + 91.2195892334, + 91.8233108521, + 92.4270248413, + 93.0191345215, + 93.6228561401, + 94.2265777588, + 94.830291748, + 95.4340133667, + 96.037727356, + 96.6414489746, + 97.2451705933, + 97.8488845825, + 98.4409942627, + 99.0331039429, + 99.6368255615, + 100.240539551, + 100.844261169, + 101.447982788, + 102.051696777, + 102.655418396, + 103.247528076, + 103.839637756, + 104.443351746, + 105.047073364, + 105.650794983, + 106.254508972, + 106.858230591, + 107.450340271, + 108.05405426, + 108.64616394, + 109.249885559, + 109.853607178, + 110.457321167, + 111.061042786, + 111.653152466, + 112.245262146, + 112.848976135, + 113.452697754, + 114.056411743, + 114.660133362, + 115.26385498, + 115.855964661, + 116.448066711, + 117.05178833, + 117.655509949, + 118.259223938, + 118.862945557, + 119.466667175, + 120.070381165, + 120.662490845, + 121.254600525, + 121.858322144, + 122.462036133, + 123.065757751, + 123.66947937, + 124.273193359, + 124.876914978, + 125.469024658, + 126.061134338, + 126.664848328, + 127.268569946, + 127.872291565, + 128.476013184, + 129.079727173, + 129.671829224, + 130.263946533, + 130.867660522, + 131.471374512, + 132.07510376, + 132.678817749, + 133.282531738, + 133.886260986, + 134.478363037, + 135.070480347, + 135.674194336, + 136.277908325, + 136.881637573, + 137.485351562, + 138.089065552, + 138.681182861, + 139.284896851, + 139.876998901, + 140.480728149, + 141.084442139, + 141.688156128, + 142.291885376, + 142.895599365, + 143.487701416, + 144.079818726, + 144.683532715, + 145.287246704, + 145.890975952, + 146.494689941, + 147.098403931, + 147.69052124, + 148.282623291, + 148.886352539, + 149.490066528, + 150.093780518, + 150.697509766, + 151.301223755, + 151.893325806, + 152.497055054, + 153.089157104, + 153.692871094, + 154.296600342, + 154.900314331, + 155.50402832, + 156.107757568, + 156.699859619, + 157.291976929, + 157.895690918, + 158.499404907, + 159.103118896, + 159.706848145, + 160.310562134, + 160.914276123, + 161.506393433, + 162.098495483, + 162.702224731, + 163.305938721, + 163.90965271, + 164.513381958, + 165.117095947, + 165.720809937, + 166.312927246, + 166.905029297, + 167.508743286, + 168.112472534, + 168.716186523, + 169.319900513, + 169.923629761, + 170.515731812, + 171.107849121, + 171.71156311, + 172.3152771, + 172.919006348, + 173.522720337, + 174.126434326, + 174.730148315, + 175.322265625, + 175.914367676, + 176.518096924, + 177.121810913, + 177.725524902, + 178.32925415, + 178.93296814, + 179.536682129, + 180.128799438, + 180.720901489, + 181.324615479, + 181.928344727, + 182.532058716, + 183.135772705, + 183.739501953, + 184.331604004, + 184.923721313, + 185.527435303, + 186.131149292, + 186.73487854, + 187.338592529, + 187.942306519, + 188.534423828, + 189.126525879, + 189.730239868, + 190.333969116, + 190.937683105, + 191.541397095, + 192.145126343, + 192.737228394, + 193.329345703, + 193.933059692, + 194.536773682, + 195.140487671, + 195.744216919, + 196.347930908, + 196.951644897, + 197.543762207, + 198.135864258, + 198.739593506, + 199.343307495, + 199.947021484, + 200.550750732, + 201.142852783, + 201.746566772, + 202.338684082, + 202.942398071, + 203.546112061, + 204.149841309, + 204.753555298, + 205.357269287, + 205.949386597, + 206.541488647, + 207.145217896, + 207.748931885, + 208.352645874, + 208.956375122, + 209.560089111, + 210.163803101, + 210.75592041, + 211.348022461, + 211.95173645, + 212.555465698, + 213.159179688, + 213.762893677, + 214.366622925, + 214.970336914, + 215.562438965, + 216.154556274, + 216.758270264, + 217.361984253, + 217.965713501, + 218.56942749, + 219.173141479, + 219.765258789, + 220.35736084, + 220.961090088, + 221.564804077, + 222.168518066, + 222.772247314, + 223.375961304, + 223.979675293, + 224.571792603, + 225.163894653, + 225.767608643, + 226.371337891, + 226.97505188, + 227.578765869, + 228.182495117, + 228.786209106, + 229.378311157, + 229.970428467, + 230.574142456, + 231.177871704, + 231.781585693, + 232.385299683, + 232.989013672, + 233.581130981, + 234.173233032, + 234.77696228, + 235.38067627, + 235.984390259, + 236.588119507, + 237.191833496, + 237.795547485, + 238.387664795, + 238.979766846, + 239.583480835, + 240.187210083, + 240.790924072, + 241.394638062, + 241.99836731, + 242.602081299, + 243.19418335, + 243.786300659, + 244.390014648, + 244.993743896, + 245.597457886, + 246.201171875, + 246.804885864, + 247.397003174, + 247.989105225, + 248.592834473, + 249.196548462, + 249.800262451, + 250.403991699, + 251.007705688, + 251.599807739, + 252.191925049, + 252.795639038, + 253.399353027, + 254.003082275, + 254.606796265, + 255.210510254, + 255.814239502, + 256.406341553, + 256.998443604, + 257.602172852, + 258.2059021, + 258.80960083, + 259.413330078, + 260.017059326, + 260.609161377, + 261.201263428, + 261.804992676, + 262.408691406, + 263.012420654, + 263.616149902, + 264.219848633, + 264.811981201, + 265.404083252, + 266.007781982, + 266.61151123, + 267.192016602, + 267.760894775, + 268.329803467, + 268.898681641, + 269.479187012, + 270.082885742, + 270.675018311, + 271.278717041, + 271.882446289, + 272.486175537, + 273.078277588, + 273.681976318, + 274.274108887, + 274.877807617, + 275.481536865, + 276.096862793, + 276.700592041, + 277.292694092, + 277.884796143, + 278.488525391, + 279.080627441, + 279.684356689, + 280.28805542, + 280.891784668, + 281.483886719, + 282.07598877, + 282.679718018, + 283.271820068, + 283.875549316, + 284.479278564, + 285.082977295, + 285.675109863, + 286.278808594, + 286.882537842, + 287.474639893, + 288.078369141, + 288.682067871, + 289.285797119, + 289.889526367, + 290.481628418, + 291.085357666, + 291.689056396, + 292.292785645, + 292.896514893, + 293.500213623, + 294.103942871, + 294.696044922, + 295.29977417, + 295.891876221, + 296.495605469, + 297.099304199, + 297.703033447, + 298.306762695, + 298.910461426, + 299.502593994, + 300.106292725, + 300.698394775, + 301.302124023, + 301.905853271, + 302.509552002, + 303.10168457, + 303.705383301, + 304.297485352, + 304.9012146, + 305.504943848, + 306.097045898, + 306.700775146, + 307.292877197, + 307.896606445, + 308.500305176, + 309.104034424, + 309.707763672, + 310.311462402, + 310.91519165, + 311.507293701, + 312.111022949, + 312.703125, + 313.306854248, + 313.910552979, + 314.514282227, + 315.118011475, + 315.721710205, + 316.313812256, + 316.905944824, + 317.509643555, + 318.113372803, + 318.717102051, + 319.320800781, + 319.924530029, + 320.528259277, + 321.120361328, + 321.712463379, + 322.316192627, + 322.919891357, + 323.523620605, + 324.127349854, + 324.731048584, + 325.323181152, + 325.915283203, + 326.518981934, + 327.122711182, + 327.72644043, + 328.33013916, + 328.933868408, + 329.537597656, + 330.129699707, + 330.721801758, + 331.325531006, + 331.929260254, + 332.532958984, + 333.136688232, + 333.728790283, + 334.320892334, + 334.924621582, + 335.52835083, + 336.132049561, + 336.735778809, + 337.339508057, + 337.943206787, + 338.535308838, + 339.127441406, + 339.731140137, + 340.334869385, + 340.938598633, + 341.542297363, + 342.146026611, + 342.749755859, + 343.35345459, + 343.980407715, + 344.607330322, + 345.234283447, + 345.861206055, + 346.48815918, + 347.091888428, + 347.695587158, + 348.299316406, + 348.903045654, + 349.506744385, + 350.110473633, + 350.714202881, + 351.294677734, + 351.898406982, + 352.50213623, + 353.105834961, + 353.709564209, + 354.313293457, + 354.905395508, + 355.497497559, + 356.101226807, + 356.704925537, + 357.308654785, + 357.912384033, + 358.516082764, + 359.119812012, + 359.72354126, + 360.315643311, + 360.907745361, + 361.511474609, + 362.11517334, + 362.718902588, + 363.322631836, + 363.926330566, + 364.518463135, + 365.110565186, + 365.714263916, + 366.317993164, + 366.921722412, + 367.525421143, + 368.105926514, + 368.709655762, + 369.31338501, + 369.91708374, + 370.520812988, + 371.124542236, + 371.728240967, + 372.320343018, + 372.912475586, + 373.516174316, + 374.119903564, + 374.723632812, + 375.327331543, + 375.919464111, + 376.511566162, + 377.115264893, + 377.718994141, + 378.322723389, + 378.926422119, + 379.530151367, + 380.122253418, + 380.714355469, + 381.318084717, + 381.921813965, + 382.525512695, + 383.129241943, + 383.732971191, + 384.336669922, + 384.92880249, + 385.520904541, + 386.124633789, + 386.72833252, + 387.332061768, + 387.935760498, + 388.539489746, + 389.143218994, + 389.735321045, + 390.327423096, + 390.931152344, + 391.534881592, + 392.138580322, + 392.74230957, + 393.346038818, + 393.949737549, + 394.5418396, + 395.133972168, + 395.737670898, + 396.341400146, + 396.945129395, + 397.548828125, + 398.152557373, + 398.744659424, + 399.336761475, + 399.940490723, + 400.544219971, + 401.147918701, + 401.751647949, + 402.355377197, + 402.959075928, + 403.562805176, + 404.166534424, + 404.770233154, + 405.362365723, + 405.954467773, + 406.558166504, + 407.161895752, + 407.765625, + 408.36932373, + 408.973052979, + 409.565155029, + 410.15725708, + 410.760986328, + 411.364715576, + 411.968414307, + 412.572143555, + 413.175872803, + 413.767974854, + 414.360076904, + 414.963806152, + 415.5675354, + 416.171234131, + 416.774963379, + 417.378662109, + 417.982391357, + 418.574493408, + 419.166625977, + 419.770324707, + 420.374053955, + 420.977783203, + 421.581481934, + 422.185211182, + 422.78894043, + 423.427490234, + 424.066009521, + 424.704559326, + 425.319915771, + 425.946838379, + 426.573791504, + 427.200714111, + 427.839263916, + 428.466217041, + 429.081542969, + 429.685241699, + 430.288970947, + 430.892700195, + 431.496398926, + 432.100128174, + 432.692230225, + 433.284332275, + 433.888061523, + 434.491790771, + 435.095489502, + 435.69921875, + 436.302947998, + 436.906646729, + 437.498779297, + 438.090881348, + 438.694580078, + 439.298309326, + 439.902038574, + 440.505737305, + 441.109466553, + 441.713195801, + 442.305297852, + 442.897399902, + 443.50112915, + 444.104858398, + 444.708557129, + 445.30065918, + 445.892791748, + 446.496490479, + 447.100219727, + 447.692321777, + 448.296051025, + 448.899749756, + 449.503479004, + 450.107208252, + 450.699310303, + 451.303039551, + 451.906738281, + 452.510467529, + 453.114196777, + 453.717895508, + 454.310028076, + 454.902130127, + 455.505828857, + 456.109558105, + 456.713287354, + 457.316986084, + 457.920715332, + 458.512817383, + 459.104949951, + 459.708648682, + 460.31237793, + 460.91607666, + 461.519805908, + 462.18157959, + 462.831726074, + 463.470275879, + 464.03918457, + 464.619659424, + 465.235015869, + 465.850341797, + 466.465667725, + 467.069366455, + 467.673095703, + 468.276824951, + 468.892150879, + ], + "beats_loudness": { + "dmean2": 0.0825308188796, + "median": 0.0359352231026, + "min": 1.83989157243e-10, + "dvar2": 0.00314171635546, + "dvar": 0.000814661907498, + "dmean": 0.0418311133981, + "max": 0.121387630701, + "var": 0.00122407265007, + "mean": 0.049061499536, + }, + "danceability": 1.34079182148, + "bpm_histogram_second_peak_weight": { + "dmean2": 0, + "median": 0.00641848519444, + "min": 0.00641848519444, + "dvar2": 0, + "dvar": 0, + "dmean": 0, + "max": 0.00641848519444, + "var": 0, + "mean": 0.00641848519444, + }, + "beats_count": 780, + "bpm_histogram_second_peak_bpm": { + "dmean2": 0, + "median": 94, + "min": 94, + "dvar2": 0, + "dvar": 0, + "dmean": 0, + "max": 94, + "var": 0, + "mean": 94, + }, + "bpm_histogram_first_peak_spread": { + "dmean2": 0, + "median": 0.2734375, + "min": 0.2734375, + "dvar2": 0, + "dvar": 0, + "dmean": 0, + "max": 0.2734375, + "var": 0, + "mean": 0.2734375, + }, + "beats_loudness_band_ratio": { + "dmean2": [ + 0.430711448193, + 0.188225373626, + 0.192341089249, + 0.0548661835492, + 0.0471438392997, + 0.123224511743, + ], + "median": [ + 0.710864305496, + 0.115177638829, + 0.0495216995478, + 0.020622305572, + 0.00899726618081, + 0.0268207900226, + ], + "min": [ + 0.00397313572466, + 0.00232740468346, + 0.000627535802778, + 0.000159295930644, + 3.33271077579e-06, + 2.05074557016e-05, + ], + "dvar2": [ + 0.0628691762686, + 0.025976035744, + 0.0532752200961, + 0.0034635476768, + 0.00604925304651, + 0.0200368855149, + ], + "dvar": [ + 0.0190303269774, + 0.00874643959105, + 0.0149922650307, + 0.00136204250157, + 0.00214308989234, + 0.00627325056121, + ], + "dmean": [ + 0.220870420337, + 0.104567043483, + 0.099620424211, + 0.0303768031299, + 0.0256413463503, + 0.0636089965701, + ], + "max": [ + 0.976348400116, + 0.550616443157, + 0.743173718452, + 0.422599494457, + 0.658635556698, + 0.877433359623, + ], + "var": [ + 0.0393318757415, + 0.0109097696841, + 0.0161587037146, + 0.00192682177294, + 0.00177863473073, + 0.00867664348334, + ], + "mean": [ + 0.672453582287, + 0.14296464622, + 0.100197598338, + 0.035744804889, + 0.0233048740774, + 0.0617416091263, + ], + }, + }, + "lowlevel": { + "barkbands_spread": { + "dmean2": 11.3085775375, + "median": 12.6962938309, + "min": 0.302790343761, + "dvar2": 220.751251221, + "dvar": 103.028068542, + "dmean": 7.43946075439, + "max": 113.481361389, + "var": 325.057189941, + "mean": 19.2823753357, + }, + "melbands_spread": { + "dmean2": 10.1318311691, + "median": 10.1432170868, + "min": 0.279888927937, + "dvar2": 228.005065918, + "dvar": 114.305671692, + "dmean": 6.58419561386, + "max": 196.989822388, + "var": 340.562133789, + "mean": 15.8502044678, + }, + "hfc": { + "dmean2": 9.66177272797, + "median": 9.96537971497, + "min": 1.07952132284e-16, + "dvar2": 322.719940186, + "dvar": 157.343002319, + "dmean": 7.03391361237, + "max": 154.550186157, + "var": 353.103057861, + "mean": 15.7598428726, + }, + "barkbands_kurtosis": { + "dmean2": 15.5694160461, + "median": 5.25297260284, + "min": -1.94565689564, + "dvar2": 1111.80249023, + "dvar": 458.765808105, + "dmean": 9.81207084656, + "max": 485.822357178, + "var": 826.78503418, + "mean": 15.2445526123, + }, + "gfcc": { + "mean": [ + -52.8757591248, + 107.735832214, + -81.0579147339, + 31.3055839539, + -45.5405044556, + 17.9729709625, + -21.1462440491, + 5.70709228516, + -12.8363389969, + 1.68357098103, + -9.73576259613, + -2.00269675255, + -7.53992891312, + ], + "icov": [ + [ + 0.00010386921349, + -0.000106655752461, + 0.000111980138172, + -0.000111873210699, + 0.000189964135643, + -0.000229979938013, + 0.000213177758269, + -0.000271449534921, + 0.000279503467027, + -6.60322839394e-05, + 0.000166915968293, + 5.55644219276e-05, + 0.00016976367624, + ], + [ + -0.000106655752461, + 0.00149726681411, + -0.00029822596116, + 0.000676356139593, + -0.000958638149314, + 0.000967702420894, + -0.000732818734832, + 0.00196211785078, + -0.00184333114885, + 0.00178882759064, + -0.00155100796837, + 0.00153711787425, + -0.00130420573987, + ], + [ + 0.000111980138172, + -0.00029822596116, + 0.00103786541149, + -1.55373709276e-05, + 0.000404983060434, + -0.000631500442978, + 0.000882507534698, + -0.000837513129227, + 0.000998365110718, + -0.000635055708699, + 0.000573393073864, + 0.000478364148876, + -0.000210827318369, + ], + [ + -0.000111873210699, + 0.000676356139593, + -1.55373709276e-05, + 0.00213184463792, + -0.000775675289333, + 0.000699523487128, + -0.000228347169468, + 0.000810330093373, + 0.000204399126233, + -2.07752473216e-05, + -0.000575851649046, + 0.000312113843393, + 2.17651540879e-05, + ], + [ + 0.000189964135643, + -0.000958638149314, + 0.000404983060434, + -0.000775675289333, + 0.00441662222147, + -0.0018977324944, + 0.00093678291887, + -0.000779778463766, + -0.000238973618252, + 0.00124784593936, + -0.00172325293534, + 0.000882573018316, + -0.000355818134267, + ], + [ + -0.000229979938013, + 0.000967702420894, + -0.000631500442978, + 0.000699523487128, + -0.0018977324944, + 0.00470419740304, + -0.00224701920524, + 0.000846366921905, + 0.000901055056602, + -0.00165795383509, + 0.0019007694209, + -0.00330009195022, + 0.000795492320322, + ], + [ + 0.000213177758269, + -0.000732818734832, + 0.000882507534698, + -0.000228347169468, + 0.00093678291887, + -0.00224701920524, + 0.00696297176182, + -0.0026064470876, + -8.30165154184e-05, + 0.00128976954147, + -0.00322702690028, + 0.00428045261651, + -0.0017247867072, + ], + [ + -0.000271449534921, + 0.00196211785078, + -0.000837513129227, + 0.000810330093373, + -0.000779778463766, + 0.000846366921905, + -0.0026064470876, + 0.010320478119, + -0.00472758943215, + 0.000610328454059, + 0.000745555968024, + -0.000348137982655, + 0.00116989726666, + ], + [ + 0.000279503467027, + -0.00184333114885, + 0.000998365110718, + 0.000204399126233, + -0.000238973618252, + 0.000901055056602, + -8.30165154184e-05, + -0.00472758943215, + 0.0120761645958, + -0.00565708614886, + 0.00197687884793, + 0.000191203667782, + 0.000477980007418, + ], + [ + -6.60322839394e-05, + 0.00178882759064, + -0.000635055708699, + -2.07752473216e-05, + 0.00124784593936, + -0.00165795383509, + 0.00128976954147, + 0.000610328454059, + -0.00565708614886, + 0.0153611283749, + -0.0074116284959, + 0.00313461828046, + -0.000616872508544, + ], + [ + 0.000166915968293, + -0.00155100796837, + 0.000573393073864, + -0.000575851649046, + -0.00172325293534, + 0.0019007694209, + -0.00322702690028, + 0.000745555968024, + 0.00197687884793, + -0.0074116284959, + 0.0204007960856, + -0.00898791570216, + 0.00370677234605, + ], + [ + 5.55644219276e-05, + 0.00153711787425, + 0.000478364148876, + 0.000312113843393, + 0.000882573018316, + -0.00330009195022, + 0.00428045261651, + -0.000348137982655, + 0.000191203667782, + 0.00313461828046, + -0.00898791570216, + 0.0203682091087, + -0.00913562625647, + ], + [ + 0.00016976367624, + -0.00130420573987, + -0.000210827318369, + 2.17651540879e-05, + -0.000355818134267, + 0.000795492320322, + -0.0017247867072, + 0.00116989726666, + 0.000477980007418, + -0.000616872508544, + 0.00370677234605, + -0.00913562625647, + 0.0166303087026, + ], + ], + "cov": [ + [ + 17690.7089844, + -4189.91357422, + 126.300872803, + 1082.3527832, + -1009.1784668, + 1426.14001465, + -691.036804199, + 529.490356445, + -788.191101074, + 285.409301758, + -406.658721924, + 264.882141113, + -438.328033447, + ], + [ + -4189.91357422, + 5079.68652344, + -852.493041992, + -792.726806641, + 834.966552734, + -1248.83447266, + 554.589172363, + -540.169067383, + 608.643310547, + -423.881378174, + 278.276367188, + -389.223266602, + 295.430206299, + ], + [ + 126.300872803, + -852.493041992, + 1537.67004395, + 13.2496614456, + -212.534973145, + 335.952209473, + -228.548202515, + 111.474601746, + -184.409698486, + 95.5868225098, + -111.175376892, + 65.111869812, + -31.4369678497, + ], + [ + 1082.3527832, + -792.726806641, + 13.2496614456, + 688.815307617, + -58.7191429138, + 135.787139893, + -96.6784744263, + 34.5018119812, + -126.266029358, + 56.3887863159, + -19.1238422394, + 50.1215591431, + -56.6393089294, + ], + [ + -1009.1784668, + 834.966552734, + -212.534973145, + -58.7191429138, + 443.4609375, + -114.242698669, + 106.349227905, + -90.794921875, + 100.969955444, + -79.0163803101, + 75.178276062, + -45.6535148621, + 57.8662796021, + ], + [ + 1426.14001465, + -1248.83447266, + 335.952209473, + 135.787139893, + -114.242698669, + 665.476196289, + -93.4698257446, + 126.453094482, + -192.028656006, + 113.603408813, + -70.1643753052, + 142.460281372, + -57.6503334045, + ], + [ + -691.036804199, + 554.589172363, + -228.548202515, + -96.6784744263, + 106.349227905, + -93.4698257446, + 286.254364014, + -7.24755954742, + 101.515708923, + -40.7418060303, + 53.4621047974, + -71.0922241211, + 29.3220424652, + ], + [ + 529.490356445, + -540.169067383, + 111.474601746, + 34.5018119812, + -90.794921875, + 126.453094482, + -7.24755954742, + 206.569717407, + 0.97103369236, + 60.0731735229, + -37.1339569092, + 17.8584671021, + -49.3860282898, + ], + [ + -788.191101074, + 608.643310547, + -184.409698486, + -126.266029358, + 100.969955444, + -192.028656006, + 101.515708923, + 0.97103369236, + 220.32913208, + -4.45077848434, + 39.7392883301, + -67.9825820923, + 22.7107410431, + ], + [ + 285.409301758, + -423.881378174, + 95.5868225098, + 56.3887863159, + -79.0163803101, + 113.603408813, + -40.7418060303, + 60.0731735229, + -4.45077848434, + 133.429000854, + 5.01334619522, + 26.9678840637, + -31.8196659088, + ], + [ + -406.658721924, + 278.276367188, + -111.175376892, + -19.1238422394, + 75.178276062, + -70.1643753052, + 53.4621047974, + -37.1339569092, + 39.7392883301, + 5.01334619522, + 96.0722427368, + 6.16748142242, + 18.7299880981, + ], + [ + 264.882141113, + -389.223266602, + 65.111869812, + 50.1215591431, + -45.6535148621, + 142.460281372, + -71.0922241211, + 17.8584671021, + -67.9825820923, + 26.9678840637, + 6.16748142242, + 124.394592285, + 21.0249347687, + ], + [ + -438.328033447, + 295.430206299, + -31.4369678497, + -56.6393089294, + 57.8662796021, + -57.6503334045, + 29.3220424652, + -49.3860282898, + 22.7107410431, + -31.8196659088, + 18.7299880981, + 21.0249347687, + 103.502845764, + ], + ], + }, + "spectral_energyband_middle_low": { + "dmean2": 0.0102198179811, + "median": 0.00536039331928, + "min": 2.65123048843e-22, + "dvar2": 0.000328054215061, + "dvar": 0.000197467088583, + "dmean": 0.00720286648721, + "max": 0.119120843709, + "var": 0.000343762105331, + "mean": 0.0114525295794, + }, + "melbands_crest": { + "dmean2": 6.53237104416, + "median": 17.9162158966, + "min": 1.67271459103, + "dvar2": 31.6969070435, + "dvar": 13.6536588669, + "dmean": 4.13504600525, + "max": 36.3514518738, + "var": 45.5407485962, + "mean": 18.4556522369, + }, + "spectral_kurtosis": { + "dmean2": 11.2094621658, + "median": 3.03414392471, + "min": -1.27646434307, + "dvar2": 1162.87890625, + "dvar": 516.966552734, + "dmean": 7.35913610458, + "max": 625.964172363, + "var": 1592.42443848, + "mean": 13.7717342377, + }, + "spectral_rms": { + "dmean2": 0.00157959479839, + "median": 0.00466633308679, + "min": 3.12093211517e-12, + "dvar2": 2.90444609163e-06, + "dvar": 1.51608685428e-06, + "dmean": 0.00108874298166, + "max": 0.0143991792575, + "var": 8.33909598441e-06, + "mean": 0.00527398148552, + }, + "zerocrossingrate": { + "dmean2": 0.0154096977785, + "median": 0.03369140625, + "min": 0.001953125, + "dvar2": 0.000311016134219, + "dvar": 0.000255326158367, + "dmean": 0.0135301901028, + "max": 0.53173828125, + "var": 0.00270974566229, + "mean": 0.0507398732007, + }, + "silence_rate_60dB": { + "dmean2": 0.0973053127527, + "median": 0, + "min": 0, + "dvar2": 0.115952201188, + "dvar": 0.0462943948805, + "dmean": 0.0486502535641, + "max": 1, + "var": 0.0738631635904, + "mean": 0.0802887231112, + }, + "erbbands_kurtosis": { + "dmean2": 2.95349383354, + "median": -0.0600297451019, + "min": -1.9039914608, + "dvar2": 32.2196807861, + "dvar": 14.8086624146, + "dmean": 1.914244771, + "max": 109.734512329, + "var": 22.2196083069, + "mean": 1.34698784351, + }, + "erbbands": { + "dmean2": [ + 0.428299844265, + 2.28906655312, + 5.51969909668, + 12.5672893524, + 21.8281002045, + 29.313495636, + 16.3954944611, + 10.3064498901, + 8.35011768341, + 14.7721195221, + 31.08735466, + 10.5252399445, + 13.8429956436, + 10.2353038788, + 12.4269170761, + 15.4577627182, + 7.70342493057, + 9.83148288727, + 9.0091753006, + 5.50162410736, + 8.03603172302, + 5.58365821838, + 7.62825536728, + 5.08629179001, + 4.8826174736, + 6.02267599106, + 5.06897115707, + 3.89897060394, + 4.18314743042, + 3.49176216125, + 5.57253408432, + 3.77836751938, + 2.91096735001, + 1.80456626415, + 1.10676884651, + 0.416215091944, + 0.128760591149, + 0.0229548234493, + 0.0030636980664, + 0.000156342808623, + ], + "median": [ + 0.283721119165, + 0.927432239056, + 1.47792208195, + 3.52597641945, + 2.42209553719, + 3.7360265255, + 4.3532910347, + 3.73197412491, + 2.65285634995, + 5.40560531616, + 8.99517536163, + 4.68354463577, + 4.5760307312, + 3.41258049011, + 5.04569816589, + 5.86556816101, + 3.6113049984, + 3.37496948242, + 2.82456660271, + 2.26255869865, + 2.13879799843, + 1.67384028435, + 1.41590988636, + 1.1372115612, + 1.05508136749, + 1.21863031387, + 1.16889476776, + 0.912000060081, + 0.915995657444, + 0.67924708128, + 0.686301469803, + 0.477991074324, + 0.319812089205, + 0.204466596246, + 0.114510826766, + 0.0470657609403, + 0.0110522108153, + 0.00186074071098, + 0.000260208500549, + 8.15202583908e-05, + ], + "min": [ + 1.73851526564e-22, + 3.92272553265e-21, + 4.44086710627e-20, + 2.42112437185e-20, + 1.94110467692e-19, + 1.17262933093e-19, + 1.98267761128e-19, + 3.97561329613e-19, + 2.18353477084e-19, + 8.14600849797e-19, + 9.92887946907e-19, + 2.17544613353e-18, + 1.40501031779e-18, + 2.23168986569e-18, + 3.23321078645e-18, + 4.46148548777e-18, + 6.14916017127e-18, + 5.52335130217e-18, + 3.36392207364e-18, + 8.55628346435e-18, + 9.33644961243e-18, + 7.00916537849e-18, + 8.54520089851e-18, + 1.17213478032e-17, + 1.73005751558e-17, + 1.7268897447e-17, + 1.54648430008e-17, + 1.47321280686e-17, + 2.49232910003e-17, + 1.74896487915e-17, + 1.97446026983e-17, + 1.73287886321e-17, + 1.25015776442e-17, + 9.77732860712e-18, + 9.27149525483e-18, + 5.97360887064e-18, + 2.9045715155e-18, + 1.33250659293e-18, + 3.08723036554e-19, + 3.08572360436e-20, + ], + "dvar2": [ + 0.589720308781, + 15.8781013489, + 115.261634827, + 894.74395752, + 3623.12988281, + 7216.13037109, + 1346.86328125, + 395.219970703, + 271.484313965, + 883.684448242, + 3534.11352539, + 445.965484619, + 962.390808105, + 561.608764648, + 816.409118652, + 1031.81359863, + 194.976074219, + 469.042724609, + 484.088256836, + 167.000671387, + 411.591308594, + 267.27520752, + 709.139465332, + 153.441650391, + 139.300918579, + 290.952606201, + 140.435256958, + 69.9862442017, + 73.9900283813, + 51.5217933655, + 215.226226807, + 78.0563201904, + 44.971824646, + 18.3356552124, + 10.0238132477, + 1.39749252796, + 0.152415767312, + 0.00447462266311, + 8.89804796316e-05, + 2.12016431078e-07, + ], + "dvar": [ + 0.215524703264, + 7.72521686554, + 80.2513198853, + 455.896606445, + 1555.41345215, + 2612.75439453, + 480.685638428, + 158.112503052, + 99.4391098022, + 426.479644775, + 1852.37145996, + 222.037109375, + 523.996582031, + 305.131774902, + 385.197235107, + 484.387969971, + 81.6952133179, + 205.287582397, + 213.223922729, + 66.5508499146, + 173.345169067, + 118.786193848, + 367.967529297, + 77.0198516846, + 67.1517333984, + 160.670516968, + 65.487197876, + 35.6394195557, + 35.1753883362, + 23.6361217499, + 93.6900482178, + 38.116645813, + 22.9980621338, + 9.08386993408, + 4.69902420044, + 0.651064157486, + 0.0717034339905, + 0.00214108382352, + 4.24883910455e-05, + 9.9780372409e-08, + ], + "dmean": [ + 0.285809576511, + 1.71466720104, + 4.78485679626, + 9.31142616272, + 13.9938602448, + 16.6350879669, + 9.57824516296, + 6.50806808472, + 5.05367469788, + 9.50606632233, + 20.6629753113, + 6.76035642624, + 9.00918102264, + 6.65080547333, + 8.12446498871, + 9.74140357971, + 4.73407125473, + 6.18055009842, + 5.77913284302, + 3.41051983833, + 5.03814935684, + 3.6214363575, + 4.92935085297, + 3.33136463165, + 3.14136767387, + 3.96647572517, + 3.27122926712, + 2.54569911957, + 2.78428292274, + 2.35334944725, + 3.64336013794, + 2.66048502922, + 2.00047636032, + 1.23166310787, + 0.78520399332, + 0.289730489254, + 0.0912321954966, + 0.015846285969, + 0.00216961093247, + 0.000110848726763, + ], + "max": [ + 9.64658355713, + 31.4366493225, + 96.8313522339, + 196.806808472, + 335.627746582, + 405.507202148, + 318.389892578, + 425.480987549, + 155.056884766, + 734.217224121, + 942.432678223, + 450.749542236, + 967.919799805, + 676.453918457, + 748.619262695, + 896.790100098, + 260.385131836, + 327.264251709, + 355.615600586, + 249.552474976, + 314.737304688, + 559.337402344, + 506.524536133, + 278.813781738, + 154.522460938, + 336.360961914, + 208.021591187, + 148.887634277, + 151.330780029, + 101.265739441, + 153.754882812, + 95.8621826172, + 106.083877563, + 54.0735244751, + 36.8974952698, + 10.6748008728, + 3.31087422371, + 0.541660666466, + 0.0808046162128, + 0.00396120175719, + ], + "var": [ + 0.381921380758, + 26.4123821259, + 222.696472168, + 638.73651123, + 1439.33251953, + 1684.1505127, + 392.004180908, + 183.072143555, + 90.0787277222, + 885.989501953, + 4406.39013672, + 503.672363281, + 1249.47509766, + 741.50958252, + 774.553833008, + 842.99206543, + 140.2137146, + 283.121612549, + 276.191925049, + 91.2408294678, + 259.221588135, + 241.70489502, + 608.700134277, + 205.818191528, + 143.899810791, + 318.06237793, + 165.342025757, + 84.3325576782, + 81.7364196777, + 55.5553512573, + 134.187164307, + 77.3074874878, + 48.5985832214, + 18.1627349854, + 8.14870166779, + 0.956533193588, + 0.0977488458157, + 0.00271429261193, + 5.59098298254e-05, + 1.41564086675e-07, + ], + "mean": [ + 0.477559149265, + 3.27270174026, + 7.60931921005, + 11.1678476334, + 12.6747789383, + 13.5848760605, + 10.8409786224, + 7.9783949852, + 5.86515951157, + 14.7864227295, + 34.0759735107, + 11.0554237366, + 14.3407850266, + 10.1547403336, + 12.8605480194, + 14.7355899811, + 7.50419521332, + 8.41241931915, + 7.65559196472, + 5.26523971558, + 7.26457834244, + 6.14167642593, + 7.44393730164, + 6.10683917999, + 5.52889490128, + 6.9977273941, + 6.09786462784, + 4.76159763336, + 5.06575870514, + 4.18718147278, + 5.28951311111, + 4.17526912689, + 3.10808396339, + 1.84764695168, + 1.06080031395, + 0.381296306849, + 0.113579489291, + 0.0184997897595, + 0.00259469938464, + 0.000180276590982, + ], + }, + "spectral_strongpeak": { + "dmean2": 0.464798301458, + "median": 0.361429721117, + "min": 0, + "dvar2": 0.545165300369, + "dvar": 0.234720677137, + "dmean": 0.286188274622, + "max": 11.5523529053, + "var": 0.389024376869, + "mean": 0.591991603374, + }, + "spectral_energy": { + "dmean2": 0.0197877436876, + "median": 0.0223190300167, + "min": 9.98372264228e-21, + "dvar2": 0.000644606188871, + "dvar": 0.000289402203634, + "dmean": 0.0129658170044, + "max": 0.2125197649, + "var": 0.00117197574582, + "mean": 0.0370581746101, + }, + "average_loudness": 0.875494062901, + "spectral_rolloff": { + "dmean2": 960.533081055, + "median": 495.263671875, + "min": 43.06640625, + "dvar2": 3546625.75, + "dvar": 1597838.5, + "dmean": 574.075500488, + "max": 19250.6835938, + "var": 3974413.25, + "mean": 1086.88134766, + }, + "spectral_centroid": { + "dmean2": 420.67791748, + "median": 810.38659668, + "min": 108.107566833, + "dvar2": 241400.015625, + "dvar": 134993.796875, + "dmean": 284.24029541, + "max": 10686.7919922, + "var": 578495.375, + "mean": 1054.03820801, + }, + "pitch_salience": { + "dmean2": 0.142301797867, + "median": 0.513008773327, + "min": 0.0365366339684, + "dvar2": 0.0186522137374, + "dvar": 0.00812033563852, + "dmean": 0.0912069603801, + "max": 0.904991447926, + "var": 0.0302368402481, + "mean": 0.486002385616, + }, + "spectral_energyband_middle_high": { + "dmean2": 0.00129647296853, + "median": 0.00109805946704, + "min": 1.59428602143e-21, + "dvar2": 3.59975365427e-06, + "dvar": 1.95909206013e-06, + "dmean": 0.000891717558261, + "max": 0.0392765961587, + "var": 5.41546842214e-06, + "mean": 0.00189269217663, + }, + "spectral_contrast_coeffs": { + "dmean2": [ + 0.078412592411, + 0.0850035324693, + 0.0669980943203, + 0.0519671812654, + 0.0410364679992, + 0.0324285030365, + ], + "median": [ + -0.712934792042, + -0.743565022945, + -0.804856359959, + -0.822204768658, + -0.819852888584, + -0.799151182175, + ], + "min": [ + -0.967198193073, + -0.974618017673, + -0.972245693207, + -0.961651921272, + -0.964111566544, + -0.961030483246, + ], + "dvar2": [ + 0.00545508880168, + 0.00506833242252, + 0.00283919996582, + 0.00171206286177, + 0.00133325520437, + 0.00108349311631, + ], + "dvar": [ + 0.00259663071483, + 0.00218783551827, + 0.00130078371149, + 0.000817677413579, + 0.000717440620065, + 0.000583040935453, + ], + "dmean": [ + 0.050219014287, + 0.0553187951446, + 0.0431638620794, + 0.033497761935, + 0.0269822217524, + 0.0216719079763, + ], + "max": [ + -0.362060725689, + -0.415127366781, + -0.449471920729, + -0.544864594936, + -0.520337045193, + -0.484779447317, + ], + "var": [ + 0.00896039698273, + 0.00595588609576, + 0.00468455068767, + 0.00240010186099, + 0.00273609859869, + 0.00380731164478, + ], + "mean": [ + -0.691217899323, + -0.738405883312, + -0.792845070362, + -0.815919578075, + -0.808208405972, + -0.783209085464, + ], + }, + "melbands_skewness": { + "dmean2": 2.03852105141, + "median": 3.49205732346, + "min": -5.09098958969, + "dvar2": 5.59213733673, + "dvar": 2.60251045227, + "dmean": 1.34666419029, + "max": 27.9477214813, + "var": 10.3399658203, + "mean": 4.20400619507, + }, + "spectral_spread": { + "dmean2": 1288822, + "median": 5559910, + "min": 202146.75, + "dvar2": 2488438882300.0, + "dvar": 1429272657920.0, + "dmean": 912083.75, + "max": 47627192, + "var": 9248252624900.0, + "mean": 5486277, + }, + "dissonance": { + "dmean2": 0.0456466600299, + "median": 0.461005300283, + "min": 0.0437632985413, + "dvar2": 0.00274136965163, + "dvar": 0.00109660299495, + "dmean": 0.0279056765139, + "max": 0.500000059605, + "var": 0.00284485798329, + "mean": 0.445629894733, + }, + "spectral_skewness": { + "dmean2": 0.794989943504, + "median": 1.50365900993, + "min": -0.509248197079, + "dvar2": 1.80770647526, + "dvar": 0.896960437298, + "dmean": 0.536588907242, + "max": 21.0161762238, + "var": 4.03656053543, + "mean": 2.08940839767, + }, + "spectral_flux": { + "dmean2": 0.0560869723558, + "median": 0.0768227279186, + "min": 1.56993041855e-06, + "dvar2": 0.00292630377226, + "dvar": 0.00139451096766, + "dmean": 0.0342274866998, + "max": 0.346184521914, + "var": 0.00482846889645, + "mean": 0.0971085876226, + }, + "spectral_contrast_valleys": { + "dmean2": [ + 0.721830368042, + 0.903648912907, + 0.712160050869, + 0.610355079174, + 0.583003401756, + 0.655298888683, + ], + "median": [ + -6.59833145142, + -6.94885444641, + -7.49168157578, + -8.04998779297, + -8.20836257935, + -10.1902523041, + ], + "min": [ + -27.0580844879, + -26.7953968048, + -27.0427837372, + -27.444858551, + -27.150718689, + -27.1886482239, + ], + "dvar2": [ + 0.450322687626, + 0.736437559128, + 0.416774332523, + 0.365079373121, + 0.383671492338, + 0.714411377907, + ], + "dvar": [ + 0.274560123682, + 0.357804059982, + 0.205317720771, + 0.192964762449, + 0.214226126671, + 0.383591622114, + ], + "dmean": [ + 0.495899945498, + 0.603728413582, + 0.457975208759, + 0.399977326393, + 0.413742393255, + 0.499295979738, + ], + "max": [ + -5.08935785294, + -4.38697957993, + -5.28223896027, + -5.58056020737, + -6.22064733505, + -7.39333581924, + ], + "var": [ + 1.47113585472, + 1.41246891022, + 1.57198941708, + 1.60442912579, + 2.06623411179, + 4.46363019943, + ], + "mean": [ + -6.87335252762, + -7.15114831924, + -7.72637891769, + -8.31610107422, + -8.46786499023, + -10.7827568054, + ], + }, + "erbbands_flatness_db": { + "dmean2": 0.0375987179577, + "median": 0.137290820479, + "min": 0.0375320166349, + "dvar2": 0.00167702429462, + "dvar": 0.000914512726013, + "dmean": 0.027081925422, + "max": 0.576275110245, + "var": 0.00752041861415, + "mean": 0.161212623119, + }, + "spectral_energyband_high": { + "dmean2": 0.000732991029508, + "median": 0.000172440675669, + "min": 7.32384502664e-21, + "dvar2": 2.84155316876e-06, + "dvar": 1.41091561545e-06, + "dmean": 0.000526301038917, + "max": 0.017098184675, + "var": 3.01054546981e-06, + "mean": 0.000937026168685, + }, + "spectral_entropy": { + "dmean2": 0.404551714659, + "median": 7.50951766968, + "min": 3.83585262299, + "dvar2": 0.203517630696, + "dvar": 0.113898038864, + "dmean": 0.29108941555, + "max": 9.81510448456, + "var": 0.692627191544, + "mean": 7.35735177994, + }, + "silence_rate_20dB": { + "dmean2": 0, + "median": 1, + "min": 1, + "dvar2": 0, + "dvar": 0, + "dmean": 0, + "max": 1, + "var": 0, + "mean": 1, + }, + "melbands_flatness_db": { + "dmean2": 0.0618936605752, + "median": 0.276825994253, + "min": 0.002832879778, + "dvar2": 0.00364537141286, + "dvar": 0.00214522774331, + "dmean": 0.045175999403, + "max": 0.766786575317, + "var": 0.0141341816634, + "mean": 0.288144052029, + }, + "barkbands": { + "dmean2": [ + 0.000780046277214, + 0.0112598799169, + 0.00605708220974, + 0.00587175553665, + 0.00767562072724, + 0.00122650107369, + 0.000665556231979, + 0.00140987348277, + 0.000565772177652, + 0.000346536544384, + 0.000235375904595, + 0.000462280353531, + 0.000173911525053, + 0.00019429254462, + 0.000148159728269, + 0.000128144325572, + 0.000106870829768, + 0.000137910654303, + 0.000100147895864, + 0.000120911368867, + 0.000115335969895, + 0.000109506108856, + 0.000169414444827, + 0.000173168242327, + 0.000152851440362, + 7.42633710615e-05, + 1.64063621924e-05, + ], + "median": [ + 0.00051947060274, + 0.00655899569392, + 0.00139943067916, + 0.000909918686375, + 0.00112726807129, + 0.000451086089015, + 0.000139944080729, + 0.000426110171247, + 0.000153119675815, + 9.37489749049e-05, + 6.31682341918e-05, + 0.000157135087647, + 6.7123779445e-05, + 5.83748333156e-05, + 4.5447894081e-05, + 3.86669562431e-05, + 2.67468385573e-05, + 2.32060701819e-05, + 1.99756977963e-05, + 2.44901912083e-05, + 2.81980246655e-05, + 2.38180637098e-05, + 2.30469813687e-05, + 2.0819465135e-05, + 1.68694987224e-05, + 7.75625903771e-06, + 1.76939909124e-06, + ], + "min": [ + 1.05992921059e-23, + 1.01882080107e-23, + 3.81650085531e-23, + 9.58720013055e-24, + 6.05843723706e-23, + 3.97942082707e-23, + 1.94826602816e-23, + 4.55673290334e-23, + 8.03923036692e-23, + 6.13023998774e-23, + 3.90747860578e-23, + 1.36834159167e-22, + 1.19486830182e-22, + 9.59428157712e-23, + 7.36139500768e-23, + 2.05417839863e-22, + 1.69648021278e-22, + 1.62890563033e-22, + 3.11427467418e-22, + 3.05703189767e-22, + 3.80435328089e-22, + 6.14622508647e-22, + 6.26719974618e-22, + 8.48117814015e-22, + 1.07863463304e-21, + 1.69885611036e-21, + 2.13010882298e-21, + ], + "dvar2": [ + 1.47044806909e-06, + 0.000373879738618, + 0.000165687393746, + 0.000221965063247, + 0.000413867877796, + 6.03771377428e-06, + 2.01042939807e-06, + 6.88658747094e-06, + 1.74298861566e-06, + 5.89952264818e-07, + 4.87073350541e-07, + 1.03171248611e-06, + 1.07554612327e-07, + 1.63596951097e-07, + 1.26727968564e-07, + 9.0355520399e-08, + 1.02161081372e-07, + 1.85926893437e-07, + 7.48928954408e-08, + 1.11035916461e-07, + 6.02020833185e-08, + 4.97267329536e-08, + 1.73844824758e-07, + 1.58650124149e-07, + 1.6659740254e-07, + 4.58809203963e-08, + 2.44244335867e-09, + ], + "dvar": [ + 5.69594305944e-07, + 0.000150891966769, + 0.000102631311165, + 9.98085743049e-05, + 0.000165758596268, + 2.23823212764e-06, + 8.41339669932e-07, + 3.64793049812e-06, + 9.1262540991e-07, + 3.29465478899e-07, + 2.32748931239e-07, + 5.15360568443e-07, + 4.57060664871e-08, + 7.06937512973e-08, + 5.41987397185e-08, + 3.7454729096e-08, + 4.461882952e-08, + 9.44123073054e-08, + 3.58138905199e-08, + 6.19630355914e-08, + 2.9774760435e-08, + 2.44501130453e-08, + 7.74448452034e-08, + 8.03016817486e-08, + 7.94691246142e-08, + 2.18788205331e-08, + 1.17777132491e-09, + ], + "dmean": [ + 0.000512506987434, + 0.00804802589118, + 0.00487215537578, + 0.00382397091016, + 0.00462136603892, + 0.000744397111703, + 0.000406474980991, + 0.000937627162784, + 0.000366782565834, + 0.000220809830353, + 0.000151705185999, + 0.000295725563774, + 0.000106656254502, + 0.00012199585035, + 9.30279566091e-05, + 7.9521589214e-05, + 6.80271550664e-05, + 8.83774118847e-05, + 6.44517785986e-05, + 7.93256476754e-05, + 7.51946136006e-05, + 7.46458317735e-05, + 0.000111750843644, + 0.000121858320199, + 0.00010798213043, + 5.2450595831e-05, + 1.15770853881e-05, + ], + "max": [ + 0.0238662660122, + 0.195193648338, + 0.0952763408422, + 0.0813259333372, + 0.0981372743845, + 0.0360920317471, + 0.029116846621, + 0.0528674200177, + 0.032112069428, + 0.0240354128182, + 0.0265638101846, + 0.0361663326621, + 0.00565500324592, + 0.00523700891063, + 0.00579286180437, + 0.00454595778137, + 0.00979127082974, + 0.00769131816924, + 0.00685597769916, + 0.0066013825126, + 0.00420426204801, + 0.003395519685, + 0.00438667321578, + 0.00533647229895, + 0.00484169786796, + 0.00184860487934, + 0.000426471000537, + ], + "var": [ + 1.00052716334e-06, + 0.000443879165687, + 0.000208414290682, + 9.92849600152e-05, + 0.000132293673232, + 2.05686956178e-06, + 1.2623826251e-06, + 8.76024478202e-06, + 2.01141006073e-06, + 8.06357945748e-07, + 4.44669126409e-07, + 9.52840196078e-07, + 7.04275890939e-08, + 9.74497922357e-08, + 6.93088750836e-08, + 5.45285452347e-08, + 8.23804526817e-08, + 1.70030460822e-07, + 7.66214398595e-08, + 1.23539535934e-07, + 7.75202835257e-08, + 5.95994933406e-08, + 1.22098853694e-07, + 1.74581757051e-07, + 1.51459090603e-07, + 3.05719431992e-08, + 1.57505808396e-09, + ], + "mean": [ + 0.000792860577349, + 0.0153801292181, + 0.00665125902742, + 0.00363414245658, + 0.00425389688462, + 0.000888265087269, + 0.00047852890566, + 0.0015550450189, + 0.000540278153494, + 0.000325157860061, + 0.000214053303353, + 0.000429682782851, + 0.00015268351126, + 0.00016140457592, + 0.000122115612612, + 0.000112896683277, + 0.000105671220808, + 0.000135471418616, + 0.000110447574116, + 0.000138279981911, + 0.000139797382872, + 0.000137177747092, + 0.000168910919456, + 0.000193774962099, + 0.000155140223796, + 6.66902997182e-05, + 1.43114566526e-05, + ], + }, + "erbbands_skewness": { + "dmean2": 0.806777954102, + "median": 0.440305769444, + "min": -4.64436674118, + "dvar2": 0.675009250641, + "dvar": 0.328243792057, + "dmean": 0.546455204487, + "max": 8.12401199341, + "var": 1.04869437218, + "mean": 0.503021776676, + }, + "erbbands_spread": { + "dmean2": 20.0970649719, + "median": 42.1646537781, + "min": 0.278548508883, + "dvar2": 522.817504883, + "dvar": 262.181243896, + "dmean": 13.6425132751, + "max": 183.475982666, + "var": 954.214477539, + "mean": 47.5880241394, + }, + "melbands_kurtosis": { + "dmean2": 37.6371421814, + "median": 17.5584392548, + "min": -1.83117628098, + "dvar2": 5883.89160156, + "dvar": 2582.94384766, + "dmean": 24.0055179596, + "max": 1107.68518066, + "var": 5390.95068359, + "mean": 42.5645561218, + }, + "melbands": { + "dmean2": [ + 0.00329641532153, + 0.0026374112349, + 0.00187228771392, + 0.00180036283564, + 0.0007303962484, + 0.000222255082917, + 0.000132661632961, + 0.00020058186783, + 0.000218769302592, + 7.24005949451e-05, + 7.06409045961e-05, + 4.27709564974e-05, + 3.79567354685e-05, + 5.88957736909e-05, + 2.37249169004e-05, + 1.84442196769e-05, + 1.82501553354e-05, + 1.56433070515e-05, + 9.16564476938e-06, + 7.00420378053e-06, + 1.01661744338e-05, + 6.29408714303e-06, + 6.71077714287e-06, + 6.99026259099e-06, + 4.12339386457e-06, + 4.15688373323e-06, + 4.44842953584e-06, + 3.88687976738e-06, + 3.67111715605e-06, + 2.61515447164e-06, + 2.38516872741e-06, + 2.41933616962e-06, + 2.26173710871e-06, + 2.03485728889e-06, + 3.53071436621e-06, + 2.68972803497e-06, + 2.38401025854e-06, + 2.23127585741e-06, + 1.68457290783e-06, + 1.60106765179e-06, + ], + "median": [ + 0.00216405838728, + 0.00101412762888, + 0.000571827986278, + 0.000202020863071, + 0.00016626593424, + 7.9059296695e-05, + 4.09869862779e-05, + 7.25362333469e-05, + 6.23455853201e-05, + 2.26373686019e-05, + 2.20830006583e-05, + 1.21264438349e-05, + 1.26217200886e-05, + 1.92631814571e-05, + 8.60928776092e-06, + 7.06569699105e-06, + 5.57656539968e-06, + 4.13972065871e-06, + 3.38378731612e-06, + 2.46519289249e-06, + 2.28213752962e-06, + 1.57693932579e-06, + 1.32363095418e-06, + 1.03902482351e-06, + 8.31881152408e-07, + 6.98770861618e-07, + 8.20869786367e-07, + 6.86328689881e-07, + 7.16525391908e-07, + 5.77442165195e-07, + 4.89849981022e-07, + 4.82333689433e-07, + 4.68203353421e-07, + 3.40057397352e-07, + 4.30950535701e-07, + 2.96965936286e-07, + 2.67273350119e-07, + 2.37223986232e-07, + 1.66473483887e-07, + 1.67262996342e-07, + ], + "min": [ + 2.54779412357e-24, + 1.59138993003e-23, + 9.79070021169e-24, + 1.23866726345e-23, + 6.20370194956e-24, + 8.31699838907e-24, + 3.46986464504e-24, + 9.82299065512e-24, + 8.27121290213e-24, + 1.3206985424e-23, + 6.71308718543e-24, + 9.21575629586e-24, + 8.26029664492e-24, + 1.66434662644e-23, + 1.14134225925e-23, + 1.12782867751e-23, + 1.02581649846e-23, + 4.38057261125e-24, + 7.50343667118e-24, + 1.66349386781e-23, + 1.01460639057e-23, + 7.12410659402e-24, + 8.232875051e-24, + 8.27436992347e-24, + 9.45578063691e-24, + 1.17401498467e-23, + 1.32374251998e-23, + 1.02838187413e-23, + 8.10053416782e-24, + 9.78477586629e-24, + 7.83643694738e-24, + 1.7413921467e-23, + 8.2819603431e-24, + 9.63422728455e-24, + 1.12002281997e-23, + 1.24978428576e-23, + 9.36531012399e-24, + 8.62730944791e-24, + 8.31138879917e-24, + 8.07182751947e-24, + ], + "dvar2": [ + 3.41360646416e-05, + 1.77424899448e-05, + 1.60067065735e-05, + 2.49053100561e-05, + 3.13707209898e-06, + 1.89071258205e-07, + 6.62138788243e-08, + 1.31598056896e-07, + 1.75494065502e-07, + 2.65618265161e-08, + 2.46251730118e-08, + 1.05109352333e-08, + 1.12366285165e-08, + 1.85752213611e-08, + 2.04274308579e-09, + 1.38876810052e-09, + 1.47249523685e-09, + 1.39897116114e-09, + 3.35575400801e-10, + 2.33118274684e-10, + 6.82675915797e-10, + 4.3367004432e-10, + 6.24023721585e-10, + 3.55194929025e-10, + 1.20648546709e-10, + 1.40170333673e-10, + 1.71406291938e-10, + 1.14362519454e-10, + 8.40982630756e-11, + 3.15224409075e-11, + 2.62250204192e-11, + 2.74679064216e-11, + 2.2249901574e-11, + 1.64916916928e-11, + 8.66626423401e-11, + 4.29321578288e-11, + 3.092853057e-11, + 2.80370379691e-11, + 1.48893328222e-11, + 1.55275462627e-11, + ], + "dvar": [ + 1.25958504213e-05, + 1.19361502584e-05, + 9.92833702185e-06, + 1.01751447801e-05, + 1.10249095542e-06, + 7.38648679999e-08, + 2.46767069001e-08, + 6.59268906134e-08, + 9.28329342287e-08, + 1.36733522282e-08, + 1.33950210923e-08, + 5.78824854713e-09, + 5.27800469996e-09, + 9.34593735735e-09, + 8.1471057678e-10, + 6.13167738805e-10, + 6.4058813809e-10, + 6.15332840237e-10, + 1.42515957369e-10, + 9.12699776867e-11, + 2.86098922331e-10, + 1.81715559266e-10, + 3.07557562751e-10, + 1.68111913279e-10, + 6.04145206085e-11, + 6.53835111053e-11, + 9.30251431441e-11, + 6.14560000112e-11, + 3.70867225818e-11, + 1.61549211508e-11, + 1.28530094554e-11, + 1.32515188059e-11, + 1.05031313508e-11, + 7.0189813163e-12, + 3.6923960417e-11, + 2.02655461856e-11, + 1.42444450332e-11, + 1.33324263088e-11, + 7.44717742335e-12, + 7.52735981185e-12, + ], + "dmean": [ + 0.00229502934963, + 0.00207201717421, + 0.00148841179907, + 0.00110294274054, + 0.000417607021518, + 0.000138642484671, + 8.079289546e-05, + 0.000131005115691, + 0.000145740428707, + 4.67124446004e-05, + 4.60060946352e-05, + 2.76701957773e-05, + 2.46403087658e-05, + 3.7861718738e-05, + 1.42134094858e-05, + 1.14496015158e-05, + 1.1467674085e-05, + 9.96491326077e-06, + 5.73495390199e-06, + 4.29265037383e-06, + 6.35433207208e-06, + 3.98508973376e-06, + 4.25367534262e-06, + 4.42740110884e-06, + 2.68380449597e-06, + 2.6487989544e-06, + 2.8972558539e-06, + 2.54162932833e-06, + 2.325889227e-06, + 1.69365830516e-06, + 1.53014161697e-06, + 1.59524222454e-06, + 1.51298979745e-06, + 1.31523813707e-06, + 2.27577038459e-06, + 1.79932794708e-06, + 1.64016375948e-06, + 1.49033098751e-06, + 1.15183547678e-06, + 1.07529763227e-06, + ], + "max": [ + 0.0677252113819, + 0.0378952510655, + 0.0290289148688, + 0.0254700183868, + 0.0128895640373, + 0.00856050662696, + 0.00286759086885, + 0.00716800382361, + 0.00654651876539, + 0.00379466195591, + 0.00477699656039, + 0.00299851293676, + 0.00376314716414, + 0.00523377442732, + 0.000584416906349, + 0.000505314266775, + 0.000558701285627, + 0.0005260904436, + 0.000225639698328, + 0.000301965657854, + 0.000398421369027, + 0.000744273711462, + 0.000533478625584, + 0.000286504684482, + 0.000261136126937, + 0.000268742762273, + 0.000268247065833, + 0.000205783173442, + 0.000170988860191, + 8.68624047143e-05, + 7.21269097994e-05, + 0.000123736841488, + 7.81475755502e-05, + 4.78184156236e-05, + 0.000100603712781, + 8.45123504405e-05, + 5.73282668483e-05, + 9.03406980797e-05, + 5.86272690271e-05, + 5.47057570657e-05, + ], + "var": [ + 3.04177119688e-05, + 4.68787911814e-05, + 1.81959476322e-05, + 8.42998906592e-06, + 7.75159548994e-07, + 8.02486823659e-08, + 2.52603289397e-08, + 1.48078854068e-07, + 2.24927916292e-07, + 2.99575368956e-08, + 3.19193311782e-08, + 1.40635734169e-08, + 1.02791402057e-08, + 1.71800866866e-08, + 1.16958798202e-09, + 9.48678025026e-10, + 8.88495277351e-10, + 7.94154908501e-10, + 2.05291103561e-10, + 1.29107141644e-10, + 4.27535090664e-10, + 2.93017693442e-10, + 4.73644123922e-10, + 3.10595688058e-10, + 1.52411028242e-10, + 1.2613242395e-10, + 1.5855858293e-10, + 1.29483784805e-10, + 7.99841026744e-11, + 4.30840640941e-11, + 2.8866565388e-11, + 2.75744739542e-11, + 2.49805558183e-11, + 1.52014841687e-11, + 4.94557797492e-11, + 3.47199664852e-11, + 2.74030364372e-11, + 2.57780706503e-11, + 1.54394483309e-11, + 1.40736120674e-11, + ], + "mean": [ + 0.00421799859032, + 0.00423632748425, + 0.00198257528245, + 0.000957176904194, + 0.000434520887211, + 0.000167578022229, + 9.5177514595e-05, + 0.000210603539017, + 0.00024211226264, + 7.01813114574e-05, + 7.22835611668e-05, + 4.05879654863e-05, + 3.73676557501e-05, + 5.41154404345e-05, + 2.00823214982e-05, + 1.64985340234e-05, + 1.50245914483e-05, + 1.25500946524e-05, + 8.03009515948e-06, + 6.3551688072e-06, + 8.80254174263e-06, + 6.16126408204e-06, + 6.2302265178e-06, + 6.67886297379e-06, + 4.73709496873e-06, + 4.31715216109e-06, + 4.50706738775e-06, + 4.40146368419e-06, + 4.02836485591e-06, + 2.9554471439e-06, + 2.69067754743e-06, + 2.76429022961e-06, + 2.71651742878e-06, + 2.17673414227e-06, + 3.17735816679e-06, + 2.68415283244e-06, + 2.49323466051e-06, + 2.23538791033e-06, + 1.75996285634e-06, + 1.54595397817e-06, + ], + }, + "spectral_complexity": { + "dmean2": 4.85211372375, + "median": 11, + "min": 0, + "dvar2": 21.6541137695, + "dvar": 12.252790451, + "dmean": 3.37941265106, + "max": 43, + "var": 52.0905303955, + "mean": 11.7429180145, + }, + "spectral_energyband_low": { + "dmean2": 0.0149820484221, + "median": 0.0116189969704, + "min": 5.17603856995e-23, + "dvar2": 0.00048074303777, + "dvar": 0.000204645111808, + "dmean": 0.0103260846809, + "max": 0.209965258837, + "var": 0.00083902978804, + "mean": 0.0249669943005, + }, + "erbbands_crest": { + "dmean2": 5.19815206528, + "median": 8.93636989594, + "min": 2.15950489044, + "dvar2": 22.1311225891, + "dvar": 10.3251180649, + "dmean": 3.33805418015, + "max": 33.2750091553, + "var": 31.5032939911, + "mean": 10.3855142593, + }, + "silence_rate_30dB": { + "dmean2": 0.0619035847485, + "median": 1, + "min": 0, + "dvar2": 0.0776470303535, + "dvar": 0.0299905408174, + "dmean": 0.0309502612799, + "max": 1, + "var": 0.0223165713251, + "mean": 0.977159261703, + }, + "barkbands_skewness": { + "dmean2": 1.44653308392, + "median": 2.15599632263, + "min": -4.99289512634, + "dvar2": 2.84916734695, + "dvar": 1.25199246407, + "dmean": 0.951523184776, + "max": 18.4443359375, + "var": 5.02271461487, + "mean": 2.63306665421, + }, + "barkbands_flatness_db": { + "dmean2": 0.0515989176929, + "median": 0.178841590881, + "min": 0.0207624137402, + "dvar2": 0.00268978346139, + "dvar": 0.00151978223585, + "dmean": 0.0371669046581, + "max": 0.588909327984, + "var": 0.00901084393263, + "mean": 0.189883828163, + }, + "dynamic_complexity": 3.91312026978, + "mfcc": { + "mean": [ + -700.66998291, + 135.489395142, + 28.421787262, + 23.1075897217, + 8.46113491058, + 14.6377601624, + 6.19332933426, + 8.12203979492, + 3.99862265587, + 6.61921405792, + 2.94504475594, + 5.26969957352, + 1.69772768021, + ], + "icov": [ + [ + 0.000107419175038, + 8.07790347608e-05, + 4.01940233132e-05, + 1.41072532642e-05, + 3.17661724694e-05, + -7.08577063051e-05, + -9.35970456339e-06, + -0.000100402481621, + 0.000114859867608, + -9.32187540457e-05, + 7.22726763343e-05, + -7.69687903812e-05, + 0.00014752781135, + ], + [ + 8.07790347608e-05, + 0.000406299368478, + 0.000213704173802, + 3.07764312311e-05, + -0.00013552600285, + 0.000182592688361, + 0.00012160334154, + 0.000219605542952, + -0.000212934159208, + -4.89489757456e-05, + 1.42763483382e-05, + 0.000134202622576, + 0.000169955193996, + ], + [ + 4.01940233132e-05, + 0.000213704173802, + 0.000946900865529, + 0.000225221272558, + -0.000283261353616, + 4.93922234455e-05, + -0.000170131010236, + 0.00063844473334, + -0.000424777012086, + 5.35618892172e-06, + -3.6012417695e-05, + 0.000732303771656, + -0.000106887986476, + ], + [ + 1.41072532642e-05, + 3.07764312311e-05, + 0.000225221272558, + 0.00193217326887, + -0.000282399530988, + 0.000215311141801, + 2.67071982307e-07, + 0.00030652814894, + 0.000730566098355, + -0.000450449471828, + 0.000128779895022, + -0.000382249534596, + 0.00046093785204, + ], + [ + 3.17661724694e-05, + -0.00013552600285, + -0.000283261353616, + -0.000282399530988, + 0.00403568474576, + -0.00131330266595, + 0.000184118820471, + 6.65877596475e-05, + -0.000588293594774, + 0.0022953953594, + -0.00182200025301, + 0.00155140575953, + -0.00139354949351, + ], + [ + -7.08577063051e-05, + 0.000182592688361, + 4.93922234455e-05, + 0.000215311141801, + -0.00131330266595, + 0.00576621666551, + -0.00270392908715, + -0.000217271212023, + -1.60099043569e-05, + -7.43252239772e-05, + 0.00248048570938, + -0.00210075359792, + -0.000226830641623, + ], + [ + -9.35970456339e-06, + 0.00012160334154, + -0.000170131010236, + 2.67071982307e-07, + 0.000184118820471, + -0.00270392908715, + 0.0077719129622, + -0.00278255506419, + 0.000178223548573, + 0.000260046246694, + -0.00136796431616, + 0.00183528801426, + -0.00172712933272, + ], + [ + -0.000100402481621, + 0.000219605542952, + 0.00063844473334, + 0.00030652814894, + 6.65877596475e-05, + -0.000217271212023, + -0.00278255506419, + 0.0108746550977, + -0.00441821618006, + 0.00173715199344, + -0.000915269250982, + 0.000479113426991, + -0.000192808452994, + ], + [ + 0.000114859867608, + -0.000212934159208, + -0.000424777012086, + 0.000730566098355, + -0.000588293594774, + -1.60099043569e-05, + 0.000178223548573, + -0.00441821618006, + 0.0135310757905, + -0.00714344065636, + 0.00168303831015, + -0.0014511711197, + 0.00106327817775, + ], + [ + -9.32187540457e-05, + -4.89489757456e-05, + 5.35618892172e-06, + -0.000450449471828, + 0.0022953953594, + -7.43252239772e-05, + 0.000260046246694, + 0.00173715199344, + -0.00714344065636, + 0.0186834186316, + -0.00981860049069, + 0.00231390399858, + -0.00192968046758, + ], + [ + 7.22726763343e-05, + 1.42763483382e-05, + -3.6012417695e-05, + 0.000128779895022, + -0.00182200025301, + 0.00248048570938, + -0.00136796431616, + -0.000915269250982, + 0.00168303831015, + -0.00981860049069, + 0.0199193935841, + -0.0106352949515, + 0.00361294415779, + ], + [ + -7.69687903812e-05, + 0.000134202622576, + 0.000732303771656, + -0.000382249534596, + 0.00155140575953, + -0.00210075359792, + 0.00183528801426, + 0.000479113426991, + -0.0014511711197, + 0.00231390399858, + -0.0106352949515, + 0.0232046339661, + -0.0109363310039, + ], + [ + 0.00014752781135, + 0.000169955193996, + -0.000106887986476, + 0.00046093785204, + -0.00139354949351, + -0.000226830641623, + -0.00172712933272, + -0.000192808452994, + 0.00106327817775, + -0.00192968046758, + 0.00361294415779, + -0.0109363310039, + 0.0196638610214, + ], + ], + "cov": [ + [ + 12126.3984375, + -2809.12280273, + -96.7183837891, + -85.6093063354, + -142.921066284, + 369.096466064, + 244.115966797, + 210.12538147, + -83.0255813599, + -16.950138092, + -48.6743812561, + 47.0859146118, + -9.6302986145, + ], + [ + -2809.12280273, + 3659.98071289, + -633.989257812, + 86.3335189819, + 19.0077934265, + -274.307128906, + -212.871582031, + -111.485351562, + 41.133228302, + 37.7287139893, + 31.5271949768, + -30.5362644196, + -58.9328155518, + ], + [ + -96.7183837891, + -633.989257812, + 1356.80432129, + -153.434661865, + 98.7311553955, + 48.7583999634, + 48.0191307068, + -39.584274292, + 21.167137146, + -17.4020252228, + -33.5541763306, + -60.2577857971, + -1.63439774513, + ], + [ + -85.6093063354, + 86.3335189819, + -153.434661865, + 567.058959961, + 11.0189790726, + -40.2089500427, + -34.1776237488, + -36.5306549072, + -42.4389686584, + 2.53039526939, + 9.81129646301, + 8.50957870483, + -11.8001689911, + ], + [ + -142.921066284, + 19.0077934265, + 98.7311553955, + 11.0189790726, + 312.80770874, + 82.4246749878, + 31.4400959015, + 4.76846504211, + -5.12284135818, + -42.4019470215, + -8.1498708725, + -10.4739961624, + 18.9017391205, + ], + [ + 369.096466064, + -274.307128906, + 48.7583999634, + -40.2089500427, + 82.4246749878, + 282.404968262, + 117.230125427, + 44.6262054443, + 0.698531210423, + -29.1598892212, + -30.9757270813, + 13.9199514389, + 31.1762313843, + ], + [ + 244.115966797, + -212.871582031, + 48.0191307068, + -34.1776237488, + 31.4400959015, + 117.230125427, + 200.592071533, + 64.6621398926, + 13.1711330414, + -6.63176584244, + -2.64764499664, + 2.61026930809, + 23.4787330627, + ], + [ + 210.12538147, + -111.485351562, + -39.584274292, + -36.5306549072, + 4.76846504211, + 44.6262054443, + 64.6621398926, + 133.662643433, + 42.5779304504, + 5.81215953827, + 6.34349679947, + 7.00799417496, + 8.87113571167, + ], + [ + -83.0255813599, + 41.133228302, + 21.167137146, + -42.4389686584, + -5.12284135818, + 0.698531210423, + 13.1711330414, + 42.5779304504, + 116.71862793, + 51.1233444214, + 23.580953598, + 11.0932693481, + 3.13923668861, + ], + [ + -16.950138092, + 37.7287139893, + -17.4020252228, + 2.53039526939, + -42.4019470215, + -29.1598892212, + -6.63176584244, + 5.81215953827, + 51.1233444214, + 106.574928284, + 59.1461105347, + 23.1877384186, + 5.50347471237, + ], + [ + -48.6743812561, + 31.5271949768, + -33.5541763306, + 9.81129646301, + -8.1498708725, + -30.9757270813, + -2.64764499664, + 6.34349679947, + 23.580953598, + 59.1461105347, + 103.604682922, + 46.4150886536, + 9.88276195526, + ], + [ + 47.0859146118, + -30.5362644196, + -60.2577857971, + 8.50957870483, + -10.4739961624, + 13.9199514389, + 2.61026930809, + 7.00799417496, + 11.0932693481, + 23.1877384186, + 46.4150886536, + 85.4878540039, + 39.7927474976, + ], + [ + -9.6302986145, + -58.9328155518, + -1.63439774513, + -11.8001689911, + 18.9017391205, + 31.1762313843, + 23.4787330627, + 8.87113571167, + 3.13923668861, + 5.50347471237, + 9.88276195526, + 39.7927474976, + 76.2382049561, + ], + ], + }, + "spectral_decrease": { + "dmean2": 5.08372233199e-09, + "median": -5.58059509714e-09, + "min": -5.60004380645e-08, + "dvar2": 4.32927042758e-17, + "dvar": 1.93053019642e-17, + "dmean": 3.32266036907e-09, + "max": 2.9793302381e-18, + "var": 7.8599522368e-17, + "mean": -9.43999456382e-09, + }, + "barkbands_crest": { + "dmean2": 5.16687965393, + "median": 12.3140182495, + "min": 2.29649472237, + "dvar2": 21.2763710022, + "dvar": 8.37867069244, + "dmean": 3.1435611248, + "max": 25.9979152679, + "var": 29.487985611, + "mean": 13.2201347351, + }, + }, +} def test_load_extractor(): - path = "tests/resources/mir_datasets/acousticbrainz_genre/acousticbrainz-mediaeval-validation/be/be9e01e5-8f93-494d-bbaa-ddcc5a52f629.json" - extractor_data = acousticbrainz_genre.load_extractor(path) + path = "tests/resources/mir_datasets/acousticbrainz_genre/acousticbrainz-mediaeval-validation/be/be9e01e5-8f93-494d-bbaa-ddcc5a52f629.json" + extractor_data = acousticbrainz_genre.load_extractor(path) - assert type(extractor_data) == dict - assert extractor_data == features + assert type(extractor_data) == dict + assert extractor_data == features def test_to_jams(httpserver): @@ -921,118 +3925,168 @@ def test_to_jams(httpserver): trackid = "tagtraum#validation#be9e01e5-8f93-494d-bbaa-ddcc5a52f629#2b6bfcfd-46a5-3f98-a58f-2c51d7c9e960#trance########" httpserver.serve_content( - open("tests/resources/download/acousticbrainz_genre_dataset_little_test.json.zip", "rb").read() + open( + "tests/resources/download/acousticbrainz_genre_dataset_little_test.json.zip", + "rb", + ).read() ) remote_index = { "index": download_utils.RemoteFileMetadata( filename="acousticbrainz_genre_dataset_little_test.json.zip", url=httpserver.url, - checksum='c5fbdd4f8b7de383796a34143cb44c4f', - destination_dir='', + checksum="c5fbdd4f8b7de383796a34143cb44c4f", + destination_dir="", ) } - track = acousticbrainz_genre.Track(trackid, data_home=data_home, remote_index=remote_index, - remote_index_name='acousticbrainz_genre_dataset_little_test.json') + track = acousticbrainz_genre.Track( + trackid, + data_home=data_home, + remote_index=remote_index, + remote_index_name="acousticbrainz_genre_dataset_little_test.json", + ) jam_ground_truth = jams_utils.jams_converter( - metadata={ - 'features': features, - 'duration': features["metadata"]["audio_properties"]["length"] - } - ) + metadata={ + "features": features, + "duration": features["metadata"]["audio_properties"]["length"], + } + ) jam = track.to_jams() - os.remove(os.path.join("mirdata", "datasets/indexes", 'acousticbrainz_genre_dataset_little_test.json')) + os.remove( + os.path.join( + "mirdata", + "datasets/indexes", + "acousticbrainz_genre_dataset_little_test.json", + ) + ) assert jam_ground_truth == jam def test_filter_index(httpserver): httpserver.serve_content( - open("tests/resources/download/acousticbrainz_genre_dataset_little_test.json.zip", "rb").read() + open( + "tests/resources/download/acousticbrainz_genre_dataset_little_test.json.zip", + "rb", + ).read() ) remote_index = { "index": download_utils.RemoteFileMetadata( filename="acousticbrainz_genre_dataset_little_test.json.zip", url=httpserver.url, - checksum='c5fbdd4f8b7de383796a34143cb44c4f', - destination_dir='', + checksum="c5fbdd4f8b7de383796a34143cb44c4f", + destination_dir="", ) } - DATA_test = utils.LargeData('acousticbrainz_genre_dataset_little_test.json', remote_index=remote_index) - index = acousticbrainz_genre.load_all_train(index=DATA_test.index["tracks"]) + DATA_test = core.LargeData( + "acousticbrainz_genre_dataset_little_test.json", remote_index=remote_index + ) + dataset = acousticbrainz_genre.Dataset(index=DATA_test.index) + index = dataset.load_all_train() assert len(index) == 8 - index = acousticbrainz_genre.load_all_validation(index=DATA_test.index["tracks"]) + index = dataset.load_all_validation() assert len(index) == 8 - index = acousticbrainz_genre.load_tagtraum_validation(index=DATA_test.index["tracks"]) + index = dataset.load_tagtraum_validation() assert len(index) == 2 - index = acousticbrainz_genre.load_tagtraum_train(index=DATA_test.index["tracks"]) + index = dataset.load_tagtraum_train() assert len(index) == 2 - index = acousticbrainz_genre.load_allmusic_validation(index=DATA_test.index["tracks"]) + index = dataset.load_allmusic_validation() assert len(index) == 2 - index = acousticbrainz_genre.load_lastfm_train(index=DATA_test.index["tracks"]) + index = dataset.load_lastfm_train() assert len(index) == 2 - index = acousticbrainz_genre.load_lastfm_validation(index=DATA_test.index["tracks"]) + index = dataset.load_lastfm_validation() assert len(index) == 2 - index = acousticbrainz_genre.load_discogs_train(index=DATA_test.index["tracks"]) + index = dataset.load_discogs_train() assert len(index) == 2 - index = acousticbrainz_genre.load_discogs_validation(index=DATA_test.index["tracks"]) + index = dataset.load_discogs_validation() assert len(index) == 2 - os.remove(os.path.join("mirdata", "datasets/indexes", 'acousticbrainz_genre_dataset_little_test.json')) + os.remove( + os.path.join( + "mirdata", + "datasets/indexes", + "acousticbrainz_genre_dataset_little_test.json", + ) + ) +# TODO Fix this test +@pytest.mark.skip("This isn't working now with the new dataset API") def test_download(httpserver): + data_home = "tests/resources/mir_datasets/acousticbrainz_genre2" if os.path.exists(data_home): shutil.rmtree(data_home) # download the full dataset + httpserver.serve_content( - open("tests/resources/download/acousticbrainz-mediaeval-features-validation-01.tar.bz2", "rb").read() + open( + "tests/resources/download/acousticbrainz-mediaeval-features-validation-01.tar.bz2", + "rb", + ).read() ) remotes = { "validation-01": download_utils.RemoteFileMetadata( filename="acousticbrainz-mediaeval-features-validation-01.tar.bz2", url=httpserver.url, - checksum='2cc101d8a6e388ff27048c0d693ae141', - destination_dir='temp', + checksum="2cc101d8a6e388ff27048c0d693ae141", + destination_dir="temp", ) } - - acousticbrainz_genre._download(data_home, remotes, None, None, False, False) + dataset = acousticbrainz_genre.Dataset(data_home) + dataset.remotes = remotes + dataset.download(data_home, False, False) assert os.path.exists(data_home) - assert os.path.exists(os.path.join(data_home, "acousticbrainz-mediaeval-validation")) - assert os.path.exists(os.path.join(data_home, "acousticbrainz-mediaeval-validation", "01")) - assert os.path.exists(os.path.join(data_home, "acousticbrainz-mediaeval-validation", "01", - "01a1a77a-f81e-49a5-9fea-7060394409ec.json")) - + assert os.path.exists( + os.path.join(data_home, "acousticbrainz-mediaeval-validation") + ) + assert os.path.exists( + os.path.join(data_home, "acousticbrainz-mediaeval-validation", "01") + ) + assert os.path.exists( + os.path.join( + data_home, + "acousticbrainz-mediaeval-validation", + "01", + "01a1a77a-f81e-49a5-9fea-7060394409ec.json", + ) + ) httpserver.serve_content( - open("tests/resources/download/acousticbrainz-mediaeval-features-train-01.tar.bz2", "rb").read() + open( + "tests/resources/download/acousticbrainz-mediaeval-features-train-01.tar.bz2", + "rb", + ).read() ) remotes = { "train-01": download_utils.RemoteFileMetadata( filename="acousticbrainz-mediaeval-features-train-01.tar.bz2", url=httpserver.url, - checksum='eb155784e1d4de0f35aa23ded4d34849', - destination_dir='temp', + checksum="eb155784e1d4de0f35aa23ded4d34849", + destination_dir="temp", ) } - - acousticbrainz_genre._download(data_home, remotes, None, None, False, False) + dataset = acousticbrainz_genre.Dataset(data_home) + dataset.remotes = remotes + dataset.download(data_home, False, False) assert os.path.exists(data_home) assert os.path.exists(os.path.join(data_home, "acousticbrainz-mediaeval-train")) - assert os.path.exists(os.path.join(data_home, "acousticbrainz-mediaeval-train", "01")) - assert os.path.exists(os.path.join(data_home, "acousticbrainz-mediaeval-train", "01", - "01a0a332-d340-4806-a88b-cb60a05355c0.json")) + assert os.path.exists( + os.path.join(data_home, "acousticbrainz-mediaeval-train", "01") + ) + assert os.path.exists( + os.path.join( + data_home, + "acousticbrainz-mediaeval-train", + "01", + "01a0a332-d340-4806-a88b-cb60a05355c0.json", + ) + ) shutil.rmtree(data_home) - - - - diff --git a/tests/test_annotations.py b/tests/test_annotations.py index fc55630e0..4e7a26ebb 100644 --- a/tests/test_annotations.py +++ b/tests/test_annotations.py @@ -193,27 +193,27 @@ def test_validate_array_like(): def test_validate_lengths_equal(): - annotations.validate_lengths_equal([np.array([0,1])]) + annotations.validate_lengths_equal([np.array([0, 1])]) annotations.validate_lengths_equal([np.array([]), None]) with pytest.raises(ValueError): - annotations.validate_lengths_equal([np.array([0,1]), np.array([0])]) + annotations.validate_lengths_equal([np.array([0, 1]), np.array([0])]) def test_validate_confidence(): annotations.validate_confidence(None) with pytest.raises(ValueError): - annotations.validate_confidence(np.array([[0,1], [0,2]])) + annotations.validate_confidence(np.array([[0, 1], [0, 2]])) with pytest.raises(ValueError): - annotations.validate_confidence(np.array([0,2])) + annotations.validate_confidence(np.array([0, 2])) def test_validate_times(): annotations.validate_times(None) with pytest.raises(ValueError): - annotations.validate_times(np.array([[0,1], [0,2]])) + annotations.validate_times(np.array([[0, 1], [0, 2]])) with pytest.raises(ValueError): annotations.validate_times(np.array([2, 0])) @@ -223,10 +223,10 @@ def test_validate_intervals(): annotations.validate_intervals(None) with pytest.raises(ValueError): - annotations.validate_intervals(np.array([0,2])) + annotations.validate_intervals(np.array([0, 2])) with pytest.raises(ValueError): - annotations.validate_intervals(np.array([0,-2])) + annotations.validate_intervals(np.array([0, -2])) with pytest.raises(ValueError): annotations.validate_intervals(np.array([[0, 1], [1, 0.5]])) diff --git a/tests/test_beatles.py b/tests/test_beatles.py index 972570f63..bffe95857 100644 --- a/tests/test_beatles.py +++ b/tests/test_beatles.py @@ -158,7 +158,6 @@ def test_load_beats(): ) beat_data = beatles.load_beats(beats_path) - assert ( type(beat_data) == annotations.BeatData ), "beat_data is not type annotations.BeatData" diff --git a/tests/test_beatport_key.py b/tests/test_beatport_key.py index ecd7fa95a..0b8810a25 100644 --- a/tests/test_beatport_key.py +++ b/tests/test_beatport_key.py @@ -88,7 +88,8 @@ def test_find_replace(): "tests/resources/mir_datasets/beatport_key/find_replace.json", "w" ) as the_file: the_file.write('{"probando": nan}') - beatport_key.find_replace( + dataset = beatport_key.Dataset() + dataset._find_replace( "tests/resources/mir_datasets/beatport_key", ": nan", ": null", "*.json" ) f = open("tests/resources/mir_datasets/beatport_key/find_replace.json", "r") diff --git a/tests/test_core.py b/tests/test_core.py index 48989bd8d..a9ebc2fd9 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -59,13 +59,13 @@ def no_doc(self): def test_dataset(): - dataset = mirdata.Dataset("guitarset") + dataset = mirdata.initialize("guitarset") assert isinstance(dataset, core.Dataset) - dataset = mirdata.Dataset("rwc_jazz") + dataset = mirdata.initialize("rwc_jazz") assert isinstance(dataset, core.Dataset) - dataset = mirdata.Dataset("ikala") + dataset = mirdata.initialize("ikala") assert isinstance(dataset, core.Dataset) print(dataset) # test that repr doesn't fail @@ -73,9 +73,9 @@ def test_dataset(): def test_dataset_errors(): with pytest.raises(ValueError): - core.Dataset("not_a_dataset") + mirdata.initialize("not_a_dataset") - d = core.Dataset("orchset") + d = mirdata.initialize("orchset") d._track_object = None with pytest.raises(NotImplementedError): d.track("asdf") diff --git a/tests/test_full_dataset.py b/tests/test_full_dataset.py index ba32f3057..05adc145d 100644 --- a/tests/test_full_dataset.py +++ b/tests/test_full_dataset.py @@ -18,7 +18,7 @@ def dataset(test_dataset): elif test_dataset not in mirdata.DATASETS: raise ValueError("{} is not a dataset in mirdata".format(test_dataset)) data_home = os.path.join("tests/resources/mir_datasets_full", test_dataset) - return mirdata.Dataset(test_dataset, data_home) + return mirdata.initialize(test_dataset, data_home) # This is magically skipped by the the remote fixture `skip_remote` in conftest.py diff --git a/tests/test_groove_midi.py b/tests/test_groove_midi.py index 9558826d0..9a24f8522 100644 --- a/tests/test_groove_midi.py +++ b/tests/test_groove_midi.py @@ -110,7 +110,9 @@ def test_download(httpserver): destination_dir=None, ) } - groove_midi._download(data_home, remotes, None, None, False, False) + dataset = groove_midi.Dataset(data_home) + dataset.remotes = remotes + dataset.download(None, False, False) assert os.path.exists(data_home) assert not os.path.exists(os.path.join(data_home, "groove")) diff --git a/tests/test_loaders.py b/tests/test_loaders.py index 5f34a8d4b..853e960e6 100644 --- a/tests/test_loaders.py +++ b/tests/test_loaders.py @@ -11,7 +11,7 @@ import mirdata -from mirdata import core, download_utils, utils +from mirdata import core, download_utils from tests.test_utils import DEFAULT_DATA_HOME DATASETS = mirdata.DATASETS @@ -45,7 +45,7 @@ } -def create_remote_dataset(httpserver, dataset_name, data_home=None): +def create_remote_index(httpserver, dataset_name): httpserver.serve_content( open(REMOTE_DATASETS[dataset_name]["local_index"], "rb").read() ) @@ -57,10 +57,10 @@ def create_remote_dataset(httpserver, dataset_name, data_home=None): destination_dir="", ) } - data_remote = utils.LargeData( + data_remote = core.LargeData( REMOTE_DATASETS[dataset_name]["filename"], remote_index=remote_index ) - return mirdata.Dataset(dataset_name, index=data_remote.index, data_home=data_home) + return data_remote.index def clean_remote_dataset(dataset_name): @@ -73,10 +73,12 @@ def clean_remote_dataset(dataset_name): def test_dataset_attributes(httpserver): for dataset_name in DATASETS: + module = importlib.import_module("mirdata.datasets.{}".format(dataset_name)) if dataset_name not in REMOTE_DATASETS: - dataset = mirdata.Dataset(dataset_name) + dataset = module.Dataset() else: - dataset = create_remote_dataset(httpserver, dataset_name) + remote_index = create_remote_index(httpserver, dataset_name) + dataset = module.Dataset(index=remote_index) assert ( dataset.name == dataset_name @@ -85,7 +87,7 @@ def test_dataset_attributes(httpserver): dataset.bibtex is not None ), "No BIBTEX information provided for {}".format(dataset_name) assert ( - isinstance(dataset._remotes, dict) or dataset._remotes is None + isinstance(dataset.remotes, dict) or dataset.remotes is None ), "{}.REMOTES must be a dictionary".format(dataset_name) assert isinstance(dataset._index, dict), "{}.DATA is not properly set".format( dataset_name @@ -96,50 +98,23 @@ def test_dataset_attributes(httpserver): assert type(dataset._track_object) == type( core.Track ), "{}.Track must be an instance of core.Track".format(dataset_name) - assert callable(dataset._download_fn), "{}._download is not a function".format( + assert callable(dataset.download), "{}.download is not a function".format( dataset_name ) - assert dataset.readme != "", "{} has no module readme".format(dataset_name) if dataset_name in REMOTE_DATASETS: clean_remote_dataset(dataset_name) -def test_forward_compatibility(): - for dataset_name in DATASETS: - dataset_module = importlib.import_module( - "mirdata.datasets.{}".format(dataset_name) - ) - assert not hasattr( - dataset_module, "validate" - ), "{}: loaders no longer need validate methods".format(dataset_name) - assert not hasattr(dataset_module, "download"), ( - "{}: loaders no longer need download methods. " - + "If you want to specify a custom download function, call it _download" - ).format(dataset_name) - assert not hasattr( - dataset_module, "track_ids" - ), "{}: loaders no longer need track_ids methods".format(dataset_name) - assert not hasattr( - dataset_module, "load" - ), "{}: loaders no longer need load methods".format(dataset_name) - assert not hasattr( - dataset_module, "DATASET_DIR" - ), "{}: loaders no longer need to define DATASET_DIR".format(dataset_name) - - if hasattr(dataset_module, "Track"): - track_params = signature(dataset_module.Track).parameters - assert ( - track_params["data_home"].default == inspect._empty - ), "{}.Track should no longer take default arguments".format(dataset_name) - - def test_cite(httpserver): for dataset_name in DATASETS: + module = importlib.import_module("mirdata.datasets.{}".format(dataset_name)) if dataset_name not in REMOTE_DATASETS: - dataset = mirdata.Dataset(dataset_name) + dataset = module.Dataset() else: - dataset = create_remote_dataset(httpserver, dataset_name) + remote_index = create_remote_index(httpserver, dataset_name) + dataset = module.Dataset(index=remote_index) + text_trap = io.StringIO() sys.stdout = text_trap dataset.cite() @@ -155,21 +130,20 @@ def test_cite(httpserver): def test_download(mocker, httpserver): for dataset_name in DATASETS: print(dataset_name) + module = importlib.import_module("mirdata.datasets.{}".format(dataset_name)) if dataset_name not in REMOTE_DATASETS: - dataset = mirdata.Dataset(dataset_name) + dataset = module.Dataset() else: - dataset = create_remote_dataset(httpserver, dataset_name) + remote_index = create_remote_index(httpserver, dataset_name) + dataset = module.Dataset(index=remote_index) # test parameters & defaults - assert callable(dataset._download_fn), "{}.download is not callable".format( + assert callable(dataset.download), "{}.download is not callable".format( dataset_name ) - params = signature(dataset._download_fn).parameters + params = signature(dataset.download).parameters expected_params = [ - "save_dir", - "remotes", "partial_download", - "info_message", "force_overwrite", "cleanup", ] @@ -178,8 +152,8 @@ def test_download(mocker, httpserver): ), "{}.download must have parameters {}".format(dataset_name, expected_params) # check that the download method can be called without errors - if dataset._remotes != {}: - mock_downloader = mocker.patch.object(dataset, "_remotes") + if dataset.remotes != {}: + mock_downloader = mocker.patch.object(dataset, "remotes") if dataset_name not in DOWNLOAD_EXCEPTIONS: try: dataset.download() @@ -189,12 +163,12 @@ def test_download(mocker, httpserver): mocker.resetall() # check that links are online - for key in dataset._remotes: + for key in dataset.remotes: # skip this test if it's in known issues if dataset_name in KNOWN_ISSUES and key in KNOWN_ISSUES[dataset_name]: continue - url = dataset._remotes[key].url + url = dataset.remotes[key].url try: request = requests.head(url) assert request.ok, "Link {} for {} does not return OK".format( @@ -217,151 +191,174 @@ def test_download(mocker, httpserver): # This is magically skipped by the the remote fixture `skip_local` in conftest.py # when tests are run with the --local flag -def test_validate(skip_local): +def test_validate(skip_local, httpserver): for dataset_name in DATASETS: + data_home = os.path.join("tests/resources/mir_datasets", dataset_name) + + module = importlib.import_module("mirdata.datasets.{}".format(dataset_name)) if dataset_name not in REMOTE_DATASETS: - data_home = os.path.join("tests/resources/mir_datasets", dataset_name) - dataset = mirdata.Dataset(dataset_name, data_home=data_home) - try: - dataset.validate() - except: - assert False, "{}: {}".format(dataset_name, sys.exc_info()[0]) + dataset = module.Dataset(data_home) + dataset_default = module.Dataset(data_home=None) + else: + remote_index = create_remote_index(httpserver, dataset_name) + dataset = module.Dataset(data_home, index=remote_index) + dataset_default = module.Dataset(data_home=None, index=remote_index) - try: - dataset.validate(verbose=False) - except: - assert False, "{}: {}".format(dataset_name, sys.exc_info()[0]) + try: + dataset.validate() + except: + assert False, "{}: {}".format(dataset_name, sys.exc_info()[0]) - dataset_default = mirdata.Dataset(dataset_name, data_home=None) - try: - dataset_default.validate(verbose=False) - except: - assert False, "{}: {}".format(dataset_name, sys.exc_info()[0]) + try: + dataset.validate(verbose=False) + except: + assert False, "{}: {}".format(dataset_name, sys.exc_info()[0]) + + try: + dataset_default.validate(verbose=False) + except: + assert False, "{}: {}".format(dataset_name, sys.exc_info()[0]) def test_load_and_trackids(httpserver): for dataset_name in DATASETS: data_home = os.path.join("tests/resources/mir_datasets", dataset_name) + module = importlib.import_module("mirdata.datasets.{}".format(dataset_name)) if dataset_name not in REMOTE_DATASETS: - dataset = mirdata.Dataset(dataset_name, data_home=data_home) - dataset_default = mirdata.Dataset(dataset_name, data_home=None) + dataset = module.Dataset(data_home) + dataset_default = module.Dataset() + else: + continue + # TODO - fix the dataset object to work with remote index + # remote_index = create_remote_index(httpserver, dataset_name) + # dataset = module.Dataset(data_home, index=remote_index) + # dataset_default = module.Dataset(index=remote_index) + + try: + track_ids = dataset.track_ids + except: + assert False, "{}: {}".format(dataset_name, sys.exc_info()[0]) + assert type(track_ids) is list, "{}.track_ids() should return a list".format( + dataset_name + ) + trackid_len = len(track_ids) + # if the dataset has tracks, test the loaders + if dataset._track_object is not None: + try: - track_ids = dataset.track_ids + choice_track = dataset.choice_track() except: assert False, "{}: {}".format(dataset_name, sys.exc_info()[0]) - assert ( - type(track_ids) is list - ), "{}.track_ids() should return a list".format(dataset_name) - trackid_len = len(track_ids) - # if the dataset has tracks, test the loaders - if dataset._track_object is not None: - - try: - choice_track = dataset.choice_track() - except: - assert False, "{}: {}".format(dataset_name, sys.exc_info()[0]) - assert isinstance( - choice_track, core.Track - ), "{}.choice_track must return an instance of type core.Track".format( - dataset_name - ) + assert isinstance( + choice_track, core.Track + ), "{}.choice_track must return an instance of type core.Track".format( + dataset_name + ) - try: - dataset_data = dataset.load_tracks() - except: - assert False, "{}: {}".format(dataset_name, sys.exc_info()[0]) + try: + dataset_data = dataset.load_tracks() + except: + assert False, "{}: {}".format(dataset_name, sys.exc_info()[0]) - assert ( - type(dataset_data) is dict - ), "{}.load should return a dictionary".format(dataset_name) - assert ( - len(dataset_data.keys()) == trackid_len - ), "the dictionary returned {}.load() does not have the same number of elements as {}.track_ids()".format( - dataset_name, dataset_name - ) + assert ( + type(dataset_data) is dict + ), "{}.load should return a dictionary".format(dataset_name) + assert ( + len(dataset_data.keys()) == trackid_len + ), "the dictionary returned {}.load() does not have the same number of elements as {}.track_ids()".format( + dataset_name, dataset_name + ) - try: - dataset_data_default = dataset_default.load_tracks() - except: - assert False, "{}: {}".format(dataset_name, sys.exc_info()[0]) + try: + dataset_data_default = dataset_default.load_tracks() + except: + assert False, "{}: {}".format(dataset_name, sys.exc_info()[0]) - assert ( - type(dataset_data_default) is dict - ), "{}.load should return a dictionary".format(dataset_name) - assert ( - len(dataset_data_default.keys()) == trackid_len - ), "the dictionary returned {}.load() does not have the same number of elements as {}.track_ids()".format( - dataset_name, dataset_name - ) - if dataset_name in REMOTE_DATASETS: - clean_remote_dataset(dataset_name) + assert ( + type(dataset_data_default) is dict + ), "{}.load should return a dictionary".format(dataset_name) + assert ( + len(dataset_data_default.keys()) == trackid_len + ), "the dictionary returned {}.load() does not have the same number of elements as {}.track_ids()".format( + dataset_name, dataset_name + ) + if dataset_name in REMOTE_DATASETS: + clean_remote_dataset(dataset_name) -def test_track(): +def test_track(httpserver): data_home_dir = "tests/resources/mir_datasets" for dataset_name in DATASETS: + data_home = os.path.join(data_home_dir, dataset_name) + + module = importlib.import_module("mirdata.datasets.{}".format(dataset_name)) if dataset_name not in REMOTE_DATASETS: - data_home = os.path.join(data_home_dir, dataset_name) - dataset = mirdata.Dataset(dataset_name, data_home=data_home) - dataset_default = mirdata.Dataset(dataset_name, data_home=None) - - # if the dataset doesn't have a track object, make sure it raises a value error - # and move on to the next dataset - if dataset._track_object is None: - with pytest.raises(NotImplementedError): - dataset.track("~faketrackid~?!") - continue + dataset = module.Dataset(data_home) + dataset_default = module.Dataset() + else: + continue + # TODO - fix the dataset object to work with remote index + # remote_index = create_remote_index(httpserver, dataset_name) + # dataset = module.Dataset(data_home, index=remote_index) + # dataset_default = module.Dataset(index=remote_index) + + # if the dataset doesn't have a track object, make sure it raises a value error + # and move on to the next dataset + if dataset._track_object is None: + with pytest.raises(NotImplementedError): + dataset.track("~faketrackid~?!") + continue - if dataset_name in CUSTOM_TEST_TRACKS: - trackid = CUSTOM_TEST_TRACKS[dataset_name] - else: - trackid = dataset.track_ids[0] + if dataset_name in CUSTOM_TEST_TRACKS: + trackid = CUSTOM_TEST_TRACKS[dataset_name] + else: + trackid = dataset.track_ids[0] - try: - track_default = dataset_default.track(trackid) - except: - assert False, "{}: {}".format(dataset_name, sys.exc_info()[0]) + try: + track_default = dataset_default.track(trackid) + except: + assert False, "{}: {}".format(dataset_name, sys.exc_info()[0]) - assert track_default._data_home == os.path.join( - DEFAULT_DATA_HOME, dataset.name - ), "{}: Track._data_home path is not set as expected".format(dataset_name) + assert track_default._data_home == os.path.join( + DEFAULT_DATA_HOME, dataset.name + ), "{}: Track._data_home path is not set as expected".format(dataset_name) - # test data home specified - try: - track_test = dataset.track(trackid) - except: - assert False, "{}: {}".format(dataset_name, sys.exc_info()[0]) + # test data home specified + try: + track_test = dataset.track(trackid) + except: + assert False, "{}: {}".format(dataset_name, sys.exc_info()[0]) - assert isinstance( - track_test, core.Track - ), "{}.track must be an instance of type core.Track".format(dataset_name) + assert isinstance( + track_test, core.Track + ), "{}.track must be an instance of type core.Track".format(dataset_name) - assert hasattr( - track_test, "to_jams" - ), "{}.track must have a to_jams method".format(dataset_name) + assert hasattr( + track_test, "to_jams" + ), "{}.track must have a to_jams method".format(dataset_name) - # Validate JSON schema - try: - jam = track_test.to_jams() - except: - assert False, "{}: {}".format(dataset_name, sys.exc_info()[0]) + # Validate JSON schema + try: + jam = track_test.to_jams() + except: + assert False, "{}: {}".format(dataset_name, sys.exc_info()[0]) - assert jam.validate(), "Jams validation failed for {}.track({})".format( - dataset_name, trackid - ) + assert jam.validate(), "Jams validation failed for {}.track({})".format( + dataset_name, trackid + ) - # will fail if something goes wrong with __repr__ - try: - text_trap = io.StringIO() - sys.stdout = text_trap - print(track_test) - sys.stdout = sys.__stdout__ - except: - assert False, "{}: {}".format(dataset_name, sys.exc_info()[0]) + # will fail if something goes wrong with __repr__ + try: + text_trap = io.StringIO() + sys.stdout = text_trap + print(track_test) + sys.stdout = sys.__stdout__ + except: + assert False, "{}: {}".format(dataset_name, sys.exc_info()[0]) - with pytest.raises(ValueError): - dataset.track("~faketrackid~?!") + with pytest.raises(ValueError): + dataset.track("~faketrackid~?!") # for load_* functions which require more than one argument @@ -370,47 +367,68 @@ def test_track(): "dali": {"load_annotations_granularity": {"granularity": "notes"}}, "guitarset": { "load_pitch_contour": {"string_num": 1}, - "load_note_ann": {"string_num": 1}, + "load_notes": {"string_num": 1}, }, "saraga": { "load_tempo": {"iam_style": "carnatic"}, "load_sections": {"iam_style": "carnatic"}, }, } +SKIP = { + "acousticbrainz_genre": [ + "load_all_train", + "load_all_validation", + "load_tagtraum_validation", + "load_tagtraum_train", + "load_allmusic_train", + "load_allmusic_validation", + "load_lastfm_train", + "load_lastfm_validation", + "load_discogs_train", + "load_discogs_validation", + ] +} -def test_load_methods(): +def test_load_methods(httpserver): for dataset_name in DATASETS: + module = importlib.import_module("mirdata.datasets.{}".format(dataset_name)) if dataset_name not in REMOTE_DATASETS: - dataset = mirdata.Dataset(dataset_name) - all_methods = dir(dataset) - load_methods = [ - getattr(dataset, m) for m in all_methods if m.startswith("load_") - ] - for load_method in load_methods: - method_name = load_method.__name__ - - # skip default methods - if method_name == "load_tracks": - continue - params = [ - p - for p in signature(load_method).parameters.values() - if p.default == inspect._empty - ] # get list of parameters that don't have defaults - - # add to the EXCEPTIONS dictionary above if your load_* function needs - # more than one argument. - if ( - dataset_name in EXCEPTIONS - and method_name in EXCEPTIONS[dataset_name] - ): - extra_params = EXCEPTIONS[dataset_name][method_name] - with pytest.raises(IOError): - load_method("a/fake/filepath", **extra_params) - else: - with pytest.raises(IOError): - load_method("a/fake/filepath") + dataset = module.Dataset() + else: + remote_index = create_remote_index(httpserver, dataset_name) + dataset = module.Dataset(index=remote_index) + + all_methods = dir(dataset) + load_methods = [ + getattr(dataset, m) for m in all_methods if m.startswith("load_") + ] + for load_method in load_methods: + method_name = load_method.__name__ + + # skip default methods + if method_name == "load_tracks": + continue + + # skip overrides, add to the SKIP dictionary to skip a specific load method + if dataset_name in SKIP and method_name in SKIP[dataset_name]: + continue + + params = [ + p + for p in signature(load_method).parameters.values() + if p.default == inspect._empty + ] # get list of parameters that don't have defaults + + # add to the EXCEPTIONS dictionary above if your load_* function needs + # more than one argument. + if dataset_name in EXCEPTIONS and method_name in EXCEPTIONS[dataset_name]: + extra_params = EXCEPTIONS[dataset_name][method_name] + with pytest.raises(IOError): + load_method("a/fake/filepath", **extra_params) + else: + with pytest.raises(IOError): + load_method("a/fake/filepath") CUSTOM_TEST_MTRACKS = {} @@ -421,10 +439,12 @@ def test_multitracks(httpserver): for dataset_name in DATASETS: + module = importlib.import_module("mirdata.datasets.{}".format(dataset_name)) if dataset_name not in REMOTE_DATASETS: - dataset = mirdata.Dataset(dataset_name) + dataset = module.Dataset() else: - dataset = create_remote_dataset(httpserver, dataset_name) + remote_index = create_remote_index(httpserver, dataset_name) + dataset = module.Dataset(index=remote_index) # TODO this is currently an opt-in test. Make it an opt out test # once #265 is addressed @@ -441,7 +461,7 @@ def test_multitracks(httpserver): # test data home specified data_home = os.path.join(data_home_dir, dataset_name) - dataset_specific = mirdata.Dataset(dataset_name, data_home=data_home) + dataset_specific = mirdata.initialize(dataset_name, data_home=data_home) try: mtrack_test = dataset_specific.MultiTrack(mtrack_id, data_home=data_home) except: diff --git a/tests/test_maestro.py b/tests/test_maestro.py index 155dff6ea..f38fd0b68 100644 --- a/tests/test_maestro.py +++ b/tests/test_maestro.py @@ -123,28 +123,30 @@ def test_download_partial(httpserver): destination_dir="maestro-v2.0.0", ), } - maestro._download(data_home, remotes, None, None, False, False) + dataset = maestro.Dataset(data_home) + dataset.remotes = remotes + dataset.download(None, False, False) assert os.path.exists(os.path.join(data_home, "1-maestro-v2.0.0.json")) assert not os.path.exists(os.path.join(data_home, "2-maestro-v2.0.0.json")) assert not os.path.exists(os.path.join(data_home, "3-maestro-v2.0.0.json")) if os.path.exists(data_home): shutil.rmtree(data_home) - maestro._download(data_home, remotes, ["all", "midi"], None, False, False) + dataset.download(["all", "midi"], False, False) assert os.path.exists(os.path.join(data_home, "1-maestro-v2.0.0.json")) assert not os.path.exists(os.path.join(data_home, "2-maestro-v2.0.0.json")) assert not os.path.exists(os.path.join(data_home, "3-maestro-v2.0.0.json")) if os.path.exists(data_home): shutil.rmtree(data_home) - maestro._download(data_home, remotes, ["metadata", "midi"], None, False, False) + dataset.download(["metadata", "midi"], False, False) assert not os.path.exists(os.path.join(data_home, "1-maestro-v2.0.0.json")) assert os.path.exists(os.path.join(data_home, "2-maestro-v2.0.0.json")) assert not os.path.exists(os.path.join(data_home, "3-maestro-v2.0.0.json")) if os.path.exists(data_home): shutil.rmtree(data_home) - maestro._download(data_home, remotes, ["metadata"], None, False, False) + dataset.download(["metadata"], False, False) assert not os.path.exists(os.path.join(data_home, "1-maestro-v2.0.0.json")) assert not os.path.exists(os.path.join(data_home, "2-maestro-v2.0.0.json")) assert os.path.exists(os.path.join(data_home, "3-maestro-v2.0.0.json")) @@ -168,7 +170,9 @@ def test_download(httpserver): destination_dir=None, ) } - maestro._download(data_home, remotes, None, None, False, False) + dataset = maestro.Dataset(data_home) + dataset.remotes = remotes + dataset.download(None, False, False) assert os.path.exists(data_home) assert not os.path.exists(os.path.join(data_home, "maestro-v2.0.0")) @@ -203,7 +207,8 @@ def test_download(httpserver): destination_dir=None, ) } - maestro._download(data_home, remotes, ["midi"], None, False, False) + dataset.remotes = remotes + dataset.download(["midi"], False, False) assert os.path.exists(data_home) assert not os.path.exists(os.path.join(data_home, "maestro-v2.0.0")) @@ -238,7 +243,8 @@ def test_download(httpserver): destination_dir=None, ) } - maestro._download(data_home, remotes, ["metadata"], None, False, False) + dataset.remotes = remotes + dataset.download(["metadata"], False, False) assert os.path.exists(data_home) assert not os.path.exists(os.path.join(data_home, "maestro-v2.0.0")) diff --git a/tests/test_orchset.py b/tests/test_orchset.py index af26c7816..9d7582ac5 100644 --- a/tests/test_orchset.py +++ b/tests/test_orchset.py @@ -178,7 +178,9 @@ def test_download(httpserver): destination_dir=None, ) } - orchset._download(data_home, remotes, None, None, False, True) + dataset = orchset.Dataset(data_home) + dataset.remotes = remotes + dataset.download(remotes, False, True) assert os.path.exists(data_home) assert not os.path.exists(os.path.join(data_home, "Orchset")) diff --git a/tests/test_rwc_popular.py b/tests/test_rwc_popular.py index 1be3e7631..2b9b8bd95 100644 --- a/tests/test_rwc_popular.py +++ b/tests/test_rwc_popular.py @@ -144,12 +144,12 @@ def test_load_chords(): ) -def test_load_voca_inst(): +def test_load_vocal_activity(): vocinst_path = ( "tests/resources/mir_datasets/rwc_popular/" + "annotations/AIST.RWC-MDB-P-2001.VOCA_INST/RM-P001.VOCA_INST.TXT" ) - vocinst_data = rwc_popular.load_voca_inst(vocinst_path) + vocinst_data = rwc_popular.load_vocal_activity(vocinst_path) # check types assert type(vocinst_data) is annotations.EventData diff --git a/tests/test_tonality_classicaldb.py b/tests/test_tonality_classicaldb.py index 6eed3dae5..538b85460 100644 --- a/tests/test_tonality_classicaldb.py +++ b/tests/test_tonality_classicaldb.py @@ -1,12 +1,10 @@ # -*- coding: utf-8 -*- -import subprocess import sys import librosa import numpy as np from mirdata.datasets import tonality_classicaldb -from mirdata import utils from tests.test_utils import run_track_tests @@ -19,7 +17,7 @@ def test_track(): "audio_path": "tests/resources/mir_datasets/tonality_classicaldb/audio/01-Allegro__Gloria_in_excelsis_Deo_in_D_Major - D.wav", "key_path": "tests/resources/mir_datasets/tonality_classicaldb/keys/01-Allegro__Gloria_in_excelsis_Deo_in_D_Major - D.txt", "spectrum_path": "tests/resources/mir_datasets/tonality_classicaldb/spectrums/01-Allegro__Gloria_in_excelsis_Deo_in_D_Major - D.json", - "HPCP_path": "tests/resources/mir_datasets/tonality_classicaldb/HPCPs/01-Allegro__Gloria_in_excelsis_Deo_in_D_Major - D.json", + "hpcp_path": "tests/resources/mir_datasets/tonality_classicaldb/HPCPs/01-Allegro__Gloria_in_excelsis_Deo_in_D_Major - D.json", "mb_path": "tests/resources/mir_datasets/tonality_classicaldb/musicbrainz_metadata/01-Allegro__Gloria_in_excelsis_Deo_in_D_Major - D.json", "title": "01-Allegro__Gloria_in_excelsis_Deo_in_D_Major - D", "track_id": "0", @@ -28,7 +26,7 @@ def test_track(): expected_property_types = { "key": str, "spectrum": np.ndarray, - "HPCP": np.ndarray, + "hpcp": np.ndarray, "mb_metadata": dict, } run_track_tests(track, expected_attributes, expected_property_types) @@ -51,14 +49,12 @@ def test_to_jams(): ), "title does not match expected" assert "spectrum" in jam["sandbox"] - assert "HPCP" in jam["sandbox"] + assert "hpcp" in jam["sandbox"] assert "musicbrainz_metatada" in jam["sandbox"] def test_load_key(): - key_path = ( - "tests/resources/mir_datasets/tonality_classicaldb/keys/01-Allegro__Gloria_in_excelsis_Deo_in_D_Major - D.txt" - ) + key_path = "tests/resources/mir_datasets/tonality_classicaldb/keys/01-Allegro__Gloria_in_excelsis_Deo_in_D_Major - D.txt" key_data = tonality_classicaldb.load_key(key_path) assert type(key_data) == str @@ -69,18 +65,14 @@ def test_load_key(): def test_load_spectrum(): - spectrum_path = ( - "tests/resources/mir_datasets/tonality_classicaldb/spectrums/01-Allegro__Gloria_in_excelsis_Deo_in_D_Major - D.json" - ) - audio_path = ( - "tests/resources/mir_datasets/tonality_classicaldb/audio/01-Allegro__Gloria_in_excelsis_Deo_in_D_Major - D.wav" - ) + spectrum_path = "tests/resources/mir_datasets/tonality_classicaldb/spectrums/01-Allegro__Gloria_in_excelsis_Deo_in_D_Major - D.json" + audio_path = "tests/resources/mir_datasets/tonality_classicaldb/audio/01-Allegro__Gloria_in_excelsis_Deo_in_D_Major - D.wav" spectrum_data = tonality_classicaldb.load_spectrum(spectrum_path) assert type(spectrum_data) == np.ndarray y, sr = librosa.load(audio_path) - spectrum = librosa.cqt(y, sr=sr, window='blackmanharris', hop_length=4096) + spectrum = librosa.cqt(y, sr=sr, window="blackmanharris", hop_length=4096) assert spectrum.shape[0] == spectrum_data.shape[0] assert spectrum.shape[1] == spectrum_data.shape[1] @@ -90,31 +82,55 @@ def test_load_spectrum(): np.set_printoptions(threshold=sys.maxsize) -def test_load_HPCP(): - HPCP_path = ( - "tests/resources/mir_datasets/tonality_classicaldb/HPCPs/01-Allegro__Gloria_in_excelsis_Deo_in_D_Major - D.json" - ) - HPCP_data = tonality_classicaldb.load_HPCP(HPCP_path) - - assert type(HPCP_data) == np.ndarray - assert HPCP_data.shape[0] == 2865 - assert HPCP_data.shape[1] == 12 - assert isinstance(HPCP_data[0][0], float) is True - - assert tonality_classicaldb.load_HPCP(None) is None - - -mb_metadata_annotated = {'chromaprint': 'AQAEHZG4R0mMPzmO44ds4sKU0AW0E-YR4kR7uPgRhp_wHknv4uiVLWg4priUWPjh88gv_EJD7ugZHLmC4xduobeCaI9yHMqPa8jxHP4Q-sY_oDl6HLfRRngu9Hxw_B80X4MbEfGJ4jjy7JCjou2DKfJyHPuhRTtCIP9R6C_StUev4KKO4ydyaN-DhsgX6vjRPOifoD3MJ0boDcdDHA_wH79w_KhOwpNRHK_wozwaZsvxbYc75biJ88iFD13kHE2YHscx_OBzXGJyhNV0JJePXolYXA74Cz_W489R8iPMqGnQF5d3PMFl4HKCcJr2Qj1y2CkeU7hPeAvDKHCV48cz-IFPo9SLT-KEPDIS4viOH2dSlM1xXI0Ff7grhDySMyKOHyeq48d0HZd2XIqM6zF4o-aC72jMIWeOfdAS_YOOq8azVGgVfDl6EjcfmIqEn4d7nPhwnvBRLpHwYroeiD_6HTltof_RnMGTR4Rj5njSCxfe4zkYfU-x4Wl41DaO8GgueFSS43i0zAgl6Tj6Hf2RH-J1hD9O4sVwNse_odqVwd-CJKJ-5OjRH_iJ2jm8LEdOBuJx3OSQlzhcqnhjvIe_B7mHT9BsPI3R_OjRHcny43h04byC6hb64jOq6_BZ9MHfEXkUYf4gBf5jFPl0VGpg_sNzXIouUMcRURISSxpqHUd_eBKDRlR-_MfhrVkUPCKLw-dxZTHeozaHMCPDI7ly_ISvB29y_PiF80SXPCOaH8lf5Clu4ccurfhRZnjI4k2M30iKHFte9MNxKUgV6sGhqEeOHj_6wzs-_PD1IEdS4x-8ozpO5A2S7_hRwmdc9DOO5jmSiI3yI0dDLihlXMF3ojlz9McjH8qm401xDwdzNE-CI5k_ZMki_MGxl_geND_qD0eZZoT3I2ehH5F24ygPtj169Dl--OiPvEj-g-gH78eQSlxC_IFPaD-uw2eOk_iSCOHKw90shHqMH7XQfAn0TUSuHvVH-EV7XHTxD02borqCEA6Ph9CfIz1-4hem88WjDxfiw4fcLPiF60gWH6X6DP3hDz-O58Jv8Mcv-EKvIeeh68FXVF96UNehaA_CDz4e5fCNLqSF_kRzIz906sgTuJIsHMf1w0mL6_jR9vjxXHDFo0e8m9C1I3w2BT_hH_X04DtO9Bqa-viHBz2amMGPT6zQx_C5GDkDHbngj_Bxwse1Eb4m9EdOEVcg_8iP6kh3aEehBVcKPT_0XDhCIf9x8YEe3vCJ8PjxC49yXCye6-iOMIfeDHmODz-u7HjIoOnRE3cr5EGeJjFeHT2cZURYFfqFn0a-HH0cuLbxI31RHfqOnHi06OiNN8Z1BYfP40eq6NDeI-ZQG5sf1D_y5GAPPVEQpi_RC5MP80ePasxxEd6M33gX4jgx8whxHVoPU0i1cQV_7Hngm8j14As0aWeRTxbu4xRFPD56wxGP5wiVQUfeH2eP08LxKfjREz4n5MI_6If4yfjho71xHZobyvDKB8eJHD88CZfxnPhywueNHxdunvi0w-GFYzfCdDz40FBe4z3yRplQ5odPXFKK5_jRHx9-oxeN5iryBlp29Gj0GFo5nEcvpNXx4Q_O40KqHnpwCmmIvig9-MZ5vJtgK0Y9_Giqoi-Lf-jhj8cZeDxe5IkOtzl84RC1IfoLHv6x5_jxH312HH3wD7UiJKeQH3c89DmabBfQoWGUF2V3NEcOXTfyfPiOhs9RFt-GPqnw45vRG7lE6BfCZEev4RPCq4aYaim6Hvlx50P_wfmDtUWuwJHAfMeDJ4KiH7nVwDx-wxd-_IOJ8rhw3ehZOGK8Yb_xrB9eeEwSBNKRTze2wDXxo0dP-EKvI6R0qNvx6YF1aD8-ESHFvWgi-rhM1Hos7MIJzvlQHs-xo8_hiWju4Qq-fzg_XEd54cHNI_QOjYdD5Qi14tnxLSJu9Ie_4x-eaUE3LRnxBz18hDySHFfyFFcOeqjUE1N-_MelRMGjI3_x49C-EHlRScJe2biYoU-LcznxHM6p4TySKQ-i469wMcVHEk2dow-St8hRHf6COwv-wYwf_DDVHL2GHDqDPDh-5F_wQ10thFbmoEme4Mnx6AmaMUO_ID8aRk-gscTRwEV14aE-6MJ5jD8miD--4EuRHz1-nEoiXPiS48mOfDqR3MeP60Wj50G1D3Vy7DpM0LsC4-SxF7VyfEfeEIqZHnkOntOCcU-OHz_-xuipwyh74sefB6-SoaGGHpF2CkkH5pJwHj962D6eydiuwvuJl7iWC_5xFt6E2sfRJ4cRHl_x5cKhd0PPw8T7wueRC-aPXuhzuDta5Th-9GED5-jDDf3h6C-u6Md34tKOvtjz4mIKJsdFIaJ3NGoy6NKDasoFf8EtIsfhoz_G6zhIK5KEBiMXwze2I9lP5AePZ8eU3zj6FM_QIn8g5kfOFJ0T48F__MHtozn6EQ9-IY9eaMnlI8dJ9F_w4sxRq9mF5sI3M8ihBzl2NsKPj4GfHR_e40e_wz-FHu0d_DjSQ4cRojR8T8hJ6AhzHAeK9NBx5D585DsOTS9-QOOB3DgHHz-NH008JJeOWBmNNU8qjA4AAQRgHgNIoGNABKEEKUQEAQRkgghymEEACYEgUEZAAZRARhLhhLAAAGAcN4IIAyAQBBAAjIAQIU8AA0hJQiSgFEQBjBOmCgAllAgQRyAhFgBCWggaECCAIgwYoEQwwDBCFAIEGYMAghI6IAAASCiEJEOICUkBGBA5o4gxhDFKFNACiMMYIAAAIJgzCGBmACAEAWIAYIBAgAghCACAlCRCAQSKIoBJpBgiEDgBjBLGC8WYEkhQBARViAghHBIEGgGIkcQYgAQTCAkBEQBSCKQIINYYBQgABEFDAkMAAkIUAYYwJgxjBAiqjETQIGiERYod7pBwgEqLHHBQCMKEwQIxIZgEgJjDAFBNGSCIJMBZ6hSBkDhQLEEEOgEYIMRAgIk0QBlHAWBGCOKEEhQARgwxCgFCABECKSKQIkgopqwQAkHkABDIKKEgIcIZRgRUhBBCIDEMACIcUQYqIjBggEFxmBDOMCsQYwQxQIUQQAHiHBXCMLEcMhgwzZQGGAGClIhEC0gFdAAowYBhwAAiNDOQMAGIEtRCRwRxADFHgRICEGSMEkY5gZBiWhiAIOBCGO8AUIApBJABTAgtEQLCUYSUYwoRBAACxgFiCFDMAGIAQY4khoQwhAkGkDEDCAEOeEgqhYgQTBBACHBWISGEEgAAxIhSwoJBgDEOESYQchQ4BgVkCgDLGAVIiWEY4UYAQA5CgRoDJCFIGKahAYQhQSQiABAjnCOACKUBEgIJJZAxSgAAkCHGIMmYEI5I4wCBQkLhABHAIkGcsYQQRgwxgigBhCKOIQKMAMpABAAxRjkKBLRSGcGEEYAZBIADQhODBCBICEIIMoIJUCRAgghHDBNEE4GMEEgMIAACTgEgJbFEKEKkYMIYIpxhTgCFDDBIeGeQKYowx4wxABAmgCAGGUEZEcYqYQQzBBjBiABIKISIAQIQQolUSAEGgDHAIOCYEUIZB5ATRAihjDCCIGJRIcAIJIgwAggBlCAIaUYAIYKSkpgSwgQsGEPOGGAUYAYZoEgQxhEkFCFBAiEIpYJIAgAEbIgkgQFCGgMCIQooQMBlbBCRpXWeAkCYsM4IhS0FRgBiBA', 'similar_mbids': [{'artist': 'Antonio Vivaldi', 'mbid': '6d965a63-6cdb-4e49-beae-2e1247622652', 'score': 0.96163, 'title': 'Allegro: Gloria in excelsis Deo'}, {'artist': 'The John Alldis Choir; John Constable; Olga Hegedus; Rodney Slatford; English Chamber Orchestra; Vittorio Negri', 'mbid': 'd2a477fd-0061-4db2-b39c-26c87eead92f', 'score': 0.96163, 'title': 'Gloria in D, RV 589: I. Allegro "Gloria in excelsis Deo"'}, {'artist': 'Antonio Vivaldi', 'mbid': 'dc863e40-7daa-4dd0-a44c-e8f33ed07268', 'score': 0.96163, 'title': 'Gloria RV 589, I Gloria'}, {'artist': 'The John Alldis Choir; John Constable; Olga Hegedus; Rodney Slatford; English Chamber Orchestra; Vittorio Negri', 'mbid': 'd2a477fd-0061-4db2-b39c-26c87eead92f', 'score': 0.954246, 'title': 'Gloria in D, RV 589: I. Allegro "Gloria in excelsis Deo"'}]} - - -def test_load_mb_metadata(): - mb_metadata_path = ( - "tests/resources/mir_datasets/tonality_classicaldb/musicbrainz_metadata/01-Allegro__Gloria_in_excelsis_Deo_in_D_Major - D.json" - ) - mb_metadata_data = tonality_classicaldb.load_mb(mb_metadata_path) +def test_load_hpcp(): + hpcp_path = "tests/resources/mir_datasets/tonality_classicaldb/HPCPs/01-Allegro__Gloria_in_excelsis_Deo_in_D_Major - D.json" + hpcp_data = tonality_classicaldb.load_hpcp(hpcp_path) + + assert type(hpcp_data) == np.ndarray + assert hpcp_data.shape[0] == 2865 + assert hpcp_data.shape[1] == 12 + assert isinstance(hpcp_data[0][0], float) is True + + assert tonality_classicaldb.load_hpcp(None) is None + + +mb_metadata_annotated = { + "chromaprint": "AQAEHZG4R0mMPzmO44ds4sKU0AW0E-YR4kR7uPgRhp_wHknv4uiVLWg4priUWPjh88gv_EJD7ugZHLmC4xduobeCaI9yHMqPa8jxHP4Q-sY_oDl6HLfRRngu9Hxw_B80X4MbEfGJ4jjy7JCjou2DKfJyHPuhRTtCIP9R6C_StUev4KKO4ydyaN-DhsgX6vjRPOifoD3MJ0boDcdDHA_wH79w_KhOwpNRHK_wozwaZsvxbYc75biJ88iFD13kHE2YHscx_OBzXGJyhNV0JJePXolYXA74Cz_W489R8iPMqGnQF5d3PMFl4HKCcJr2Qj1y2CkeU7hPeAvDKHCV48cz-IFPo9SLT-KEPDIS4viOH2dSlM1xXI0Ff7grhDySMyKOHyeq48d0HZd2XIqM6zF4o-aC72jMIWeOfdAS_YOOq8azVGgVfDl6EjcfmIqEn4d7nPhwnvBRLpHwYroeiD_6HTltof_RnMGTR4Rj5njSCxfe4zkYfU-x4Wl41DaO8GgueFSS43i0zAgl6Tj6Hf2RH-J1hD9O4sVwNse_odqVwd-CJKJ-5OjRH_iJ2jm8LEdOBuJx3OSQlzhcqnhjvIe_B7mHT9BsPI3R_OjRHcny43h04byC6hb64jOq6_BZ9MHfEXkUYf4gBf5jFPl0VGpg_sNzXIouUMcRURISSxpqHUd_eBKDRlR-_MfhrVkUPCKLw-dxZTHeozaHMCPDI7ly_ISvB29y_PiF80SXPCOaH8lf5Clu4ccurfhRZnjI4k2M30iKHFte9MNxKUgV6sGhqEeOHj_6wzs-_PD1IEdS4x-8ozpO5A2S7_hRwmdc9DOO5jmSiI3yI0dDLihlXMF3ojlz9McjH8qm401xDwdzNE-CI5k_ZMki_MGxl_geND_qD0eZZoT3I2ehH5F24ygPtj169Dl--OiPvEj-g-gH78eQSlxC_IFPaD-uw2eOk_iSCOHKw90shHqMH7XQfAn0TUSuHvVH-EV7XHTxD02borqCEA6Ph9CfIz1-4hem88WjDxfiw4fcLPiF60gWH6X6DP3hDz-O58Jv8Mcv-EKvIeeh68FXVF96UNehaA_CDz4e5fCNLqSF_kRzIz906sgTuJIsHMf1w0mL6_jR9vjxXHDFo0e8m9C1I3w2BT_hH_X04DtO9Bqa-viHBz2amMGPT6zQx_C5GDkDHbngj_Bxwse1Eb4m9EdOEVcg_8iP6kh3aEehBVcKPT_0XDhCIf9x8YEe3vCJ8PjxC49yXCye6-iOMIfeDHmODz-u7HjIoOnRE3cr5EGeJjFeHT2cZURYFfqFn0a-HH0cuLbxI31RHfqOnHi06OiNN8Z1BYfP40eq6NDeI-ZQG5sf1D_y5GAPPVEQpi_RC5MP80ePasxxEd6M33gX4jgx8whxHVoPU0i1cQV_7Hngm8j14As0aWeRTxbu4xRFPD56wxGP5wiVQUfeH2eP08LxKfjREz4n5MI_6If4yfjho71xHZobyvDKB8eJHD88CZfxnPhywueNHxdunvi0w-GFYzfCdDz40FBe4z3yRplQ5odPXFKK5_jRHx9-oxeN5iryBlp29Gj0GFo5nEcvpNXx4Q_O40KqHnpwCmmIvig9-MZ5vJtgK0Y9_Giqoi-Lf-jhj8cZeDxe5IkOtzl84RC1IfoLHv6x5_jxH312HH3wD7UiJKeQH3c89DmabBfQoWGUF2V3NEcOXTfyfPiOhs9RFt-GPqnw45vRG7lE6BfCZEev4RPCq4aYaim6Hvlx50P_wfmDtUWuwJHAfMeDJ4KiH7nVwDx-wxd-_IOJ8rhw3ehZOGK8Yb_xrB9eeEwSBNKRTze2wDXxo0dP-EKvI6R0qNvx6YF1aD8-ESHFvWgi-rhM1Hos7MIJzvlQHs-xo8_hiWju4Qq-fzg_XEd54cHNI_QOjYdD5Qi14tnxLSJu9Ie_4x-eaUE3LRnxBz18hDySHFfyFFcOeqjUE1N-_MelRMGjI3_x49C-EHlRScJe2biYoU-LcznxHM6p4TySKQ-i469wMcVHEk2dow-St8hRHf6COwv-wYwf_DDVHL2GHDqDPDh-5F_wQ10thFbmoEme4Mnx6AmaMUO_ID8aRk-gscTRwEV14aE-6MJ5jD8miD--4EuRHz1-nEoiXPiS48mOfDqR3MeP60Wj50G1D3Vy7DpM0LsC4-SxF7VyfEfeEIqZHnkOntOCcU-OHz_-xuipwyh74sefB6-SoaGGHpF2CkkH5pJwHj962D6eydiuwvuJl7iWC_5xFt6E2sfRJ4cRHl_x5cKhd0PPw8T7wueRC-aPXuhzuDta5Th-9GED5-jDDf3h6C-u6Md34tKOvtjz4mIKJsdFIaJ3NGoy6NKDasoFf8EtIsfhoz_G6zhIK5KEBiMXwze2I9lP5AePZ8eU3zj6FM_QIn8g5kfOFJ0T48F__MHtozn6EQ9-IY9eaMnlI8dJ9F_w4sxRq9mF5sI3M8ihBzl2NsKPj4GfHR_e40e_wz-FHu0d_DjSQ4cRojR8T8hJ6AhzHAeK9NBx5D585DsOTS9-QOOB3DgHHz-NH008JJeOWBmNNU8qjA4AAQRgHgNIoGNABKEEKUQEAQRkgghymEEACYEgUEZAAZRARhLhhLAAAGAcN4IIAyAQBBAAjIAQIU8AA0hJQiSgFEQBjBOmCgAllAgQRyAhFgBCWggaECCAIgwYoEQwwDBCFAIEGYMAghI6IAAASCiEJEOICUkBGBA5o4gxhDFKFNACiMMYIAAAIJgzCGBmACAEAWIAYIBAgAghCACAlCRCAQSKIoBJpBgiEDgBjBLGC8WYEkhQBARViAghHBIEGgGIkcQYgAQTCAkBEQBSCKQIINYYBQgABEFDAkMAAkIUAYYwJgxjBAiqjETQIGiERYod7pBwgEqLHHBQCMKEwQIxIZgEgJjDAFBNGSCIJMBZ6hSBkDhQLEEEOgEYIMRAgIk0QBlHAWBGCOKEEhQARgwxCgFCABECKSKQIkgopqwQAkHkABDIKKEgIcIZRgRUhBBCIDEMACIcUQYqIjBggEFxmBDOMCsQYwQxQIUQQAHiHBXCMLEcMhgwzZQGGAGClIhEC0gFdAAowYBhwAAiNDOQMAGIEtRCRwRxADFHgRICEGSMEkY5gZBiWhiAIOBCGO8AUIApBJABTAgtEQLCUYSUYwoRBAACxgFiCFDMAGIAQY4khoQwhAkGkDEDCAEOeEgqhYgQTBBACHBWISGEEgAAxIhSwoJBgDEOESYQchQ4BgVkCgDLGAVIiWEY4UYAQA5CgRoDJCFIGKahAYQhQSQiABAjnCOACKUBEgIJJZAxSgAAkCHGIMmYEI5I4wCBQkLhABHAIkGcsYQQRgwxgigBhCKOIQKMAMpABAAxRjkKBLRSGcGEEYAZBIADQhODBCBICEIIMoIJUCRAgghHDBNEE4GMEEgMIAACTgEgJbFEKEKkYMIYIpxhTgCFDDBIeGeQKYowx4wxABAmgCAGGUEZEcYqYQQzBBjBiABIKISIAQIQQolUSAEGgDHAIOCYEUIZB5ATRAihjDCCIGJRIcAIJIgwAggBlCAIaUYAIYKSkpgSwgQsGEPOGGAUYAYZoEgQxhEkFCFBAiEIpYJIAgAEbIgkgQFCGgMCIQooQMBlbBCRpXWeAkCYsM4IhS0FRgBiBA", + "similar_mbids": [ + { + "artist": "Antonio Vivaldi", + "mbid": "6d965a63-6cdb-4e49-beae-2e1247622652", + "score": 0.96163, + "title": "Allegro: Gloria in excelsis Deo", + }, + { + "artist": "The John Alldis Choir; John Constable; Olga Hegedus; Rodney Slatford; English Chamber Orchestra; Vittorio Negri", + "mbid": "d2a477fd-0061-4db2-b39c-26c87eead92f", + "score": 0.96163, + "title": 'Gloria in D, RV 589: I. Allegro "Gloria in excelsis Deo"', + }, + { + "artist": "Antonio Vivaldi", + "mbid": "dc863e40-7daa-4dd0-a44c-e8f33ed07268", + "score": 0.96163, + "title": "Gloria RV 589, I Gloria", + }, + { + "artist": "The John Alldis Choir; John Constable; Olga Hegedus; Rodney Slatford; English Chamber Orchestra; Vittorio Negri", + "mbid": "d2a477fd-0061-4db2-b39c-26c87eead92f", + "score": 0.954246, + "title": 'Gloria in D, RV 589: I. Allegro "Gloria in excelsis Deo"', + }, + ], +} + + +def test_load_musicbrainz_metadata(): + mb_metadata_path = "tests/resources/mir_datasets/tonality_classicaldb/musicbrainz_metadata/01-Allegro__Gloria_in_excelsis_Deo_in_D_Major - D.json" + mb_metadata_data = tonality_classicaldb.load_musicbrainz(mb_metadata_path) print(mb_metadata_data) assert type(mb_metadata_data) == dict assert mb_metadata_data == mb_metadata_annotated - assert tonality_classicaldb.load_mb(None) is None + assert tonality_classicaldb.load_musicbrainz(None) is None diff --git a/tests/test_utils.py b/tests/test_utils.py index 51415617e..53ecacd07 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -6,12 +6,12 @@ import types import mirdata -from mirdata import utils, download_utils +from mirdata import core, validate, download_utils import json import pytest -from mirdata.utils import LargeData +from mirdata.core import LargeData if sys.version_info.major == 3: builtin_module_name = "builtins" @@ -45,7 +45,7 @@ def get_attributes_and_properties(class_instance): continue attr = getattr(class_instance.__class__, val) - if isinstance(attr, mirdata.utils.cached_property): + if isinstance(attr, mirdata.core.cached_property): cached_properties.append(val) elif isinstance(attr, property): properties.append(val) @@ -72,17 +72,17 @@ def get_attributes_and_properties(class_instance): @pytest.fixture def mock_validated(mocker): - return mocker.patch.object(utils, "check_validated") + return mocker.patch.object(validate, "check_validated") @pytest.fixture def mock_validator(mocker): - return mocker.patch.object(utils, "validator") + return mocker.patch.object(validate, "validator") @pytest.fixture def mock_check_index(mocker): - return mocker.patch.object(utils, "check_index") + return mocker.patch.object(validate, "check_index") def test_remote_index(httpserver): @@ -109,7 +109,6 @@ def test_remote_index(httpserver): os.remove("mirdata/datasets/indexes/acousticbrainz_genre_dataset_little_test.json") - def test_md5(mocker): audio_file = b"audio1234" @@ -119,7 +118,7 @@ def test_md5(mocker): "%s.open" % builtin_module_name, new=mocker.mock_open(read_data=audio_file) ) - md5_checksum = utils.md5("test_file_path") + md5_checksum = validate.md5("test_file_path") assert expected_checksum == md5_checksum @@ -144,7 +143,9 @@ def test_check_index(test_index, expected_missing, expected_inv_checksum): with open(index_path) as index_file: test_index = json.load(index_file) - missing_files, invalid_checksums = utils.check_index(test_index, "tests/resources/") + missing_files, invalid_checksums = validate.check_index( + test_index, "tests/resources/" + ) assert expected_missing == missing_files assert expected_inv_checksum == invalid_checksums @@ -167,7 +168,7 @@ def test_check_index(test_index, expected_missing, expected_inv_checksum): def test_validator(mocker, mock_check_index, missing_files, invalid_checksums): mock_check_index.return_value = missing_files, invalid_checksums - m, c = utils.validator("foo", "bar", False) + m, c = validate.validator("foo", "bar", False) assert m == missing_files assert c == invalid_checksums mock_check_index.assert_called_once_with("foo", "bar", False)