File size: 1,856 Bytes
fb0aa71
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import os
import sys
import glob
import torch
import argparse


def download_zip_dataset(dataset_url: str, output_dir: str):
    zip_filename = os.path.basename(dataset_url)
    zip_name = zip_filename.replace(".zip", "")
    os.system(f"wget -P {output_dir} {dataset_url}")
    os.system(
        f"""unzip {os.path.join(output_dir, zip_filename)} -d {os.path.join(output_dir, zip_name)}"""
    )
    os.system(f"rm {os.path.join(output_dir, zip_filename)}")


def process_dataset(dataset_dir: str, output_dir: str):
    if dataset_dir == "VocalSet1-2":
        pass
    elif dataset_dir == "audio_mono-mic":
        pass
    elif dataset_dir == "IDMT-SMT-GUITAR_V2":
        pass
    elif dataset_dir == "IDMT-SMT-BASS":
        pass
    elif dataset_dir == "IDMT-SMT-DRUMS-V2":
        pass
    else:
        raise NotImplemented(f"Invalid dataset_dir = {dataset_dir}.")


if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument(
        "dataset_names",
        choices=[
            "vocalset",
            "guitarset",
            "idmt-smt-guitar",
            "idmt-smt-bass",
            "idmt-smt-drums",
        ],
        nargs="+",
    )
    args = parser.parse_args()

    dataset_urls = {
        "vocalset": "https://zenodo.org/record/1442513/files/VocalSet1-2.zip",
        "guitarset": "https://zenodo.org/record/3371780/files/audio_mono-mic.zip",
        "IDMT-SMT-GUITAR_V2": "https://zenodo.org/record/7544110/files/IDMT-SMT-GUITAR_V2.zip",
        "IDMT-SMT-BASS": "https://zenodo.org/record/7188892/files/IDMT-SMT-BASS.zip",
        "IDMT-SMT-DRUMS-V2": "https://zenodo.org/record/7544164/files/IDMT-SMT-DRUMS-V2.zip",
    }

    for dataset_name, dataset_url in dataset_urls.items():
        if dataset_name in args.dataset_names:
            download_zip_dataset(dataset_url, "~/data/remfx-data")