[kws] update parameter for plotting det curve (#54)
This commit is contained in:
parent
768900307a
commit
f622c55b04
@ -107,7 +107,7 @@ if [ ${stage} -le 3 ] && [ ${stop_stage} -ge 3 ]; then
|
|||||||
--stats_file $result_dir/stats.${keyword}.txt
|
--stats_file $result_dir/stats.${keyword}.txt
|
||||||
done
|
done
|
||||||
python kws/bin/plot_det_curve.py \
|
python kws/bin/plot_det_curve.py \
|
||||||
--keywords 'Hey_Snips' \
|
--keywords_dict dict/words.txt \
|
||||||
--stats_dir $result_dir \
|
--stats_dir $result_dir \
|
||||||
--figure_file $result_dir/det.png \
|
--figure_file $result_dir/det.png \
|
||||||
--xlim 10 \
|
--xlim 10 \
|
||||||
|
|||||||
@ -62,11 +62,9 @@ def plot_det_curve(
|
|||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = argparse.ArgumentParser(description='plot det curve')
|
parser = argparse.ArgumentParser(description='plot det curve')
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--keywords',
|
'--keywords_dict',
|
||||||
required=True,
|
required=True,
|
||||||
help=('keywords, must in the same order as in "dict/words.txt", ' +
|
help='path to the dictionary of keywords')
|
||||||
'separated by ", "')
|
|
||||||
)
|
|
||||||
parser.add_argument('--stats_dir', required=True, help='dir of stats files')
|
parser.add_argument('--stats_dir', required=True, help='dir of stats files')
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--figure_file',
|
'--figure_file',
|
||||||
@ -87,7 +85,13 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
keywords = args.keywords.strip().split(', ')
|
keywords = []
|
||||||
|
with open(args.keywords_dict, 'r', encoding='utf8') as fin:
|
||||||
|
for line in fin:
|
||||||
|
keyword, index = line.strip().split()
|
||||||
|
if int(index) > -1:
|
||||||
|
keywords.append(keyword)
|
||||||
|
|
||||||
plot_det_curve(
|
plot_det_curve(
|
||||||
keywords,
|
keywords,
|
||||||
args.stats_dir,
|
args.stats_dir,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user