🧠 soundKIT Voice Activity Detection (VAD) Tutorial¶
This tutorial walks you through using the soundKIT CLI for VAD tasks including data preparation, training, evaluation, TFLite export, and embedded deployment.
In [ ]:
Copied!
# ⚙️ Setup
# Set working directory to project root (one level up)
import os
os.chdir("..")
print("✅ Working directory set to project root:", os.getcwd())
# ⚙️ Setup
# Set working directory to project root (one level up)
import os
os.chdir("..")
print("✅ Working directory set to project root:", os.getcwd())
In [ ]:
Copied!
# Clone the soundKIT repo
!git clone https://github.com/AmbiqAI/soundkit.git
%cd soundkit
# Clone the soundKIT repo
!git clone https://github.com/AmbiqAI/soundkit.git
%cd soundkit
In [ ]:
Copied!
# Install required dependencies
!pip install -e .
# Install required dependencies
!pip install -e .
🔧 Configuration¶
In [ ]:
Copied!
# Show editable VAD training config
config_path = "configs/vad.yaml"
with open(config_path, "r") as f:
print(f.read())
# Show editable VAD training config
config_path = "configs/vad.yaml"
with open(config_path, "r") as f:
print(f.read())
📁 Step 1: Prepare Data¶
In [ ]:
Copied!
!soundkit -t vad -m data -c configs/vad.yaml
!soundkit -t vad -m data -c configs/vad.yaml
🎯 Step 2: Train Model¶
In [ ]:
Copied!
!soundkit -t vad -m train -c configs/vad.yaml
!soundkit -t vad -m train -c configs/vad.yaml
To monitor training with TensorBoard:
In [ ]:
Copied!
!soundkit -t vad -m train --tensorboard -c configs/vad.yaml
!soundkit -t vad -m train --tensorboard -c configs/vad.yaml
Then run this in another terminal:
In [ ]:
Copied!
# tensorboard --logdir=soundkit/tasks/vad/tensorboard/your_run
# tensorboard --logdir=soundkit/tasks/vad/tensorboard/your_run
📊 Step 3: Evaluate Model¶
In [ ]:
Copied!
!soundkit -t vad -m evaluate -c configs/vad.yaml
!soundkit -t vad -m evaluate -c configs/vad.yaml
📤 Step 4: Export Model to TFLite¶
In [ ]:
Copied!
!soundkit -t vad -m export -c configs/vad.yaml
!soundkit -t vad -m export -c configs/vad.yaml
🚀 Step 5: Deploy to Embedded EVB (e.g., Apollo)¶
In [ ]:
Copied!
!soundkit -t vad -m demo -c configs/vad.yaml # For EVB demo, ensure you have a microphone connected
!soundkit -t vad -m demo -c configs/vad.yaml demo.platform=pc # For PC demo, ensure you have a microphone connected
!soundkit -t vad -m demo -c configs/vad.yaml # For EVB demo, ensure you have a microphone connected
!soundkit -t vad -m demo -c configs/vad.yaml demo.platform=pc # For PC demo, ensure you have a microphone connected
✅ Notes¶
- Edit
vad.yamlto adjust model hyperparameters, features, and output paths - Log files and detection visualizations are saved under the configured test and training folders