[Demo]
Decode motor intention from forearm surface EMG signals to control a macOS trackpad in real time.
EMGTrackpad captures surface EMG signals from a MindRove armband, trains neural networks to decode cursor movement and discrete actions (click, scroll), and drives the macOS trackpad in real time.
The repo has two components:
- Model (
src/emg/) — data collection, signal processing, model training, and real-time inference - Platform (
apps/platform/) — web app that presents structured tasks (e.g., click targets, drag paths) during data collection
git clone https://github.com/your-username/EMGTrackpad.git
cd EMGTrackpad && uv sync && uv pip install .
cd apps/platform && bun iCollect synchronized EMG and trackpad events into an HDF5 session file:
uv run python src/emg/track.pySessions are saved to data/session_YYYYMMDD_HHMMSS.h5.
Train a continuous controller (cursor movement + click/scroll actions):
uv run python -m emg.train_controller --config-name channel_attentionAvailable configs: rms, freq_rms, channel_attention, freq_rms_lstm, channel_attention_lstm
Run the trained model to control the macOS trackpad:
uv run python -m emg.inference.controller checkpoint=path/to/checkpoint.ptRun the web app for presenting structured tasks while recording EMG data:
cd apps/platform
bun devThen open http://localhost:3000.
