forked from aliutkus/sisec-mus-oracle
-
Notifications
You must be signed in to change notification settings - Fork 6
/
GT.py
54 lines (43 loc) · 1.07 KB
/
GT.py
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
import musdb
import museval
import argparse
import functools
def GT(track, eval_dir=None):
"""Ground Truth Signals
"""
# perform separtion
estimates = {}
for name, target in track.targets.items():
# set accompaniment source
estimates[name] = target.audio
if eval_dir is not None:
museval.eval_mus_track(
track,
estimates,
output_dir=eval_dir,
)
return estimates
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='Evaluate on Ground Truth Targets'
)
parser.add_argument(
'--audio_dir',
nargs='?',
help='Folder where audio results are saved'
)
parser.add_argument(
'--eval_dir',
nargs='?',
help='Folder where evaluation results are saved'
)
args = parser.parse_args()
# initiate musdb
mus = musdb.DB()
mus.run(
functools.partial(GT, eval_dir=args.eval_dir),
estimates_dir=args.audio_dir,
subsets='test',
parallel=True,
cpus=2
)