Spaces:
Runtime error
Runtime error
Update inference/mastering_transfer.py
Browse files
inference/mastering_transfer.py
CHANGED
@@ -62,30 +62,6 @@ class Mastering_Style_Transfer_Inference:
|
|
62 |
ddp = trained_w_ddp
|
63 |
self.reload_weights(ckpt_paths, ddp=ddp)
|
64 |
|
65 |
-
# load data loader for the inference procedure
|
66 |
-
inference_dataset = Song_Dataset_Inference(args)
|
67 |
-
self.data_loader = DataLoader(inference_dataset, \
|
68 |
-
batch_size=1, \
|
69 |
-
shuffle=False, \
|
70 |
-
num_workers=args.workers, \
|
71 |
-
drop_last=False)
|
72 |
-
|
73 |
-
''' check stem-wise result '''
|
74 |
-
if not self.args.do_not_separate:
|
75 |
-
os.environ['MKL_THREADING_LAYER'] = 'GNU'
|
76 |
-
separate_file_names = [args.input_file_name, args.reference_file_name]
|
77 |
-
if self.args.interpolation:
|
78 |
-
separate_file_names.append(args.reference_file_name_2interpolate)
|
79 |
-
for cur_idx, cur_inf_dir in enumerate(sorted(glob(f"{args.target_dir}*/"))):
|
80 |
-
for cur_file_name in separate_file_names:
|
81 |
-
cur_sep_file_path = os.path.join(cur_inf_dir, cur_file_name+'.wav')
|
82 |
-
cur_sep_output_dir = os.path.join(cur_inf_dir, args.stem_level_directory_name)
|
83 |
-
if os.path.exists(os.path.join(cur_sep_output_dir, self.args.separation_model, cur_file_name, 'drums.wav')):
|
84 |
-
print(f'\talready separated current file : {cur_sep_file_path}')
|
85 |
-
else:
|
86 |
-
cur_cmd_line = f"demucs {cur_sep_file_path} -n {self.args.separation_model} -d {self.device} -o {cur_sep_output_dir}"
|
87 |
-
os.system(cur_cmd_line)
|
88 |
-
|
89 |
|
90 |
# reload model weights from the target checkpoint path
|
91 |
def reload_weights(self, ckpt_paths, ddp=True):
|
|
|
62 |
ddp = trained_w_ddp
|
63 |
self.reload_weights(ckpt_paths, ddp=ddp)
|
64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
|
66 |
# reload model weights from the target checkpoint path
|
67 |
def reload_weights(self, ckpt_paths, ddp=True):
|