Skip to content

Commit 145c8e9

Browse files
committed
Simplifying commands.
1 parent 781a2ec commit 145c8e9

File tree

2 files changed

+7
-33
lines changed

2 files changed

+7
-33
lines changed

README.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,8 @@ do the following, given the base configuration included in
2929
First, prepare the MUSDB data:
3030

3131
```
32-
# Symlink your data directory to ./data/
33-
python -m common.data --run.cmd='symlink' --symlink.folder=~/.nussl/tutorial
34-
# Prepare data
35-
python -m common.data --run.cmd=prepare_musdb --args.load=common/exp/conf/chimera.yml
36-
# Listen to Scaper output on train set
37-
python -m common.data --run.cmd=listen --args.load=common/exp/conf/chimera.yml
32+
# Symlink your data directory to ./data/ and prepare it for scaper
33+
python -m common.data --args.load=common/exp/conf/chimera.yml
3834
```
3935

4036
Now, train, evaluate, and listen to a model:

common/data.py

+5-27
Original file line numberDiff line numberDiff line change
@@ -290,32 +290,6 @@ def mixer(
290290
)
291291
return dataset
292292

293-
@argbind.bind_to_parser()
294-
def listen(
295-
num : int = 1,
296-
seed : int = 0,
297-
):
298-
"""
299-
Listen to ```num``` examples from the dataset.
300-
301-
Parameters
302-
----------
303-
num : int, optional
304-
Number of examples to listen to from dataset, by default 1
305-
seed : int, optional
306-
Seed to start out for listening.
307-
"""
308-
stft_params, sample_rate = signal()
309-
dataset = mixer(stft_params, None)
310-
state = np.random.RandomState(seed)
311-
for _ in range(num):
312-
idx = state.randint(0, len(dataset))
313-
item = dataset[idx]
314-
soundscape_jam = item['metadata']['jam']
315-
logging.info(f"Item {item['metadata']['idx']} from dataset")
316-
utils.pprint(soundscape_jam)
317-
item['mix'].play()
318-
319293
class MUSDBMixer():
320294
def __init__(
321295
self,
@@ -469,4 +443,8 @@ def __call__(self, dataset, i):
469443
return output
470444

471445
if __name__ == "__main__":
472-
utils.parse_args_and_run(__name__)
446+
utils.logger()
447+
args = argbind.parse_args()
448+
with argbind.scope(args):
449+
symlink()
450+
prepare_musdb()

0 commit comments

Comments
 (0)