wakeforge 0.4.1a3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- wakeforge-0.4.1a3.dist-info/METADATA +208 -0
- wakeforge-0.4.1a3.dist-info/RECORD +47 -0
- wakeforge-0.4.1a3.dist-info/WHEEL +5 -0
- wakeforge-0.4.1a3.dist-info/entry_points.txt +6 -0
- wakeforge-0.4.1a3.dist-info/licenses/LICENSE +202 -0
- wakeforge-0.4.1a3.dist-info/top_level.txt +1 -0
- ww_trainer/__init__.py +139 -0
- ww_trainer/augment.py +491 -0
- ww_trainer/benchmark.py +770 -0
- ww_trainer/cache.py +281 -0
- ww_trainer/calibration.py +145 -0
- ww_trainer/checkpoint.py +245 -0
- ww_trainer/cli.py +401 -0
- ww_trainer/datagen.py +1013 -0
- ww_trainer/dataset.py +412 -0
- ww_trainer/ddp.py +112 -0
- ww_trainer/distill.py +536 -0
- ww_trainer/env.py +74 -0
- ww_trainer/evaluation.py +238 -0
- ww_trainer/export_c.py +146 -0
- ww_trainer/factory.py +261 -0
- ww_trainer/feats.py +2295 -0
- ww_trainer/few_shot.py +237 -0
- ww_trainer/ga_mlflow.py +273 -0
- ww_trainer/inference.py +443 -0
- ww_trainer/infinite_loop.py +610 -0
- ww_trainer/loop.py +778 -0
- ww_trainer/loss.py +1510 -0
- ww_trainer/metrics.py +439 -0
- ww_trainer/mining.py +173 -0
- ww_trainer/model.py +1707 -0
- ww_trainer/multi_stage.py +182 -0
- ww_trainer/phonmatch.py +475 -0
- ww_trainer/py.typed +0 -0
- ww_trainer/qat.py +63 -0
- ww_trainer/quantize.py +158 -0
- ww_trainer/quickstart.py +383 -0
- ww_trainer/reproducibility.py +75 -0
- ww_trainer/subspectralnorm.py +77 -0
- ww_trainer/sweep.py +1413 -0
- ww_trainer/tiers.py +207 -0
- ww_trainer/trainer.py +328 -0
- ww_trainer/utils.py +345 -0
- ww_trainer/vc_helpers.py +123 -0
- ww_trainer/vendors/__init__.py +0 -0
- ww_trainer/version.py +11 -0
- ww_trainer/visualization.py +902 -0
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: wakeforge
|
|
3
|
+
Version: 0.4.1a3
|
|
4
|
+
Summary: Full training and research suite for wake words — MFCC to HuBERT, all exported to ONNX
|
|
5
|
+
Author-email: JarbasAi <jarbasai@mailfence.com>
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/TigreGotico/ww_trainer
|
|
8
|
+
Requires-Python: >=3.10
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Requires-Dist: torch
|
|
12
|
+
Requires-Dist: torchaudio
|
|
13
|
+
Requires-Dist: onnx>=1.17
|
|
14
|
+
Requires-Dist: onnxruntime>=1.20
|
|
15
|
+
Requires-Dist: numpy
|
|
16
|
+
Requires-Dist: soundfile
|
|
17
|
+
Requires-Dist: click
|
|
18
|
+
Requires-Dist: tqdm
|
|
19
|
+
Requires-Dist: scikit-learn
|
|
20
|
+
Requires-Dist: matplotlib
|
|
21
|
+
Requires-Dist: librosa
|
|
22
|
+
Provides-Extra: dev
|
|
23
|
+
Requires-Dist: pytest; extra == "dev"
|
|
24
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
25
|
+
Requires-Dist: onnxscript; extra == "dev"
|
|
26
|
+
Requires-Dist: markovonnx; extra == "dev"
|
|
27
|
+
Requires-Dist: umap-learn; extra == "dev"
|
|
28
|
+
Requires-Dist: optuna; extra == "dev"
|
|
29
|
+
Requires-Dist: voiceclonnx; extra == "dev"
|
|
30
|
+
Provides-Extra: test
|
|
31
|
+
Requires-Dist: pytest; extra == "test"
|
|
32
|
+
Requires-Dist: pytest-cov; extra == "test"
|
|
33
|
+
Requires-Dist: onnxscript; extra == "test"
|
|
34
|
+
Requires-Dist: markovonnx; extra == "test"
|
|
35
|
+
Requires-Dist: umap-learn; extra == "test"
|
|
36
|
+
Requires-Dist: optuna; extra == "test"
|
|
37
|
+
Requires-Dist: voiceclonnx; extra == "test"
|
|
38
|
+
Provides-Extra: torchcodec
|
|
39
|
+
Requires-Dist: torchcodec; extra == "torchcodec"
|
|
40
|
+
Provides-Extra: mlflow
|
|
41
|
+
Requires-Dist: mlflow; extra == "mlflow"
|
|
42
|
+
Provides-Extra: sweep
|
|
43
|
+
Requires-Dist: optuna; extra == "sweep"
|
|
44
|
+
Provides-Extra: ocsvm
|
|
45
|
+
Requires-Dist: scikit-learn>=1.3; extra == "ocsvm"
|
|
46
|
+
Provides-Extra: transformers
|
|
47
|
+
Requires-Dist: transformers; extra == "transformers"
|
|
48
|
+
Provides-Extra: markov
|
|
49
|
+
Requires-Dist: markovonnx; extra == "markov"
|
|
50
|
+
Provides-Extra: vc
|
|
51
|
+
Requires-Dist: voiceclonnx; extra == "vc"
|
|
52
|
+
Provides-Extra: vc-onnx
|
|
53
|
+
Requires-Dist: voiceclonnx; extra == "vc-onnx"
|
|
54
|
+
Provides-Extra: datagen
|
|
55
|
+
Requires-Dist: datasets; extra == "datagen"
|
|
56
|
+
Requires-Dist: ovos-plugin-manager; extra == "datagen"
|
|
57
|
+
Requires-Dist: ovos-tts-plugin-edge-tts; extra == "datagen"
|
|
58
|
+
Requires-Dist: vadonnx>=0.1.0; extra == "datagen"
|
|
59
|
+
Provides-Extra: mic
|
|
60
|
+
Requires-Dist: sounddevice; extra == "mic"
|
|
61
|
+
Provides-Extra: viz
|
|
62
|
+
Requires-Dist: umap-learn; extra == "viz"
|
|
63
|
+
Provides-Extra: notebooks
|
|
64
|
+
Requires-Dist: jupyter; extra == "notebooks"
|
|
65
|
+
Requires-Dist: nbconvert; extra == "notebooks"
|
|
66
|
+
Requires-Dist: ipykernel; extra == "notebooks"
|
|
67
|
+
Requires-Dist: datasets; extra == "notebooks"
|
|
68
|
+
Requires-Dist: ovos-plugin-manager; extra == "notebooks"
|
|
69
|
+
Requires-Dist: ovos-tts-plugin-edge-tts; extra == "notebooks"
|
|
70
|
+
Requires-Dist: vadonnx>=0.1.0; extra == "notebooks"
|
|
71
|
+
Dynamic: license-file
|
|
72
|
+
|
|
73
|
+
# Wake Word Trainer
|
|
74
|
+
|
|
75
|
+
A research-grade training suite for **wake-word detection** — the always-on
|
|
76
|
+
keyword spotter that wakes "Hey Siri", "OK Google", or your own custom phrase.
|
|
77
|
+
Train, evaluate, and ship lightweight on-device detectors that run anywhere
|
|
78
|
+
from an ESP32 to a GPU server. Every component exports to ONNX; production
|
|
79
|
+
inference requires only `onnxruntime` and `numpy` — no PyTorch at runtime.
|
|
80
|
+
|
|
81
|
+
## What is a wake word?
|
|
82
|
+
|
|
83
|
+
A short phrase ("hey jarvis", "computer", "alexa") that a device listens for
|
|
84
|
+
continuously. When detected, downstream STT/NLU runs. A useful detector must
|
|
85
|
+
run on tiny hardware (sub-100 KB, <10 % CPU, no internet), tolerate noise and
|
|
86
|
+
distance, almost never false-fire (< 1 FA / hour), and trigger reliably when
|
|
87
|
+
spoken (> 90 % recall at that operating point). ww-trainer is the toolchain
|
|
88
|
+
that builds such a detector from a single phrase — synthesise data, train,
|
|
89
|
+
evaluate, export, deploy.
|
|
90
|
+
|
|
91
|
+
## Who is this for?
|
|
92
|
+
|
|
93
|
+
| You are… | Start here |
|
|
94
|
+
|---|---|
|
|
95
|
+
| **Hobbyist** waking a Pi with your own phrase | [`docs/getting_started/quickstart.md`](docs/getting_started/quickstart.md) — ONNX in 5 minutes |
|
|
96
|
+
| **Embedded engineer** shipping to ESP32 / MCU | [`docs/guides/embedded.md`](docs/guides/embedded.md) |
|
|
97
|
+
| **Voice-assistant integrator** (OVOS, Rhasspy, …) | [`docs/guides/inference.md`](docs/guides/inference.md) |
|
|
98
|
+
| **ML researcher** comparing architectures / losses | [`docs/guides/search.md`](docs/guides/search.md), [`docs/reference/losses.md`](docs/reference/losses.md), [`docs/research/rppl.md`](docs/research/rppl.md) |
|
|
99
|
+
| **New to ML** entirely | [`docs/quickstart-kaggle.md`](docs/quickstart-kaggle.md) — step-by-step guide; runs free on Kaggle / Colab |
|
|
100
|
+
|
|
101
|
+
## Highlights
|
|
102
|
+
|
|
103
|
+
- **Single-string-to-ONNX** quickstart — `train_from_wakeword("hey jarvis", out)` produces a deployable model.
|
|
104
|
+
- **11 built-in featurizers (+ enrichment wrappers) × 15 classifier heads × 15 losses** — a real research surface.
|
|
105
|
+
- **Genetic + Bayesian HP search** with island-model parallelism, adaptive mutation, two-stage refinement.
|
|
106
|
+
- **Synthetic datagen** — TTS + pure-ONNX voice conversion ([voiceclonnx](https://github.com/TigreGotico/voiceclonnx)) to bootstrap a dataset from zero recordings.
|
|
107
|
+
- **Hard-negative mining** and **infinite training** for industrial-scale negative pools.
|
|
108
|
+
- **ONNX-first**: featurizer and head export cleanly; no CUDA-only kernels.
|
|
109
|
+
- **Hardware tiers** from `esp32_nano` (sub-1 KB int8) to `hubert_medium`.
|
|
110
|
+
|
|
111
|
+
### Honest trade-offs
|
|
112
|
+
|
|
113
|
+
- CPU training works for small tiers; a mid-range GPU is the best UX for larger ones.
|
|
114
|
+
- Synthetic data is great for smoke-testing — production still needs real far-field recordings.
|
|
115
|
+
- ONNX-export is mandatory; non-traceable components (custom CUDA kernels, dynamic control flow) are out of scope. See [`docs/internals/known_issues.md`](docs/internals/known_issues.md).
|
|
116
|
+
- SSL featurizers (HuBERT, Wav2Vec2-BERT) are used as pre-exported ONNX and held frozen during downstream training — guarantees train/inference parity but limits adaptation.
|
|
117
|
+
|
|
118
|
+
## Install
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
# Published package (import name stays ww_trainer):
|
|
122
|
+
pip install --pre "wakeforge[datagen,torchcodec]"
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
For development, clone the repo and install it editable instead:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
# Core library + tests
|
|
129
|
+
uv pip install -e ".[dev]"
|
|
130
|
+
|
|
131
|
+
# Quickstart / datagen needs TTS plugins + HF datasets + an audio codec:
|
|
132
|
+
uv pip install -e ".[dev,datagen,torchcodec]"
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Optional extras (`sweep`, `transformers`, `mlflow`, `datagen`, `vc`, `mic`,
|
|
136
|
+
`viz`, `markov`, `ocsvm`, `torchcodec`) — see
|
|
137
|
+
[`docs/faq.md`](docs/faq.md#2-install).
|
|
138
|
+
|
|
139
|
+
A default quickstart run needs **≈ 6–8 GB disk** and **~5 GB download**
|
|
140
|
+
(or ~1.5 GB with `--no-augmentation-data`). Voice cloning via `--vc-refs`
|
|
141
|
+
adds the per-engine ONNX weights downloaded on first use from the
|
|
142
|
+
HuggingFace Hub (size varies by `voiceclonnx` engine). Full per-dataset
|
|
143
|
+
budget: [`docs/getting_started/requirements.md`](docs/getting_started/requirements.md).
|
|
144
|
+
## 60-second quickstart
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
ww_trainer-quickstart --wake-word "hey jarvis" --output-dir ./hey_jarvis
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Or in Python:
|
|
151
|
+
|
|
152
|
+
```python
|
|
153
|
+
from ww_trainer.quickstart import train_from_wakeword
|
|
154
|
+
result = train_from_wakeword("hey jarvis", "./hey_jarvis",
|
|
155
|
+
tier="small", epochs=50)
|
|
156
|
+
print(result.best_onnx_path, result.metrics)
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Output: `best_f1_featurizer.onnx` + `best_f1.onnx` under
|
|
160
|
+
`./hey_jarvis/model/`. Load both with `OnnxWakeWordInferencer` —
|
|
161
|
+
[`docs/guides/inference.md`](docs/guides/inference.md).
|
|
162
|
+
|
|
163
|
+
## Documentation
|
|
164
|
+
|
|
165
|
+
Everything lives in [`docs/`](docs/index.md). Start with:
|
|
166
|
+
|
|
167
|
+
- [docs/learning_path.md](docs/learning_path.md) — **zero-to-hero curriculum** with literature anchors
|
|
168
|
+
- [docs/faq.md](docs/faq.md) — topic-ordered Q&A in 15 sections
|
|
169
|
+
- [docs/index.md](docs/index.md) — full documentation index
|
|
170
|
+
- [examples/README.md](examples/README.md) — 43 runnable examples
|
|
171
|
+
|
|
172
|
+
## Contributing
|
|
173
|
+
|
|
174
|
+
Issues and pull requests welcome on the `dev` branch. Tests live in `test/`;
|
|
175
|
+
run with `uv run pytest`.
|
|
176
|
+
|
|
177
|
+
## Citation
|
|
178
|
+
|
|
179
|
+
```bibtex
|
|
180
|
+
@software{ww_trainer,
|
|
181
|
+
title = {ww-trainer: a research suite for on-device wake-word detection},
|
|
182
|
+
author = {TigreGotico contributors},
|
|
183
|
+
year = {2026},
|
|
184
|
+
url = {https://github.com/TigreGotico/ww-trainer},
|
|
185
|
+
note = {Funded by NGI0 Commons Fund / NLnet, grant 101135429}
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## Credits
|
|
192
|
+
|
|
193
|
+
Developed by [TigreGótico](https://tigregotico.pt) for
|
|
194
|
+
[OpenVoiceOS](https://openvoiceos.org).
|
|
195
|
+
|
|
196
|
+
[](https://nlnet.nl/project/OpenVoiceOS)
|
|
197
|
+
|
|
198
|
+
This project was funded through the [NGI0 Commons Fund](https://nlnet.nl/commonsfund),
|
|
199
|
+
a fund established by [NLnet](https://nlnet.nl) with financial support from the
|
|
200
|
+
European Commission's [Next Generation Internet](https://ngi.eu) programme, under
|
|
201
|
+
the aegis of [DG Communications Networks, Content and Technology](https://commission.europa.eu/about-european-commission/departments-and-executive-agencies/communications-networks-content-and-technology_en)
|
|
202
|
+
under grant agreement No [101135429](https://cordis.europa.eu/project/id/101135429).
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## License
|
|
207
|
+
|
|
208
|
+
Apache 2.0
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
wakeforge-0.4.1a3.dist-info/licenses/LICENSE,sha256=JBPAOkIXtKdcPVf305lJfqrNVYQ0beL0DenojOGR0EI,11346
|
|
2
|
+
ww_trainer/__init__.py,sha256=e1FiyrJhPyCHzth39r_yAyqexBzNKX7nmuqvy2uNAuQ,3158
|
|
3
|
+
ww_trainer/augment.py,sha256=J1PlZAQOqd1Mvgcsy2YH2XMLPhKAr7MbkocUWAL44e8,16049
|
|
4
|
+
ww_trainer/benchmark.py,sha256=isqhANPg9yMT-0JriMo2992csD9fzdOeeupQOPc4oy0,27114
|
|
5
|
+
ww_trainer/cache.py,sha256=dsPCNZZJbIPh5puu51ZUe_QDMNX9UeSVs7FehaqL9s8,9495
|
|
6
|
+
ww_trainer/calibration.py,sha256=3zFNI2FYHxIuJ3O0i1kUSMBHk1-j7YzQ8hRGieGOeQQ,4049
|
|
7
|
+
ww_trainer/checkpoint.py,sha256=1gyjl1-_lj-tJ5SrimCySNTA-zvsNnc4XlkR3v53a9s,9114
|
|
8
|
+
ww_trainer/cli.py,sha256=66MvzbTri87JzRfdrO2UnboETw_Ux-upeFfXsMo6PzM,22393
|
|
9
|
+
ww_trainer/datagen.py,sha256=h_BubtgsCvW7MWSYKiGtIKjIH6iQogL3r-01U94-S98,37781
|
|
10
|
+
ww_trainer/dataset.py,sha256=h3GKCMdaxhSKxBKilFTbOazDbAXjoiz1q77di7tXWXI,17742
|
|
11
|
+
ww_trainer/ddp.py,sha256=Qowk0YhKPk_s8XYdbhbBtz68eSzCQF9vXr-fHeWLo_Q,2948
|
|
12
|
+
ww_trainer/distill.py,sha256=fN4DU83nvNt72eSk7E-oFaJ7QhU-SzQFS349WYiJ6xY,18983
|
|
13
|
+
ww_trainer/env.py,sha256=-iN8X3tyvh8zJZ1bbl8etnaQgVyajM8ISY-yM8kFd0g,2505
|
|
14
|
+
ww_trainer/evaluation.py,sha256=Zny-LITEvpy9Diz6PeCXNO39p_8hIF9Q7bfQvvXUSvQ,8267
|
|
15
|
+
ww_trainer/export_c.py,sha256=uqBHfaeyV9Od6TISU0Kptg4QMjZtTBNUPSZwH-O20k4,5412
|
|
16
|
+
ww_trainer/factory.py,sha256=urJcephjppSR0h1sp3GyaXuUsCUdGlS4P2Suj_70T0s,10252
|
|
17
|
+
ww_trainer/feats.py,sha256=JzytYysddtyjBEUNafEHeqOeytoakyFoiJqtrwVgAtk,90400
|
|
18
|
+
ww_trainer/few_shot.py,sha256=ZzLRtoQKnxLwFe3_DFe-gYzCd8FVbOStLNpE9B3slGE,7769
|
|
19
|
+
ww_trainer/ga_mlflow.py,sha256=OLqDaqkOfbSyAW8qPADnx7bMhRwwcHbsgh8f8ntZdkM,11452
|
|
20
|
+
ww_trainer/inference.py,sha256=RN9PyTnSnzoQl86W7zXoMDZJqnNQ5mOJNdQZkpoN3gA,18644
|
|
21
|
+
ww_trainer/infinite_loop.py,sha256=AYfgDtxa5aPhUYjY7tE1pTB7XiAIC1f62aGvxpWy66A,24814
|
|
22
|
+
ww_trainer/loop.py,sha256=6GEx4GfMCpkkE1hNflilXuB8Wz4NqclVPMgs_4qeeCM,36310
|
|
23
|
+
ww_trainer/loss.py,sha256=n6VLVGFnhaM36t9xCRuaYm_suFRU4C2zPVSufBIVUTQ,60409
|
|
24
|
+
ww_trainer/metrics.py,sha256=iYB3Q_SjV9yNjRGh0ShBhY0dzmwlPbh3VDgzhyPEPOY,13476
|
|
25
|
+
ww_trainer/mining.py,sha256=0KxQdsA8Hpha9Ovyd3T-oAf76-uStbEwLDg0v5X0n18,7579
|
|
26
|
+
ww_trainer/model.py,sha256=lIBkBRz7Mux5ikAvb46l1MHxW6KlXD1jrrM4H8Ln1yQ,67035
|
|
27
|
+
ww_trainer/multi_stage.py,sha256=yY_a0PjhpgiM7VAHk_3BMKlEdlfpjpJR-PUFVcbtSec,5813
|
|
28
|
+
ww_trainer/phonmatch.py,sha256=SneMTSagZj8N0UpoZ0sD0Cn8p5stwSQDuHY0HWMsLUU,18869
|
|
29
|
+
ww_trainer/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
30
|
+
ww_trainer/qat.py,sha256=CC5lV6P6KZjBGBlNkg1clK-c4LQaXO8jEc-WkDvyI-k,1942
|
|
31
|
+
ww_trainer/quantize.py,sha256=lSl2lGsi5YeHOJTtbU-c5faVgW9g3x2HCSR7XgSbzNM,5113
|
|
32
|
+
ww_trainer/quickstart.py,sha256=vlyF_vqYAMYAp_teyk9hECUC4vjgIrZDMwwSSilKSrk,15561
|
|
33
|
+
ww_trainer/reproducibility.py,sha256=R_X0FpY2Vnqn_j3zRIjR1OMPt65DPTqmk7dUpqqjUaY,2610
|
|
34
|
+
ww_trainer/subspectralnorm.py,sha256=x-jOB-t7crLUStZXx5M9uxbaYCIdF_IOk-gKDWGzhsI,2590
|
|
35
|
+
ww_trainer/sweep.py,sha256=wM_S_XqOmTa-vZKlGMMahVbnz7fETCkwXZwW0d06yJ4,51752
|
|
36
|
+
ww_trainer/tiers.py,sha256=64TLPQYhvRRzbeR6uRWBWilNhWBA_CDpQDV0MwMp3bI,7135
|
|
37
|
+
ww_trainer/trainer.py,sha256=MKRB_t2wLDOlRom7wUzdqb23yh325fiIgwH2iJTiNjY,12880
|
|
38
|
+
ww_trainer/utils.py,sha256=6p7gdd_U_tFdTQHekWIdH7gdYRPiitd98rJDf5ElOMA,12848
|
|
39
|
+
ww_trainer/vc_helpers.py,sha256=qVNRrczq704FOOvTTK_VIvWxkVK8D25-HVXBTow3zNE,4711
|
|
40
|
+
ww_trainer/version.py,sha256=t0E7Cilboqm6hhWpfxdxeAS4JzPFBCvSJkHnE1lBIzs,281
|
|
41
|
+
ww_trainer/visualization.py,sha256=A_c4ZoZJMZkeh-8rWBAJMVys5WHsp-RUPkc_14025Wg,36527
|
|
42
|
+
ww_trainer/vendors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
43
|
+
wakeforge-0.4.1a3.dist-info/METADATA,sha256=XIWugkJxIIcpUmEp0p1pjaaRQ16o90_dpKiKqRDB2H4,8632
|
|
44
|
+
wakeforge-0.4.1a3.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
45
|
+
wakeforge-0.4.1a3.dist-info/entry_points.txt,sha256=7az86R-oTxIWsafo8j1b76dOkgJu-zwRf4HfX6U0dHo,260
|
|
46
|
+
wakeforge-0.4.1a3.dist-info/top_level.txt,sha256=B0jBNzFa__yFDLk2N39wmyj6uoQwAnWrI266fkKBwqE,11
|
|
47
|
+
wakeforge-0.4.1a3.dist-info/RECORD,,
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright 2026 TigreGotico Lda
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ww_trainer
|
ww_trainer/__init__.py
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"""ww-trainer: Full training and research suite for wake words.
|
|
2
|
+
|
|
3
|
+
All exported to ONNX — from MFCC on microcontrollers to HuBERT on servers.
|
|
4
|
+
"""
|
|
5
|
+
from ww_trainer.version import __version__
|
|
6
|
+
|
|
7
|
+
# --- Feature Extractors ---
|
|
8
|
+
from ww_trainer.feats import (
|
|
9
|
+
BaseExtractor,
|
|
10
|
+
OnnxFeatureExtractor,
|
|
11
|
+
MfccExtractor,
|
|
12
|
+
FilterbankExtractor,
|
|
13
|
+
SincNetExtractor,
|
|
14
|
+
GammatoneExtractor,
|
|
15
|
+
DeltaExtractor,
|
|
16
|
+
LEAFExtractor,
|
|
17
|
+
PLPExtractor,
|
|
18
|
+
PNCCExtractor,
|
|
19
|
+
CQTExtractor,
|
|
20
|
+
VoiceActivityExtractor,
|
|
21
|
+
PitchExtractor,
|
|
22
|
+
MultiResolutionExtractor,
|
|
23
|
+
SNRAwareExtractor,
|
|
24
|
+
SlidingFeatureCacheTensor,
|
|
25
|
+
MarkovTransitionExtractor,
|
|
26
|
+
HMMStateExtractor,
|
|
27
|
+
OnnxTextExtractor,
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
# --- Classifier Heads ---
|
|
31
|
+
from ww_trainer.model import (
|
|
32
|
+
ClassifierHead,
|
|
33
|
+
BaseWakeModel,
|
|
34
|
+
FfnClassifierHead,
|
|
35
|
+
CnnClassifierHead,
|
|
36
|
+
GruClassifierHead,
|
|
37
|
+
BCResNetHead,
|
|
38
|
+
TCResNetHead,
|
|
39
|
+
DSCNNHead,
|
|
40
|
+
MatchboxNetHead,
|
|
41
|
+
Res15Head,
|
|
42
|
+
KWTHead,
|
|
43
|
+
ConformerHead,
|
|
44
|
+
CRNNHead,
|
|
45
|
+
AttentionPooling,
|
|
46
|
+
ConvAttentionHead,
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
# --- Losses ---
|
|
50
|
+
from ww_trainer.loss import (
|
|
51
|
+
LossManager,
|
|
52
|
+
FocalLoss,
|
|
53
|
+
LabelSmoothingBCE,
|
|
54
|
+
ArcFaceLoss,
|
|
55
|
+
CenterLoss,
|
|
56
|
+
NTXentLoss,
|
|
57
|
+
SupConLoss,
|
|
58
|
+
ProxyNCALoss,
|
|
59
|
+
MultiSimilarityLoss,
|
|
60
|
+
ContrastiveLoss,
|
|
61
|
+
LiftedStructureLoss,
|
|
62
|
+
AngularLoss,
|
|
63
|
+
SoftTripletLoss,
|
|
64
|
+
CN2Plus1PairLoss,
|
|
65
|
+
RobustProtoDiversityLoss,
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
# --- Inference ---
|
|
69
|
+
from ww_trainer.inference import OnnxWakeWordInferencer, OnnxStreamingWakeWord
|
|
70
|
+
|
|
71
|
+
# --- Dataset ---
|
|
72
|
+
from ww_trainer.dataset import AudioDataset, collate_fn
|
|
73
|
+
|
|
74
|
+
# --- Tiers ---
|
|
75
|
+
from ww_trainer.tiers import HARDWARE_TIERS, TierConfig
|
|
76
|
+
|
|
77
|
+
# --- PhonMatchNet text encoder + cross-attention head ---
|
|
78
|
+
from ww_trainer.phonmatch import (
|
|
79
|
+
IPA_VOCAB,
|
|
80
|
+
ARPABET_TO_IPA,
|
|
81
|
+
PHONEME_VOCAB, # alias for IPA_VOCAB — backward compat
|
|
82
|
+
VOCAB_SIZE,
|
|
83
|
+
ipa_to_ids,
|
|
84
|
+
arpabet_to_ids,
|
|
85
|
+
phonemes_to_ids, # alias for arpabet_to_ids — backward compat
|
|
86
|
+
PhonMatchTextEncoder,
|
|
87
|
+
PhonMatchHead,
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
# --- Distillation ---
|
|
91
|
+
from ww_trainer.distill import CnnLstmExtractor, KnowledgeDistillationTrainer
|
|
92
|
+
|
|
93
|
+
# --- Metrics ---
|
|
94
|
+
from ww_trainer.metrics import (
|
|
95
|
+
DetectionReport,
|
|
96
|
+
compute_eer,
|
|
97
|
+
compute_far_frr,
|
|
98
|
+
find_optimal_threshold,
|
|
99
|
+
det_curve,
|
|
100
|
+
area_under_det,
|
|
101
|
+
classification_report,
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
# --- Checkpoint helpers ---
|
|
105
|
+
from ww_trainer.checkpoint import (
|
|
106
|
+
save_checkpoint,
|
|
107
|
+
average_checkpoints,
|
|
108
|
+
select_best_checkpoints,
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
# --- Factory ---
|
|
112
|
+
from ww_trainer.factory import (
|
|
113
|
+
create_model, EXTRACTOR_REGISTRY, HEAD_REGISTRY,
|
|
114
|
+
register_extractor, register_head,
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
# --- Evaluation ---
|
|
118
|
+
from ww_trainer.evaluation import evaluate_model, evaluate_detection, log_metrics_csv
|
|
119
|
+
|
|
120
|
+
# --- Quantization ---
|
|
121
|
+
from ww_trainer.quantize import quantize_onnx, quantize_model_pair, QuantizationReport
|
|
122
|
+
|
|
123
|
+
# --- Reproducibility ---
|
|
124
|
+
from ww_trainer.reproducibility import set_seed, get_seed_info
|
|
125
|
+
|
|
126
|
+
# --- Augmentation ---
|
|
127
|
+
from ww_trainer.augment import (
|
|
128
|
+
AugmentationPipeline,
|
|
129
|
+
AudioTransform,
|
|
130
|
+
MixBackground,
|
|
131
|
+
ApplyReverb,
|
|
132
|
+
PitchShift,
|
|
133
|
+
SpeedPerturb,
|
|
134
|
+
GaussianNoise,
|
|
135
|
+
VolumePerturb,
|
|
136
|
+
TimeShift,
|
|
137
|
+
SpecAugment,
|
|
138
|
+
Normalize,
|
|
139
|
+
)
|