提交 724ef185 编写于 作者: Y Yibing Liu

update several scripts to support mfcc

上级 ee5abbe3
...@@ -44,6 +44,8 @@ python compute_mean_std.py ...@@ -44,6 +44,8 @@ python compute_mean_std.py
python compute_mean_std.py --specgram_type mfcc python compute_mean_std.py --specgram_type mfcc
``` ```
and specify the ```specgram_type``` to ```mfcc``` in each step, including training, inference etc.
More help for arguments: More help for arguments:
``` ```
......
...@@ -86,6 +86,12 @@ parser.add_argument( ...@@ -86,6 +86,12 @@ parser.add_argument(
default=500, default=500,
type=int, type=int,
help="Width for beam search decoding. (default: %(default)d)") help="Width for beam search decoding. (default: %(default)d)")
parser.add_argument(
"--specgram_type",
default='linear',
type=str,
help="Feature type of audio data: 'linear' (power spectrum)"
" or 'mfcc'. (default: %(default)s)")
parser.add_argument( parser.add_argument(
"--decode_manifest_path", "--decode_manifest_path",
default='datasets/manifest.test', default='datasets/manifest.test',
...@@ -111,6 +117,7 @@ def evaluate(): ...@@ -111,6 +117,7 @@ def evaluate():
vocab_filepath=args.vocab_filepath, vocab_filepath=args.vocab_filepath,
mean_std_filepath=args.mean_std_filepath, mean_std_filepath=args.mean_std_filepath,
augmentation_config='{}', augmentation_config='{}',
specgram_type=args.specgram_type,
num_threads=args.num_threads_data) num_threads=args.num_threads_data)
# create network config # create network config
......
...@@ -51,6 +51,12 @@ parser.add_argument( ...@@ -51,6 +51,12 @@ parser.add_argument(
default=multiprocessing.cpu_count(), default=multiprocessing.cpu_count(),
type=int, type=int,
help="Number of cpu processes for beam search. (default: %(default)s)") help="Number of cpu processes for beam search. (default: %(default)s)")
parser.add_argument(
"--specgram_type",
default='linear',
type=str,
help="Feature type of audio data: 'linear' (power spectrum)"
" or 'mfcc'. (default: %(default)s)")
parser.add_argument( parser.add_argument(
"--mean_std_filepath", "--mean_std_filepath",
default='mean_std.npz', default='mean_std.npz',
...@@ -118,6 +124,7 @@ def infer(): ...@@ -118,6 +124,7 @@ def infer():
vocab_filepath=args.vocab_filepath, vocab_filepath=args.vocab_filepath,
mean_std_filepath=args.mean_std_filepath, mean_std_filepath=args.mean_std_filepath,
augmentation_config='{}', augmentation_config='{}',
specgram_type=args.specgram_type,
num_threads=args.num_threads_data) num_threads=args.num_threads_data)
# create network config # create network config
......
...@@ -50,6 +50,12 @@ parser.add_argument( ...@@ -50,6 +50,12 @@ parser.add_argument(
default=multiprocessing.cpu_count(), default=multiprocessing.cpu_count(),
type=int, type=int,
help="Number of cpu processes for beam search. (default: %(default)s)") help="Number of cpu processes for beam search. (default: %(default)s)")
parser.add_argument(
"--specgram_type",
default='linear',
type=str,
help="Feature type of audio data: 'linear' (power spectrum)"
" or 'mfcc'. (default: %(default)s)")
parser.add_argument( parser.add_argument(
"--mean_std_filepath", "--mean_std_filepath",
default='mean_std.npz', default='mean_std.npz',
...@@ -133,6 +139,7 @@ def tune(): ...@@ -133,6 +139,7 @@ def tune():
vocab_filepath=args.vocab_filepath, vocab_filepath=args.vocab_filepath,
mean_std_filepath=args.mean_std_filepath, mean_std_filepath=args.mean_std_filepath,
augmentation_config='{}', augmentation_config='{}',
specgram_type=args.specgram_type,
num_threads=args.num_threads_data) num_threads=args.num_threads_data)
# create network config # create network config
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册