Spaces:
Runtime error
Runtime error
Update inference/style_transfer.py
Browse files
inference/style_transfer.py
CHANGED
@@ -78,9 +78,9 @@ class Mixing_Style_Transfer_Inference:
|
|
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+'.
|
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.
|
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}"
|
@@ -329,7 +329,7 @@ def set_up():
|
|
329 |
|
330 |
directory_args = parser.add_argument_group('Directory args')
|
331 |
# directory paths
|
332 |
-
directory_args.add_argument('--target_dir', type=str, default='./')
|
333 |
directory_args.add_argument('--output_dir', type=str, default=None, help='if no output_dir is specified (None), the results will be saved inside the target_dir')
|
334 |
directory_args.add_argument('--input_file_name', type=str, default='input')
|
335 |
directory_args.add_argument('--reference_file_name', type=str, default='reference')
|
|
|
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+'.mp3')
|
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.mp3')):
|
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}"
|
|
|
329 |
|
330 |
directory_args = parser.add_argument_group('Directory args')
|
331 |
# directory paths
|
332 |
+
directory_args.add_argument('--target_dir', type=str, default='./yt_dir/')
|
333 |
directory_args.add_argument('--output_dir', type=str, default=None, help='if no output_dir is specified (None), the results will be saved inside the target_dir')
|
334 |
directory_args.add_argument('--input_file_name', type=str, default='input')
|
335 |
directory_args.add_argument('--reference_file_name', type=str, default='reference')
|