-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the demo script for inference #653
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
fluid/DeepASR/infer.py
Outdated
'--mean_var', | ||
type=str, | ||
default='data/global_mean_var_search26kHr', | ||
help='mean var path') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please refine the comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
fluid/DeepASR/infer.py
Outdated
'--infer_feature_lst', | ||
type=str, | ||
default='data/infer_feature.lst', | ||
help='feature list path for inference.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the first character be upper case ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
return infer_batch | ||
|
||
|
||
def infer(args): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to replace args with specified arguments. Otherwise, this function is not well self-explained.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not necessary for this function only used in this file.
] | ||
|
||
infer_data_reader = reader.DataReader(args.infer_feature_lst, | ||
args.infer_label_lst) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
infer_label_lst
should be optional. However, currently the data reader hasn't been adapted to support inference. Just mark here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. It should be.
fluid/DeepASR/infer.py
Outdated
|
||
|
||
def infer(args): | ||
""" Get one batch of feature data and predicts labels for each sample. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why one batch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because there is no decoder right now, and printing predicted labels for more data would be ugly. This can be changed after the decoder is ready.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. Thanks!
return infer_batch | ||
|
||
|
||
def infer(args): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not necessary for this function only used in this file.
] | ||
|
||
infer_data_reader = reader.DataReader(args.infer_feature_lst, | ||
args.infer_label_lst) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. It should be.
fluid/DeepASR/infer.py
Outdated
'--mean_var', | ||
type=str, | ||
default='data/global_mean_var_search26kHr', | ||
help='mean var path') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
fluid/DeepASR/infer.py
Outdated
'--infer_feature_lst', | ||
type=str, | ||
default='data/infer_feature.lst', | ||
help='feature list path for inference.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
fluid/DeepASR/infer.py
Outdated
|
||
|
||
def infer(args): | ||
""" Get one batch of feature data and predicts labels for each sample. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because there is no decoder right now, and printing predicted labels for more data would be ugly. This can be changed after the decoder is ready.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Resolve #654