Mercurial > hg > aimc
comparison experiments/scripts/cnbh-syllables/results_plotting/gen_results.py @ 211:97a513bc3bcf
- Python results plotting (finally).
- Proper results reporting script.
- Test on ALL talkers. The results script then generates a summary based on all the various subsets.
- Fixed chown users (hopefully sudos to be deleted entirely soon)
- More...
author | tomwalters |
---|---|
date | Mon, 13 Sep 2010 18:34:23 +0000 |
parents | 53b888e0f0df |
children | b50a09ac97ec |
comparison
equal
deleted
inserted
replaced
210:ca44099cb78b | 211:97a513bc3bcf |
---|---|
10 import getopt | 10 import getopt |
11 import re | 11 import re |
12 | 12 |
13 | 13 |
14 help_message = ''' | 14 help_message = ''' |
15 Write out all the results for a run of the | 15 Generate a file containing all the results for a run of the |
16 syllable recognition experiment. Expected input is a 'misclassificaions' | 16 syllable recognition experiment. Expected input is a 'misclassificaions' |
17 file of the type generated by run_test_instance.sh, along with the locations | 17 file of the type generated by run_test_instance.sh, along with the locations |
18 of files containing the training talkers and all the talkers that the system | 18 of files containing the training talkers and all the talkers that the system |
19 was tested on. | 19 was tested on. |
20 | 20 |
21 Arguments: | 21 Arguments: |
22 -i --input_file | 22 -i --input_file |
23 -t --train_talkers | 23 -t --train_talkers |
24 -s --test_talkers | 24 -s --test_talkers |
25 -o --output_filename | |
25 -c --value_count | 26 -c --value_count |
26 -p --spoke_pattern | 27 -p --spoke_pattern |
27 ''' | 28 ''' |
28 | 29 |
29 class Usage(Exception): | 30 class Usage(Exception): |
36 argv = sys.argv | 37 argv = sys.argv |
37 try: | 38 try: |
38 try: | 39 try: |
39 opts, args = getopt.getopt(argv[1:], "hi:t:s:o:c:p:v", | 40 opts, args = getopt.getopt(argv[1:], "hi:t:s:o:c:p:v", |
40 ["help", "input_file=", "train_talkers=", | 41 ["help", "input_file=", "train_talkers=", |
41 "test_talkers=", | 42 "test_talkers=", "output_filename=", |
42 "value_count=", "spoke_pattern="]) | 43 "value_count=", "spoke_pattern="]) |
43 except getopt.error, msg: | 44 except getopt.error, msg: |
44 raise Usage(msg) | 45 raise Usage(msg) |
45 | 46 |
46 # defaults | 47 # defaults |
63 train_talkers = value | 64 train_talkers = value |
64 if option in ("-s", "--test_talkers"): | 65 if option in ("-s", "--test_talkers"): |
65 test_talkers = value | 66 test_talkers = value |
66 if option in ("-c", "--value_count"): | 67 if option in ("-c", "--value_count"): |
67 total_value_count = int(value) | 68 total_value_count = int(value) |
68 if option in ("-p", "--spoke_pattern"): | 69 if option in ("-p", "--spoke_pattern_file"): |
69 spoke_pattern_file = value | 70 spoke_pattern_file = value |
70 | 71 |
71 except Usage, err: | 72 except Usage, err: |
72 print >> sys.stderr, sys.argv[0].split("/")[-1] + ": " + str(err.msg) | 73 print >> sys.stderr, sys.argv[0].split("/")[-1] + ": " + str(err.msg) |
73 print >> sys.stderr, "\t for help use --help" | 74 print >> sys.stderr, "\t for help use --help" |