mattricesound commited on
Commit
634cc2a
1 Parent(s): a559a3b

More cleanup, edit configs

Browse files
README.md CHANGED
@@ -1,6 +1,10 @@
1
  # General Purpose Audio Effect Removal
2
- # About
3
- TBD. Add photo. Add paper link.
 
 
 
 
4
  # Setup
5
  ```
6
  git clone https://github.com/mhrice/RemFx.git
@@ -8,6 +12,7 @@ git submodule update --init --recursive
8
  pip install . umx
9
  ```
10
  # Usage
 
11
  ## Run RemFX Detect on a single file
12
  ```
13
  ./download_checkpoints.sh
@@ -21,24 +26,25 @@ unzip RemFX_eval_dataset.zip
21
 
22
  ## Download the datasets used in the paper
23
  ```
24
- python scripts/download.py vocalset guitarset idmt-smt-guitar idmt-smt-bass idmt-smt-drums
25
  ```
 
26
 
27
-
28
- ## Training
29
- Before training, it is important that you have downloaded the datasets (see above).
30
- This project uses [hydra](https://hydra.cc/) for configuration management. All experiments are defined in `cfg/exp/`. To train with an existing experiment, first run
31
  ```
32
  export DATASET_ROOT={path/to/datasets}
33
  ```
34
- Then:
 
 
 
35
  ```
36
  python scripts/train.py +exp={experiment_name}
37
  ```
38
 
39
  Here are some selected experiment types from the paper, which use different datasets and configurations. See `cfg/exp/` for a full list of experiments and parameters.
40
 
41
- | Experiment Type | config name | example |
42
  | ----------------------- | ------------ | ---------------- |
43
  | Effect-specific | {effect} | +exp=chorus |
44
  | Effect-specific + FXAug | {effect}_aug | +exp=chorus_aug |
@@ -49,6 +55,16 @@ Here are some selected experiment types from the paper, which use different data
49
  To change the configuration, simply edit the experiment file, or override the configuration on the command line. A description of some of these variables is in the Misc. section below.
50
  You can also create a custom experiment by creating a new experiment file in `cfg/exp/` and overriding the default parameters in `config.yaml`.
51
 
 
 
 
 
 
 
 
 
 
 
52
  ## Evaluate models on the General Purpose Audio Effect Removal evaluation dataset
53
  First download the dataset (see above).
54
  To use the pretrained RemFX model, download the checkpoints
@@ -70,9 +86,15 @@ Download checkpoints from [here](https://zenodo.org/record/8179396), or see the
70
 
71
 
72
  ## Generate datasets used in the paper
 
 
 
73
  ```
 
74
  ```
75
- Note that by default, files are rendered to `input_dir / processed / {string_of_effects} / {train|val|test}`.
 
 
76
 
77
  ## Evaluate with a custom directory
78
  Assumes directory is structured as
@@ -86,21 +108,27 @@ Assumes directory is structured as
86
  - file2.wav
87
  - file3.wav
88
 
89
- Change root path in `shell_vars.sh` and `source shell_vars.sh`
 
 
 
90
 
91
- `python scripts/chain_inference.py +exp=chain_inference_custom`
 
 
 
92
 
93
  # Misc.
94
  ## Experimental parameters
95
  Some relevant training parameters descriptions
96
  - `num_kept_effects={[min, max]}` range of <b> Kept </b> effects to apply to each file. Inclusive.
97
  - `num_removed_effects={[min, max]}` range of <b> Removed </b> effects to apply to each file. Inclusive.
98
- - `model={model}` architecture to use (see 'Models')
99
  - `effects_to_keep={[effect]}` Effects to apply but not remove (see 'Effects')
100
  - `effects_to_remove={[effect]}` Effects to remove (see 'Effects')
101
  - `accelerator=null/'gpu'` Use GPU (1 device) (default: null)
102
  - `render_files=True/False` Render files. Disable to skip rendering stage (default: True)
103
- - `render_root={path/to/dir}`. Root directory to render files to (default: DATASET_ROOT)
104
 
105
  ### Effect Removal Models
106
  - `umx`
@@ -121,10 +149,3 @@ Some relevant training parameters descriptions
121
  - `distortion`
122
  - `reverb`
123
  - `delay`
124
-
125
-
126
-
127
-
128
-
129
-
130
-
 
1
  # General Purpose Audio Effect Removal
2
+ Removing multiple audio effects from multiple sources using compositional audio effect removal and source separation and speech enhancement models.
3
+
4
+ This repo contains the code for the paper [General Purpose Audio Effect Removal](https://arxiv.org/abs/2110.00484). (Todo: Link broken, Add video, Add img)
5
+
6
+
7
+
8
  # Setup
9
  ```
10
  git clone https://github.com/mhrice/RemFx.git
 
12
  pip install . umx
13
  ```
14
  # Usage
15
+ This repo can be used for many different tasks. Here are some examples.
16
  ## Run RemFX Detect on a single file
17
  ```
18
  ./download_checkpoints.sh
 
26
 
27
  ## Download the datasets used in the paper
28
  ```
29
+ python scripts/download.py vocalset guitarset idmt-smt-bass idmt-smt-drums
30
  ```
31
+ By default, the datasets are downloaded to `./data/remfx-data`. To change this, pass `--output_dir={path/to/datasets}` to `download.py`
32
 
33
+ Then set the dataset root :
 
 
 
34
  ```
35
  export DATASET_ROOT={path/to/datasets}
36
  ```
37
+
38
+ ## Training
39
+ Before training, it is important that you have downloaded the datasets (see above) and set DATASET_ROOT.
40
+ This project uses the [pytorch-lightning](https://www.pytorchlightning.ai/index.html) framework and [hydra](https://hydra.cc/) for configuration management. All experiments are defined in `cfg/exp/`. To train with an existing experiment run
41
  ```
42
  python scripts/train.py +exp={experiment_name}
43
  ```
44
 
45
  Here are some selected experiment types from the paper, which use different datasets and configurations. See `cfg/exp/` for a full list of experiments and parameters.
46
 
47
+ | Experiment Type | Config Name | Example |
48
  | ----------------------- | ------------ | ---------------- |
49
  | Effect-specific | {effect} | +exp=chorus |
50
  | Effect-specific + FXAug | {effect}_aug | +exp=chorus_aug |
 
55
  To change the configuration, simply edit the experiment file, or override the configuration on the command line. A description of some of these variables is in the Misc. section below.
56
  You can also create a custom experiment by creating a new experiment file in `cfg/exp/` and overriding the default parameters in `config.yaml`.
57
 
58
+ At the end of training, the train script will automatically evaluate the test set using the best checkpoint (by validation loss). To evaluate a specific checkpoint, run
59
+
60
+ ```
61
+ python test.py +exp={experiment_name} ckpt_path={path/to/checkpoint}
62
+ ```
63
+
64
+ If you have generated the dataset separately from training, be sure to set `render_files=False` in the config or command-line, and set `render_root={path_to_dataset}` if it is in a custom location.
65
+
66
+ Also note that the training assumes you have a GPU. To train on CPU, set `accelerator=null` in the config or command-line.
67
+
68
  ## Evaluate models on the General Purpose Audio Effect Removal evaluation dataset
69
  First download the dataset (see above).
70
  To use the pretrained RemFX model, download the checkpoints
 
86
 
87
 
88
  ## Generate datasets used in the paper
89
+ Before generating datasets, it is important that you have downloaded the datasets (see above) and set DATASET_ROOT.
90
+
91
+ To generate one of the datasets used in the paper, it is as simple as running a training job with a particular config. For example, to generate the `chorus` FXAug dataset, which includes files with 5 possible effects, up to 4 kept effects (distortion, reverb, compression, delay), and 1 removed effects (chorus), run
92
  ```
93
+ python scripts/train.py +exp=chorus_aug
94
  ```
95
+
96
+ See the Misc. section below for a description of the parameters.
97
+ By default, files are rendered to `{render_root} / processed / {string_of_effects} / {train|val|test}`.
98
 
99
  ## Evaluate with a custom directory
100
  Assumes directory is structured as
 
108
  - file2.wav
109
  - file3.wav
110
 
111
+ First set the dataset root:
112
+ ```
113
+ export DATASET_ROOT={path/to/datasets}
114
+ ```
115
 
116
+ Then run
117
+ ```
118
+ python scripts/chain_inference.py +exp=chain_inference_custom
119
+ ```
120
 
121
  # Misc.
122
  ## Experimental parameters
123
  Some relevant training parameters descriptions
124
  - `num_kept_effects={[min, max]}` range of <b> Kept </b> effects to apply to each file. Inclusive.
125
  - `num_removed_effects={[min, max]}` range of <b> Removed </b> effects to apply to each file. Inclusive.
126
+ - `model={model}` architecture to use (see 'Effect Removal Models/Effect Classification Models')
127
  - `effects_to_keep={[effect]}` Effects to apply but not remove (see 'Effects')
128
  - `effects_to_remove={[effect]}` Effects to remove (see 'Effects')
129
  - `accelerator=null/'gpu'` Use GPU (1 device) (default: null)
130
  - `render_files=True/False` Render files. Disable to skip rendering stage (default: True)
131
+ - `render_root={path/to/dir}`. Root directory to render files to (default: ./data)
132
 
133
  ### Effect Removal Models
134
  - `umx`
 
149
  - `distortion`
150
  - `reverb`
151
  - `delay`
 
 
 
 
 
 
 
cfg/exp/1-1.yaml CHANGED
@@ -7,7 +7,7 @@ sample_rate: 48000
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
  render_files: True
10
- render_root: "/scratch/EffectSet"
11
  accelerator: "gpu"
12
  log_audio: True
13
  # Effects
 
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
  render_files: True
10
+
11
  accelerator: "gpu"
12
  log_audio: True
13
  # Effects
cfg/exp/2-2.yaml CHANGED
@@ -7,7 +7,7 @@ sample_rate: 48000
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
  render_files: True
10
- render_root: "/scratch/EffectSet"
11
  accelerator: "gpu"
12
  log_audio: True
13
  # Effects
 
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
  render_files: True
10
+
11
  accelerator: "gpu"
12
  log_audio: True
13
  # Effects
cfg/exp/3-3.yaml CHANGED
@@ -7,7 +7,7 @@ sample_rate: 48000
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
  render_files: True
10
- render_root: "/scratch/EffectSet"
11
  accelerator: "gpu"
12
  log_audio: True
13
  # Effects
 
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
  render_files: True
10
+
11
  accelerator: "gpu"
12
  log_audio: True
13
  # Effects
cfg/exp/4-4.yaml CHANGED
@@ -7,7 +7,7 @@ sample_rate: 48000
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
  render_files: True
10
- render_root: "/scratch/EffectSet"
11
  accelerator: "gpu"
12
  log_audio: True
13
  # Effects
 
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
  render_files: True
10
+
11
  accelerator: "gpu"
12
  log_audio: True
13
  # Effects
cfg/exp/5-1.yaml CHANGED
@@ -7,7 +7,7 @@ sample_rate: 48000
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
  render_files: True
10
- render_root: "/scratch/EffectSet"
11
  accelerator: "gpu"
12
  log_audio: True
13
  # Effects
 
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
  render_files: True
10
+
11
  accelerator: "gpu"
12
  log_audio: True
13
  # Effects
cfg/exp/5-5.yaml CHANGED
@@ -7,7 +7,7 @@ sample_rate: 48000
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
  render_files: True
10
- render_root: "/scratch/EffectSet"
11
  accelerator: "gpu"
12
  log_audio: True
13
  # Effects
 
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
  render_files: True
10
+
11
  accelerator: "gpu"
12
  log_audio: True
13
  # Effects
cfg/exp/5-5_cls.yaml CHANGED
@@ -7,7 +7,7 @@ sample_rate: 48000
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "/scratch/cjs-logs"
9
  render_files: True
10
- render_root: "/scratch/EffectSet_cjs"
11
  accelerator: "gpu"
12
  log_audio: False
13
  # Effects
 
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "/scratch/cjs-logs"
9
  render_files: True
10
+
11
  accelerator: "gpu"
12
  log_audio: False
13
  # Effects
cfg/exp/5-5_cls_dynamic.yaml CHANGED
@@ -7,7 +7,7 @@ sample_rate: 48000
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "/scratch/cjs-logs"
9
  render_files: True
10
- render_root: "/scratch/EffectSet_cjs"
11
  accelerator: "gpu"
12
  log_audio: False
13
  # Effects
 
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "/scratch/cjs-logs"
9
  render_files: True
10
+
11
  accelerator: "gpu"
12
  log_audio: False
13
  # Effects
cfg/exp/chain_inference.yaml CHANGED
@@ -6,7 +6,7 @@ seed: 12345
6
  sample_rate: 48000
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
- render_root: "/scratch/EffectSet"
10
  accelerator: "gpu"
11
  log_audio: True
12
  # Effects
 
6
  sample_rate: 48000
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
+
10
  accelerator: "gpu"
11
  log_audio: True
12
  # Effects
cfg/exp/chain_inference_aug.yaml CHANGED
@@ -6,7 +6,7 @@ seed: 12345
6
  sample_rate: 48000
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
- render_root: "/scratch/EffectSet"
10
  accelerator: "gpu"
11
  log_audio: True
12
  # Effects
 
6
  sample_rate: 48000
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
+
10
  accelerator: "gpu"
11
  log_audio: True
12
  # Effects
cfg/exp/chain_inference_aug_classifier.yaml CHANGED
@@ -6,7 +6,7 @@ seed: 12345
6
  sample_rate: 48000
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
- render_root: "/scratch/EffectSet"
10
  accelerator: "gpu"
11
  log_audio: True
12
  # Effects
 
6
  sample_rate: 48000
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
+
10
  accelerator: "gpu"
11
  log_audio: True
12
  # Effects
cfg/exp/chain_inference_custom.yaml CHANGED
@@ -6,7 +6,7 @@ seed: 12345
6
  sample_rate: 48000
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
- render_root: "/scratch/EffectSet"
10
  accelerator: "gpu"
11
  log_audio: True
12
  # Effects
 
6
  sample_rate: 48000
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
+
10
  accelerator: "gpu"
11
  log_audio: True
12
  # Effects
cfg/exp/chorus.yaml CHANGED
@@ -7,7 +7,7 @@ sample_rate: 48000
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
  render_files: True
10
- render_root: "/scratch/EffectSet"
11
  accelerator: "gpu"
12
  log_audio: True
13
  # Effects
 
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
  render_files: True
10
+
11
  accelerator: "gpu"
12
  log_audio: True
13
  # Effects
cfg/exp/chorus_aug.yaml CHANGED
@@ -7,7 +7,7 @@ sample_rate: 48000
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
  render_files: True
10
- render_root: "/scratch/EffectSet"
11
  accelerator: "gpu"
12
  log_audio: True
13
  # Effects
 
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
  render_files: True
10
+
11
  accelerator: "gpu"
12
  log_audio: True
13
  # Effects
cfg/exp/compression.yaml CHANGED
@@ -7,7 +7,7 @@ sample_rate: 48000
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
  render_files: True
10
- render_root: "/scratch/EffectSet"
11
  accelerator: "gpu"
12
  log_audio: True
13
  # Effects
 
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
  render_files: True
10
+
11
  accelerator: "gpu"
12
  log_audio: True
13
  # Effects
cfg/exp/compression_aug.yaml CHANGED
@@ -7,7 +7,7 @@ sample_rate: 48000
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
  render_files: True
10
- render_root: "/scratch/EffectSet"
11
  accelerator: "gpu"
12
  log_audio: True
13
  # Effects
 
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
  render_files: True
10
+
11
  accelerator: "gpu"
12
  log_audio: True
13
  # Effects
cfg/exp/delay.yaml CHANGED
@@ -7,7 +7,7 @@ sample_rate: 48000
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
  render_files: True
10
- render_root: "/scratch/EffectSet"
11
  accelerator: "gpu"
12
  log_audio: True
13
  # Effects
 
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
  render_files: True
10
+
11
  accelerator: "gpu"
12
  log_audio: True
13
  # Effects
cfg/exp/delay_aug.yaml CHANGED
@@ -7,7 +7,7 @@ sample_rate: 48000
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
  render_files: True
10
- render_root: "/scratch/EffectSet"
11
  accelerator: "gpu"
12
  log_audio: True
13
  # Effects
 
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
  render_files: True
10
+
11
  accelerator: "gpu"
12
  log_audio: True
13
  # Effects
cfg/exp/distortion.yaml CHANGED
@@ -7,7 +7,7 @@ sample_rate: 48000
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
  render_files: True
10
- render_root: "/scratch/EffectSet"
11
  accelerator: "gpu"
12
  log_audio: True
13
  # Effects
 
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
  render_files: True
10
+
11
  accelerator: "gpu"
12
  log_audio: True
13
  # Effects
cfg/exp/distortion_aug.yaml CHANGED
@@ -7,7 +7,7 @@ sample_rate: 48000
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
  render_files: True
10
- render_root: "/scratch/EffectSet"
11
  accelerator: "gpu"
12
  log_audio: True
13
  # Effects
 
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
  render_files: True
10
+
11
  accelerator: "gpu"
12
  log_audio: True
13
  # Effects
cfg/exp/reverb.yaml CHANGED
@@ -7,7 +7,7 @@ sample_rate: 48000
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
  render_files: True
10
- render_root: "/scratch/EffectSet"
11
  accelerator: "gpu"
12
  log_audio: True
13
  # Effects
 
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
  render_files: True
10
+
11
  accelerator: "gpu"
12
  log_audio: True
13
  # Effects
cfg/exp/reverb_aug.yaml CHANGED
@@ -7,7 +7,7 @@ sample_rate: 48000
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
  render_files: True
10
- render_root: "/scratch/EffectSet"
11
  accelerator: "gpu"
12
  log_audio: True
13
  # Effects
 
7
  chunk_size: 262144 # 5.5s
8
  logs_dir: "./logs"
9
  render_files: True
10
+
11
  accelerator: "gpu"
12
  log_audio: True
13
  # Effects
remfx/datasets.py CHANGED
@@ -44,16 +44,6 @@ vocalset_splits = {
44
  }
45
 
46
  guitarset_splits = {"train": ["00", "01", "02", "03"], "val": ["04"], "test": ["05"]}
47
- idmt_guitar_splits = {
48
- "train": ["classical", "country_folk", "jazz", "latin", "metal", "pop"],
49
- "val": ["reggae", "ska"],
50
- "test": ["rock", "blues"],
51
- }
52
- idmt_bass_splits = {
53
- "train": ["BE", "BEQ"],
54
- "val": ["VIF"],
55
- "test": ["VIS"],
56
- }
57
  dsd_100_splits = {
58
  "train": ["train"],
59
  "val": ["val"],
@@ -92,36 +82,6 @@ def locate_files(root: str, mode: str):
92
  ]
93
  print(f"Found {len(files)} files in GuitarSet {mode}.")
94
  file_list.append(sorted(files))
95
- # # ------------------------- IDMT-SMT-GUITAR -------------------------
96
- # idmt_smt_guitar_dir = os.path.join(root, "IDMT-SMT-GUITAR_V2")
97
- # if os.path.isdir(idmt_smt_guitar_dir):
98
- # files = glob.glob(
99
- # os.path.join(
100
- # idmt_smt_guitar_dir, "IDMT-SMT-GUITAR_V2", "dataset4", "**", "*.wav"
101
- # ),
102
- # recursive=True,
103
- # )
104
- # files = [
105
- # f
106
- # for f in files
107
- # if os.path.basename(f).split("_")[0] in idmt_guitar_splits[mode]
108
- # ]
109
- # file_list.append(sorted(files))
110
- # print(f"Found {len(files)} files in IDMT-SMT-Guitar {mode}.")
111
- # ------------------------- IDMT-SMT-BASS -------------------------
112
- # idmt_smt_bass_dir = os.path.join(root, "IDMT-SMT-BASS")
113
- # if os.path.isdir(idmt_smt_bass_dir):
114
- # files = glob.glob(
115
- # os.path.join(idmt_smt_bass_dir, "**", "*.wav"),
116
- # recursive=True,
117
- # )
118
- # files = [
119
- # f
120
- # for f in files
121
- # if os.path.basename(os.path.dirname(f)) in idmt_bass_splits[mode]
122
- # ]
123
- # file_list.append(sorted(files))
124
- # print(f"Found {len(files)} files in IDMT-SMT-Bass {mode}.")
125
  # ------------------------- DSD100 ---------------------------------
126
  dsd_100_dir = os.path.join(root, "DSD100")
127
  if os.path.isdir(dsd_100_dir):
 
44
  }
45
 
46
  guitarset_splits = {"train": ["00", "01", "02", "03"], "val": ["04"], "test": ["05"]}
 
 
 
 
 
 
 
 
 
 
47
  dsd_100_splits = {
48
  "train": ["train"],
49
  "val": ["val"],
 
82
  ]
83
  print(f"Found {len(files)} files in GuitarSet {mode}.")
84
  file_list.append(sorted(files))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  # ------------------------- DSD100 ---------------------------------
86
  dsd_100_dir = os.path.join(root, "DSD100")
87
  if os.path.isdir(dsd_100_dir):
remfx/models.py CHANGED
@@ -9,11 +9,9 @@ from auraloss.time import SISDRLoss
9
  from auraloss.freq import MultiResolutionSTFTLoss
10
  from umx.openunmix.model import OpenUnmix, Separator
11
 
12
- from remfx.utils import FADLoss, spectrogram
13
  from remfx.tcn import TCN
14
  from remfx.utils import causal_crop
15
- from remfx.callbacks import log_wandb_audio_batch
16
- from einops import rearrange
17
  from remfx import effects
18
  import asteroid
19
  import random
@@ -148,13 +146,14 @@ class RemFXChainInference(pl.LightningModule):
148
  )
149
  # print(f"Input_{metric}", negate * self.metrics[metric](x, y))
150
  # print(f"test_{metric}", negate * self.metrics[metric](output, y))
151
- self.output_str += f"{negate * self.metrics[metric](x, y).item():.4f},{negate * self.metrics[metric](output, y).item():.4f},"
152
- self.output_str += "\n"
153
  return loss
154
 
155
  def on_test_end(self) -> None:
156
- with open("output.csv", "w") as f:
157
- f.write(self.output_str)
 
158
 
159
  def sample(self, batch):
160
  return self.forward(batch, 0)[1]
@@ -266,13 +265,14 @@ class RemFX(pl.LightningModule):
266
  )
267
  # print(f"Input_{metric}", negate * self.metrics[metric](x, y))
268
  # print(f"test_{metric}", negate * self.metrics[metric](output, y))
269
- self.output_str += f"{negate * self.metrics[metric](x, y).item():.4f},{negate * self.metrics[metric](output, y).item():.4f},"
270
- self.output_str += "\n"
271
  return loss
272
 
273
  def on_test_end(self) -> None:
274
- with open("output.csv", "w") as f:
275
- f.write(self.output_str)
 
276
 
277
 
278
  class OpenUnmixModel(nn.Module):
 
9
  from auraloss.freq import MultiResolutionSTFTLoss
10
  from umx.openunmix.model import OpenUnmix, Separator
11
 
12
+ from remfx.utils import spectrogram
13
  from remfx.tcn import TCN
14
  from remfx.utils import causal_crop
 
 
15
  from remfx import effects
16
  import asteroid
17
  import random
 
146
  )
147
  # print(f"Input_{metric}", negate * self.metrics[metric](x, y))
148
  # print(f"test_{metric}", negate * self.metrics[metric](output, y))
149
+ # self.output_str += f"{negate * self.metrics[metric](x, y).item():.4f},{negate * self.metrics[metric](output, y).item():.4f},"
150
+ # self.output_str += "\n"
151
  return loss
152
 
153
  def on_test_end(self) -> None:
154
+ pass
155
+ # with open("output.csv", "w") as f:
156
+ # f.write(self.output_str)
157
 
158
  def sample(self, batch):
159
  return self.forward(batch, 0)[1]
 
265
  )
266
  # print(f"Input_{metric}", negate * self.metrics[metric](x, y))
267
  # print(f"test_{metric}", negate * self.metrics[metric](output, y))
268
+ # self.output_str += f"{negate * self.metrics[metric](x, y).item():.4f},{negate * self.metrics[metric](output, y).item():.4f},"
269
+ # self.output_str += "\n"
270
  return loss
271
 
272
  def on_test_end(self) -> None:
273
+ pass
274
+ # with open("output.csv", "w") as f:
275
+ # f.write(self.output_str)
276
 
277
 
278
  class OpenUnmixModel(nn.Module):
remfx/tcn.py CHANGED
@@ -125,7 +125,6 @@ class TCN(nn.Module):
125
  self.buffer = torch.zeros(2, self.receptive_field + self.block_size - 1)
126
 
127
  def forward(self, x: Tensor) -> Tensor:
128
- x_in = x
129
  for _, block in enumerate(self.process_blocks):
130
  x = block(x)
131
  y_hat = torch.tanh(self.output(x))
 
125
  self.buffer = torch.zeros(2, self.receptive_field + self.block_size - 1)
126
 
127
  def forward(self, x: Tensor) -> Tensor:
 
128
  for _, block in enumerate(self.process_blocks):
129
  x = block(x)
130
  y_hat = torch.tanh(self.output(x))
scripts/download.py CHANGED
@@ -18,8 +18,6 @@ def process_dataset(dataset_dir: str, output_dir: str):
18
  pass
19
  elif dataset_dir == "audio_mono-mic":
20
  pass
21
- elif dataset_dir == "IDMT-SMT-GUITAR_V2":
22
- pass
23
  elif dataset_dir == "IDMT-SMT-BASS":
24
  pass
25
  elif dataset_dir == "IDMT-SMT-DRUMS-V2":
@@ -69,23 +67,25 @@ if __name__ == "__main__":
69
  choices=[
70
  "vocalset",
71
  "guitarset",
72
- "idmt-smt-guitar",
73
  "dsd100",
74
  "idmt-smt-drums",
75
  ],
76
  nargs="+",
77
  )
 
78
  args = parser.parse_args()
79
 
 
 
 
80
  dataset_urls = {
81
  "vocalset": "https://zenodo.org/record/1442513/files/VocalSet1-2.zip",
82
  "guitarset": "https://zenodo.org/record/3371780/files/audio_mono-mic.zip",
83
- "IDMT-SMT-GUITAR_V2": "https://zenodo.org/record/7544110/files/IDMT-SMT-GUITAR_V2.zip",
84
  "DSD100": "http://liutkus.net/DSD100.zip",
85
  "IDMT-SMT-DRUMS-V2": "https://zenodo.org/record/7544164/files/IDMT-SMT-DRUMS-V2.zip",
86
  }
87
 
88
  for dataset_name, dataset_url in dataset_urls.items():
89
  if dataset_name in args.dataset_names:
90
- download_zip_dataset(dataset_url, "~/data/remfx-data")
91
- process_dataset(dataset_name, "~/data/remfx-data")
 
18
  pass
19
  elif dataset_dir == "audio_mono-mic":
20
  pass
 
 
21
  elif dataset_dir == "IDMT-SMT-BASS":
22
  pass
23
  elif dataset_dir == "IDMT-SMT-DRUMS-V2":
 
67
  choices=[
68
  "vocalset",
69
  "guitarset",
 
70
  "dsd100",
71
  "idmt-smt-drums",
72
  ],
73
  nargs="+",
74
  )
75
+ parser.add_argument("--output_dir", default="./data/remfx-data")
76
  args = parser.parse_args()
77
 
78
+ if not os.path.exists(args.output_dir):
79
+ os.makedirs(args.output_dir)
80
+
81
  dataset_urls = {
82
  "vocalset": "https://zenodo.org/record/1442513/files/VocalSet1-2.zip",
83
  "guitarset": "https://zenodo.org/record/3371780/files/audio_mono-mic.zip",
 
84
  "DSD100": "http://liutkus.net/DSD100.zip",
85
  "IDMT-SMT-DRUMS-V2": "https://zenodo.org/record/7544164/files/IDMT-SMT-DRUMS-V2.zip",
86
  }
87
 
88
  for dataset_name, dataset_url in dataset_urls.items():
89
  if dataset_name in args.dataset_names:
90
+ download_zip_dataset(dataset_url, args.output_dir)
91
+ process_dataset(dataset_name, args.ou)
scripts/download_egfx.sh DELETED
@@ -1,22 +0,0 @@
1
- #/bin/bash
2
- mkdir -p data
3
- cd data
4
- mkdir -p egfx
5
- cd egfx
6
- wget https://zenodo.org/record/7044411/files/BluesDriver.zip?download=1 -O BluesDriver.zip
7
- wget https://zenodo.org/record/7044411/files/Chorus.zip?download=1 -O Chorus.zip
8
- wget https://zenodo.org/record/7044411/files/Clean.zip?download=1 -O Clean.zip
9
- wget https://zenodo.org/record/7044411/files/Digital-Delay.zip?download=1 -O Digital-Delay.zip
10
- wget https://zenodo.org/record/7044411/files/Flanger.zip?download=1 -O Flanger.zip
11
- wget https://zenodo.org/record/7044411/files/Hall-Reverb.zip?download=1 -O Hall-Reverb.zip
12
- wget https://zenodo.org/record/7044411/files/Phaser.zip?download=1 -O Phaser.zip
13
- wget https://zenodo.org/record/7044411/files/Plate-Reverb.zip?download=1 -O Plate-Reverb.zip
14
- wget https://zenodo.org/record/7044411/files/RAT.zip?download=1 -O RAT.zip
15
- wget https://zenodo.org/record/7044411/files/Spring-Reverb.zip?download=1 -O Spring-Reverb.zip
16
- wget https://zenodo.org/record/7044411/files/Sweep-Echo.zip?download=1 -O Sweep-Echo.zip
17
- wget https://zenodo.org/record/7044411/files/TapeEcho.zip?download=1 -O TapeEcho.zip
18
- wget https://zenodo.org/record/7044411/files/TubeScreamer.zip?download=1 -O TubeScreamer.zip
19
- unzip -n \*.zip
20
- rm -rf *.zip
21
-
22
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
scripts/test.py CHANGED
@@ -2,7 +2,6 @@ import pytorch_lightning as pl
2
  import hydra
3
  from omegaconf import DictConfig
4
  import remfx.utils as utils
5
- from pytorch_lightning.utilities.model_summary import ModelSummary
6
  import torch
7
 
8
  log = utils.get_logger(__name__)
 
2
  import hydra
3
  from omegaconf import DictConfig
4
  import remfx.utils as utils
 
5
  import torch
6
 
7
  log = utils.get_logger(__name__)