openwakeword-js 0.1.4 → 0.1.6
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.
- package/README.md +13 -7
- package/example/index.html +1 -1
- package/package.json +1 -1
- package/scripts/download_models.js +4 -8
package/README.md
CHANGED
|
@@ -98,13 +98,19 @@ if (scores["my_custom_model"] > 0.5) {
|
|
|
98
98
|
|
|
99
99
|
## Local Development & Demo
|
|
100
100
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
1.
|
|
104
|
-
2.
|
|
105
|
-
3.
|
|
106
|
-
4.
|
|
107
|
-
|
|
101
|
+
### Option A: The Fast Start (Automated)
|
|
102
|
+
If you just want to see it working:
|
|
103
|
+
1. `npm install openwakeword-js onnxruntime-web`
|
|
104
|
+
2. `npx openwakeword-js-setup`
|
|
105
|
+
3. `npx serve .`
|
|
106
|
+
4. Open `http://localhost:3000`
|
|
107
|
+
|
|
108
|
+
### Option B: Manual Development
|
|
109
|
+
If you are developing inside this repository:
|
|
110
|
+
1. Clone the repo and run `npm install`.
|
|
111
|
+
2. Run `npm run download-models`.
|
|
112
|
+
3. Serve the root directory using a static server (e.g., `npx serve .`).
|
|
113
|
+
4. Navigate to `http://localhost:3000/example/index.html`.
|
|
108
114
|
|
|
109
115
|
---
|
|
110
116
|
|
package/example/index.html
CHANGED
|
@@ -435,7 +435,7 @@
|
|
|
435
435
|
<!-- Scripts -->
|
|
436
436
|
<script src="https://cdn.jsdelivr.net/npm/onnxruntime-web/dist/ort.min.js"></script>
|
|
437
437
|
<script type="module">
|
|
438
|
-
import { Model } from 'https://cdn.jsdelivr.net/npm/openwakeword-js/dist/index.mjs';
|
|
438
|
+
import { Model } from 'https://cdn.jsdelivr.net/npm/openwakeword-js@0.1.4/dist/index.mjs';
|
|
439
439
|
|
|
440
440
|
const elements = {
|
|
441
441
|
orb: document.getElementById('orbOuter'),
|
package/package.json
CHANGED
|
@@ -11,7 +11,9 @@ const MODELS_DIR = path.join(process.cwd(), 'models');
|
|
|
11
11
|
const MODELS = {
|
|
12
12
|
'melspectrogram.onnx': 'https://github.com/dscripka/openWakeWord/raw/main/openwakeword/resources/models/melspectrogram.onnx',
|
|
13
13
|
'embedding_model.onnx': 'https://github.com/dscripka/openWakeWord/raw/main/openwakeword/resources/models/embedding_model.onnx',
|
|
14
|
-
'silero_vad.onnx': 'https://github.com/dscripka/openWakeWord/raw/main/openwakeword/resources/models/silero_vad.onnx'
|
|
14
|
+
'silero_vad.onnx': 'https://github.com/dscripka/openWakeWord/raw/main/openwakeword/resources/models/silero_vad.onnx',
|
|
15
|
+
'hello_deepa.onnx': 'https://github.com/Firojpaudel/OpenWakeWord_npm_porting/raw/main/models/hello_deepa.onnx',
|
|
16
|
+
'namaste_deepa.onnx': 'https://github.com/Firojpaudel/OpenWakeWord_npm_porting/raw/main/models/namaste_deepa.onnx'
|
|
15
17
|
};
|
|
16
18
|
|
|
17
19
|
async function downloadFile(url, dest) {
|
|
@@ -64,13 +66,7 @@ async function main() {
|
|
|
64
66
|
console.log(`Failed: ${err.message}`);
|
|
65
67
|
}
|
|
66
68
|
}
|
|
67
|
-
console.log('\
|
|
68
|
-
const packageModelsDir = path.join(packageRoot, 'models');
|
|
69
|
-
['hello_deepa.onnx', 'namaste_deepa.onnx'].forEach(m => {
|
|
70
|
-
const src = path.join(packageModelsDir, m);
|
|
71
|
-
const dest = path.join(MODELS_DIR, m);
|
|
72
|
-
copyIfExists(src, dest, 'Model');
|
|
73
|
-
});
|
|
69
|
+
console.log('\nBase and sample models are ready.');
|
|
74
70
|
|
|
75
71
|
console.log('\nLocating ONNX Runtime WebAssembly files...');
|
|
76
72
|
const nodeModulesPath = path.join(process.cwd(), 'node_modules', 'onnxruntime-web', 'dist');
|