Commit d3fffa1
authored
Fix overlapFactor bug and cleanup a bit (#97)
Cleanup the speech commands model:
- Fix an issue with `overlapFactor`, where if the user passed an overlap close to 1, the callback `f` in `startStream(f)` would still be called only once every 1s. Now that callback can be called as frequently as the frame duration (tested in the work-in-progress code lab). This makes the demo run in real-time, which is really nice.
- Remove `columnBufferLength` and `columnHopLength` as extractor config params since they were used to indirectly talk about `overlapFactor` between the recognizer and extractor. Thus, add `overlapFactor` as config instead.
- Change `DEFAULT_SUPPRESSION_TIME_MILLIS` from `1000ms` to `0ms`, so the user can get instant predictions.
- Remove unused params `filterSize` from `RecognizerParams`, and `minSamples` from `StreamingRecognitionConfig`
- Move top-level `utils/` folder to `training/utils` since only training uses it
- Remove `utils/util.ts` (all the util functions there were unused), other than `powerOfTwo` which got moved to `audio_util.ts`
- Make tests (`*_test.ts`) visible to the typescript compiler and linter.
- Improve `tslint.json`
- s/SpeechCommands/speechCommands/ in Rollup to align with the other models.
- minimize use of `any`1 parent 331a065 commit d3fffa1
25 files changed
Lines changed: 293 additions & 434 deletions
File tree
- speech-commands
- src
- training
- utils
- types
- utils
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
| 26 | + | |
24 | 27 | | |
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
31 | | - | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| 39 | + | |
36 | 40 | | |
37 | 41 | | |
38 | 42 | | |
39 | 43 | | |
40 | | - | |
| 44 | + | |
41 | 45 | | |
42 | | - | |
43 | | - | |
| 46 | + | |
| 47 | + | |
44 | 48 | | |
45 | 49 | | |
46 | 50 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
24 | 38 | | |
25 | 39 | | |
26 | 40 | | |
| |||
48 | 62 | | |
49 | 63 | | |
50 | 64 | | |
| 65 | + | |
51 | 66 | | |
52 | 67 | | |
53 | 68 | | |
| |||
61 | 76 | | |
62 | 77 | | |
63 | 78 | | |
64 | | - | |
| 79 | + | |
65 | 80 | | |
66 | 81 | | |
67 | 82 | | |
68 | 83 | | |
69 | 84 | | |
70 | 85 | | |
71 | 86 | | |
72 | | - | |
| 87 | + | |
73 | 88 | | |
74 | 89 | | |
75 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | 23 | | |
26 | 24 | | |
27 | 25 | | |
| |||
61 | 59 | | |
62 | 60 | | |
63 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
64 | 71 | | |
65 | 72 | | |
66 | 73 | | |
| |||
142 | 149 | | |
143 | 150 | | |
144 | 151 | | |
145 | | - | |
146 | | - | |
147 | | - | |
| 152 | + | |
148 | 153 | | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
154 | 158 | | |
155 | 159 | | |
156 | 160 | | |
| |||
190 | 194 | | |
191 | 195 | | |
192 | 196 | | |
| 197 | + | |
| 198 | + | |
193 | 199 | | |
194 | | - | |
| 200 | + | |
195 | 201 | | |
196 | 202 | | |
197 | 203 | | |
| |||
200 | 206 | | |
201 | 207 | | |
202 | 208 | | |
203 | | - | |
204 | 209 | | |
205 | 210 | | |
206 | 211 | | |
| |||
0 commit comments