Add option for undivided in mir1k
@@ -124,7 +124,7 @@ def iKala(directory, check_hash=True, subset=None, shuffle=False, seed=None):
yield mixture, singing, accompaniment
-def mir1k(directory, check_hash=True, subset=None, shuffle=False, seed=None):
+def mir1k(directory, check_hash=True, subset=None, shuffle=False, seed=None, undivided=False):
"""
Generator function for the MIR-1K data set.
Args:
@@ -139,12 +139,14 @@ def mir1k(directory, check_hash=True, subset=None, shuffle=False, seed=None):
"""
top_dir_name = 'MIR-1K'
- audio_dir_name = 'Wavfile'
+ audio_dir_name = 'Wavfile' if not undivided else 'UndividedWavfile'
mir1k_hash = '33c085c1a7028199cd20317868849b413e0971022ebc4aefcf1bbc5516646c29'
audio_extension = '.wav'
all_wav_files = _data_set_setup(directory, top_dir_name, audio_dir_name,
mir1k_hash, check_hash, audio_extension)
+ all_wav_files = _subset_and_shuffle(all_wav_files, subset, shuffle, seed)
+
for f in all_wav_files:
mixture = AudioSignal(f)
singing = AudioSignal(audio_data_array=mixture.get_channel(0),
