Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
from mirdata import download_utils
from mirdata import jams_utils
from mirdata import track
from mirdata import utils
# these functions are identical for all rwc datasets
from mirdata.rwc_classical import (
load_beats,
load_sections,
load_audio,
_duration_to_sec,
)
REMOTES = {
'metadata': download_utils.RemoteFileMetadata(
filename='rwc-p.csv',
url='https://github.com/magdalenafuentes/metadata/archive/master.zip',
checksum='7dbe87fedbaaa1f348625a2af1d78030',
destination_dir=None,
),
'annotations_beat': download_utils.RemoteFileMetadata(
filename='AIST.RWC-MDB-P-2001.BEAT.zip',
url='https://staff.aist.go.jp/m.goto/RWC-MDB/AIST-Annotation/AIST.RWC-MDB-P-2001.BEAT.zip',
checksum='3858aa989535bd7196b3cd07b512b5b6',
destination_dir='annotations',
),
'annotations_sections': download_utils.RemoteFileMetadata(
filename='AIST.RWC-MDB-P-2001.CHORUS.zip',
url='https://staff.aist.go.jp/m.goto/RWC-MDB/AIST-Annotation/AIST.RWC-MDB-P-2001.CHORUS.zip',
checksum='f76b3a32701fbd9bf78baa608f692a77',
destination_dir='annotations',
if data_home is None:
data_home = utils.get_default_dataset_path(DATASET_DIR)
info_message = """
To download this dataset, visit:
https://zenodo.org/record/2628782#.XKZdABNKh24
and request access.
Once downloaded, unzip the file MedleyDB-Melody.zip
and copy the result to:
{data_home}
""".format(
data_home=data_home
)
download_utils.downloader(data_home, info_message=info_message)
if data_home is None:
data_home = utils.get_default_dataset_path(DATASET_DIR)
info_message = """
Unfortunately the audio files of the Salami dataset are not available
for download. If you have the Salami dataset, place the contents into a
folder called Salami with the following structure:
> Salami/
> salami-data-public-hierarchy-corrections/
> audio/
and copy the Salami folder to {}
""".format(
data_home
)
download_utils.downloader(
data_home,
remotes=REMOTES,
info_message=info_message,
force_overwrite=force_overwrite,
cleanup=cleanup,
)
import csv
import glob
import librosa
import logging
import numpy as np
import os
import shutil
from mirdata import download_utils
from mirdata import jams_utils
from mirdata import track
from mirdata import utils
REMOTE = download_utils.RemoteFileMetadata(
filename='Orchset_dataset_0.zip',
url='https://zenodo.org/record/1289786/files/Orchset_dataset_0.zip?download=1',
checksum='cf6fe52d64624f61ee116c752fb318ca',
destination_dir=None,
)
DATASET_DIR = 'Orchset'
def _load_metadata(data_home):
predominant_inst_path = os.path.join(
data_home, 'Orchset - Predominant Melodic Instruments.csv'
)
if not os.path.exists(predominant_inst_path):
checksum='b39b78e63d3446f2e54ddb7a54df9b10',
destination_dir='annotation',
)
AUDIO_HEX_CLN_REMOTE = download_utils.RemoteFileMetadata(
filename='audio_hex-pickup_debleeded.zip',
url='https://zenodo.org/record/3371780/files/audio_hex-pickup_debleeded.zip?download=1',
checksum='c31d97279464c9a67e640cb9061fb0c6',
destination_dir='audio_hex-pickup_debleeded',
)
AUDIO_HEX_REMOTE = download_utils.RemoteFileMetadata(
filename='audio_hex-pickup_original.zip',
url='https://zenodo.org/record/3371780/files/audio_hex-pickup_original.zip?download=1',
checksum='f9911bf217cb40e9e68edf3726ef86cc',
destination_dir='audio_hex-pickup_original',
)
AUDIO_MIC_REMOTE = download_utils.RemoteFileMetadata(
filename='audio_mono-mic.zip',
url='https://zenodo.org/record/3371780/files/audio_mono-mic.zip?download=1',
checksum='275966d6610ac34999b58426beb119c3',
destination_dir='audio_mono-mic',
)
AUDIO_MIX_REMOTE = download_utils.RemoteFileMetadata(
filename='audio_mono-pickup_mix.zip',
url='https://zenodo.org/record/3371780/files/audio_mono-pickup_mix.zip?download=1',
checksum='aecce79f425a44e2055e46f680e10f6a',
destination_dir='audio_mono-pickup_mix',
)
_STYLE_DICT = {
'Jazz': 'Jazz',
'BN': 'Bossa Nova',
'Rock': 'Rock',
'SS': 'Singer-Songwriter',
def download(data_home=None):
"""Download Medley-solos-DB.
Args:
data_home (str): Local path where the dataset is stored.
If `None`, looks for the data in the default directory, `~/mir_datasets`
"""
if data_home is None:
data_home = utils.get_default_dataset_path(DATASET_DIR)
download_utils.downloader(
data_home,
tar_downloads=[AUDIO_REMOTE],
file_downloads=[ANNOTATION_REMOTE],
cleanup=True,
)
import jams
import librosa
import logging
import numpy as np
import os
from mirdata import download_utils
from mirdata import jams_utils
from mirdata import track
from mirdata import utils
DATASET_DIR = 'GuitarSet'
ANNOTATION_REMOTE = download_utils.RemoteFileMetadata(
filename='annotation.zip',
url='https://zenodo.org/record/3371780/files/annotation.zip?download=1',
checksum='b39b78e63d3446f2e54ddb7a54df9b10',
destination_dir='annotation',
)
AUDIO_HEX_CLN_REMOTE = download_utils.RemoteFileMetadata(
filename='audio_hex-pickup_debleeded.zip',
url='https://zenodo.org/record/3371780/files/audio_hex-pickup_debleeded.zip?download=1',
checksum='c31d97279464c9a67e640cb9061fb0c6',
destination_dir='audio_hex-pickup_debleeded',
)
AUDIO_HEX_REMOTE = download_utils.RemoteFileMetadata(
filename='audio_hex-pickup_original.zip',
url='https://zenodo.org/record/3371780/files/audio_hex-pickup_original.zip?download=1',
checksum='f9911bf217cb40e9e68edf3726ef86cc',
destination_dir='audio_hex-pickup_original',
import csv
import os
import librosa
import logging
import numpy as np
from mirdata import download_utils
from mirdata import jams_utils
from mirdata import track
from mirdata import utils
DATASET_DIR = 'iKala'
TIME_STEP = 0.032 # seconds
REMOTES = {
'metadata': download_utils.RemoteFileMetadata(
filename='id_mapping.txt',
url='http://mac.citi.sinica.edu.tw/ikala/id_mapping.txt',
checksum='81097b587804ce93e56c7a331ba06abc',
destination_dir=None,
)
}
def _load_metadata(data_home):
if data_home is None:
data_home = utils.get_default_dataset_path(DATASET_DIR)
id_map_path = os.path.join(data_home, 'id_mapping.txt')
if not os.path.exists(id_map_path):
logging.info(
'Metadata file {} not found.'.format(id_map_path)
import mirdata.utils as utils
import mirdata.download_utils as download_utils
import mirdata.jams_utils as jams_utils
# these functions are identical for all rwc datasets
from mirdata.rwc_classical import _load_beats, _load_sections, _duration_to_sec
METADATA_REMOTE = download_utils.RemoteFileMetadata(
filename='rwc-g.csv',
url='https://github.com/magdalenafuentes/metadata/archive/master.zip',
checksum='7dbe87fedbaaa1f348625a2af1d78030',
destination_dir=None,
)
DATASET_DIR = 'RWC-Genre'
ANNOTATIONS_REMOTE_1 = download_utils.RemoteFileMetadata(
filename='AIST.RWC-MDB-G-2001.BEAT.zip',
url='https://staff.aist.go.jp/m.goto/RWC-MDB/AIST-Annotation/AIST.RWC-MDB-G-2001.BEAT.zip',
checksum='66427ce5f4485088c6d9bc5f7394f65f',
destination_dir='annotations',
)
ANNOTATIONS_REMOTE_2 = download_utils.RemoteFileMetadata(
filename='AIST.RWC-MDB-G-2001.CHORUS.zip',
url='https://staff.aist.go.jp/m.goto/RWC-MDB/AIST-Annotation/AIST.RWC-MDB-G-2001.CHORUS.zip',
checksum='e9fe612a0ddc7a83f3c1d17fb5fec32a',
destination_dir='annotations',
)
def _load_metadata(data_home):
metadata_path = os.path.join(data_home, 'metadata-master', 'rwc-g.csv')
"""
import csv
import librosa
import logging
import numpy as np
import os
from mirdata import download_utils
from mirdata import jams_utils
from mirdata import track
from mirdata import utils
DATASET_DIR = 'Salami'
REMOTES = {
'annotations': download_utils.RemoteFileMetadata(
filename='salami-data-public-hierarchy-corrections.zip',
url='https://github.com/bmcfee/salami-data-public/archive/hierarchy-corrections.zip',
checksum='194add2601c09a7279a7433288de81fd',
destination_dir=None,
)
}
def _load_metadata(data_home):
metadata_path = os.path.join(
data_home,
os.path.join(
'salami-data-public-hierarchy-corrections', 'metadata', 'metadata.csv'
),
)