Created
December 19, 2019 06:12
-
-
Save aidiary/f85ef86d9828d91096ffe66ac7c7743f to your computer and use it in GitHub Desktop.
特徴量抽出の並列化方法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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