CoolFace
Apppublic

JahnaviBhansali/wakeword

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
App README

๐ŸŽค Wav2Vec2 Wake Word Detection Demo

A powerful, interactive wake word detection demo built with Hugging Face Transformers and Gradio. This demo uses the proven Wav2Vec2 model with verified Hugging Face Spaces compatibility (73 active Spaces, 4,758 monthly downloads).

โœจ Features

  • โ€”State-of-the-art Wake Word Detection: Uses Wav2Vec2 Base model fine-tuned for keyword spotting
  • โ€”Interactive Web Interface: Clean, modern Gradio interface with audio recording and upload
  • โ€”Real-time Processing: Instant wake word detection with confidence scores
  • โ€”12 Keyword Classes: Detects "yes", "no", "up", "down", "left", "right", "on", "off", "stop", "go" plus silence and unknown
  • โ€”Microphone Support: Record audio directly in the browser or upload audio files
  • โ€”Example Audio: Synthetic audio generation for quick testing
  • โ€”Responsive Design: Works on desktop and mobile devices
  • โ€”Spaces Verified: Proven to work reliably on Hugging Face Spaces (73 active implementations)

๐Ÿš€ Quick Start

Online Demo

Visit the Hugging Face Space to try the demo immediately in your browser.

Local Installation

  1. 1.Clone the repository:
bash
git clone <your-repo-url>
cd wake-word-demo
  1. 1.Install dependencies:
bash
pip install -r requirements.txt
  1. 1.Run the demo:
bash
python app.py
  1. 1.Open your browser and navigate to the local URL (typically http://localhost:7860)

๐Ÿ”ง Technical Details

Model Information

  • โ€”Model: superb/wav2vec2-base-superb-ks
  • โ€”Architecture: Wav2Vec2 Base fine-tuned for keyword spotting
  • โ€”Dataset: Speech Commands dataset v1.0
  • โ€”Accuracy: 96.4% on test set
  • โ€”Parameters: ~95M parameters
  • โ€”Input: 16kHz audio samples
  • โ€”Spaces Usage: 73 active Spaces (verified compatibility)

Performance Metrics

  • โ€”Accuracy: 96.4% on Speech Commands dataset
  • โ€”Model Size: 95M parameters
  • โ€”Inference Time: ~200ms (CPU), ~50ms (GPU)
  • โ€”Sample Rate: 16kHz
  • โ€”Supported Keywords: yes, no, up, down, left, right, on, off, stop, go, silence, unknown
  • โ€”Monthly Downloads: 4,758 (highly trusted)

Supported Audio Formats

  • โ€”WAV, MP3, FLAC, M4A
  • โ€”Automatic resampling to 16kHz
  • โ€”Mono and stereo support (automatically converted to mono)

๐ŸŽฏ Use Cases

  • โ€”Voice Assistants: Wake word detection for smart devices
  • โ€”IoT Applications: Voice control for embedded systems
  • โ€”Accessibility: Voice-controlled interfaces
  • โ€”Smart Home: Voice commands for home automation
  • โ€”Mobile Apps: Offline keyword detection

๐Ÿ› ๏ธ Customization

Adding New Keywords

To add support for additional keywords, you would need to:

  1. 1.Fine-tune the model on your custom keyword dataset
  2. 2.Update the model configuration
  3. 3.Modify the interface labels

Changing Audio Settings

Edit the audio processing parameters in app.py:

python
# Audio configuration
SAMPLE_RATE = 16000  # Required by the model
MAX_AUDIO_LENGTH = 1.0  # seconds

Interface Customization

Modify the Gradio interface theme and styling in the app.py file to match your branding.

๐Ÿ“Š Model Comparison

ModelAccuracySizeSpeedKeywordsSpaces Usage
Wav2Vec2-Base-KS96.4%95MFast12 classes73 Spaces โœ“
HuBERT-Large-KS95.3%300MSlower12 classes0 Spaces โŒ
DistilHuBERT-KS97.1%24MFastest12 classesUnknown

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.

Development Setup

  1. 1.Fork the repository
  2. 2.Create a feature branch
  3. 3.Make your changes
  4. 4.Test thoroughly
  5. 5.Submit a pull request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • โ€”Hugging Face: For the Transformers library and model hosting
  • โ€”SUPERB Benchmark: For the fine-tuned keyword spotting models
  • โ€”Speech Commands Dataset: For the training data
  • โ€”Gradio: For the excellent web interface framework

๐Ÿ“š References


Built with โค๏ธ using Hugging Face Transformers and Gradio

โœ… Verified to work on Hugging Face Spaces