Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
特徴量抽出の並列化方法
func_args = []
for wav_file in sorted(os.listdir(wav_dir)):
prefix = os.path.splitext(wav_file)[0]
wav_path = os.path.join(wav_dir, wav_file)
mulaw_path = os.path.join(mulaw_dir, '{}.npy'.format(prefix))
melspec_path = os.path.join(melspec_dir, '{}.npy'.format(prefix))
func_args.append((extract_features, wav_path, mulaw_path, melspec_path, config))
with Pool(os.cpu_count()) as p:
for result in tqdm.tqdm(p.imap_unordered(argwrapper, func_args), total=len(func_args)):
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment