DeepFilterNet3 WASM and model assets for noise suppression
npm install deepfilternet3-assetsDeepFilterNet3 WASM and model assets for noise suppression.
``bash`
npm install deepfilternet3-assetsor
yarn add deepfilternet3-assets
This package includes:
- pkg/df_bg.wasm - DeepFilterNet3 WebAssembly binarymodels/DeepFilterNet3_onnx.tar.gz
- - DeepFilterNet3 ONNX model
`javascript
const { getWasmPath, getModelPath, getAssetPaths } = require('deepfilternet3-assets');
// Get individual paths
const wasmPath = getWasmPath();
const modelPath = getModelPath();
// Or get both at once
const { wasm, model } = getAssetPaths();
`
For web applications, you can use the relative paths:
`javascript
const { WASM_RELATIVE_PATH, MODEL_RELATIVE_PATH } = require('deepfilternet3-assets');
// Then use with your bundler's asset handling
// For example, with Webpack or Vite
`
You can copy these files to your static assets directory or CDN:
`javascript
const fs = require('fs');
const { getAssetPaths } = require('deepfilternet3-assets');
const assets = getAssetPaths();
// Copy to your public directory
fs.copyFileSync(assets.wasm, './public/wasm/df_bg.wasm');
fs.copyFileSync(assets.model, './public/models/DeepFilterNet3_onnx.tar.gz');
`
This package includes TypeScript type definitions:
`typescript
import { getAssetPaths, WASM_RELATIVE_PATH, MODEL_RELATIVE_PATH } from 'deepfilternet3-assets';
const { wasm, model } = getAssetPaths();
// Use relative paths for URLs
console.log(WASM_RELATIVE_PATH); // 'pkg/df_bg.wasm'
console.log(MODEL_RELATIVE_PATH); // 'models/DeepFilterNet3_onnx.tar.gz'
`
- WASM file: 8.8 MB
- Model file: 7.7 MB
- Total package size: ~10.4 MB (compressed), ~17.1 MB (unpacked)
Make sure your CDN or server can handle these file sizes efficiently.
- getWasmPath() - Returns absolute path to the WASM filegetModelPath()
- - Returns absolute path to the model filegetAssetPaths()
- - Returns object with both asset paths: { wasm: string, model: string }
- WASM_RELATIVE_PATH - Relative path to WASM file: 'pkg/df_bg.wasm'MODEL_RELATIVE_PATH
- - Relative path to model file: 'models/DeepFilterNet3_onnx.tar.gz'`
See example.js for a complete working example.
(Apache-2.0 OR MIT)
DeepFilterNet3 is developed by Rikorose. This package only distributes the compiled assets.