How to use @tensorflow-models/speech-commands - 3 common examples

To help you get started, we’ve selected a few @tensorflow-models/speech-commands examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ml5js / ml5-library / src / SoundClassifier / speechcommands.js View on Github external
async load(url) {
    if (url) {
      const split = url.split("/");
      const prefix = split.slice(0, split.length - 1).join("/");
      const metadataJson = `${prefix}/metadata.json`;
      this.model = tfjsSpeechCommands.create('BROWSER_FFT', undefined, url, metadataJson);
    } else this.model = tfjsSpeechCommands.create('BROWSER_FFT');
    await this.model.ensureModelLoaded();
    this.allLabels = this.model.wordLabels();
  }
github ml5js / ml5-library / src / SoundClassifier / speechcommands.js View on Github external
async load(url) {
    if (url) {
      const split = url.split("/");
      const prefix = split.slice(0, split.length - 1).join("/");
      const metadataJson = `${prefix}/metadata.json`;
      this.model = tfjsSpeechCommands.create('BROWSER_FFT', undefined, url, metadataJson);
    } else this.model = tfjsSpeechCommands.create('BROWSER_FFT');
    await this.model.ensureModelLoaded();
    this.allLabels = this.model.wordLabels();
  }
github ralscha / blog2019 / tfjs-models / src / app / speech / speech.page.ts View on Github external
constructor(private readonly router: Router) {
    this.recognizer = speechCommands.create('BROWSER_FFT');
    this.recognizer.ensureModelLoaded().then(() => {
      this.wordLabels = this.recognizer.wordLabels();
      this.whitelistIndex = this.wordLabels.map((value, index) => {
        if (this.whitelistWords.indexOf(value) !== -1) {
          return index;
        }
      }).filter(value => value !== undefined);
    });
  }

@tensorflow-models/speech-commands

Speech-command recognizer in TensorFlow.js

Apache-2.0
Latest version published 4 years ago

Package Health Score

69 / 100
Full package analysis

Popular @tensorflow-models/speech-commands functions

Similar packages