Skip to content

Refactor/migrate to pytorch and simplify architecture - #39

Merged
filippogiruzzi merged 12 commits into
masterfrom
refactor/migrate-to-pytorch-and-simplify-architecture
May 29, 2026
Merged

Refactor/migrate to pytorch and simplify architecture#39
filippogiruzzi merged 12 commits into
masterfrom
refactor/migrate-to-pytorch-and-simplify-architecture

Conversation

@filippogiruzzi

@filippogiruzzi filippogiruzzi commented May 29, 2026

Copy link
Copy Markdown
Owner

PR description

** 💥 Breaking change 💥 **
Migrate the Voice Activity Detection project from TensorFlow to a modern PyTorch stack and simplify the codebase. The legacy data_processing / training / inference packages are replaced by a flat vad/ package with four focused modules: data.py, model.py, train.py, inference.py.

Key features:

  • PyTorch Resnet1D acoustic model driven by a typed, frozen ModelConfig dataclass.
  • uv-based packaging via pyproject.toml (replaces setup.py / requirements.txt), with vad-data, vad-train, vad-inference console scripts.
  • Feature pipeline producing 16×65 tensors (5 MFCC + delta + delta² + RMS) from LibriSpeech audio.
  • loguru logging across all CLI entrypoints, automatic device selection (CUDA / Apple MPS / CPU), and TensorBoard logging.
  • Tooling & CI/CD: ruff lint/format, pytest with coverage in make test, updated Docker images, and refreshed GitHub Actions (CI lint+test, CD Docker build & push).
  • Docs: comprehensive open-source README and license alignment to GPL v3.

New behaviour

  • Train and export a model with uv run vad-train (checkpoints + TorchScript export, configurable --epochs, --batch-size, --lr, --n-filters, --fc-units).
  • Run predictions with uv run vad-inference (optional smoothing, visualization), using a ModelConfig that must match the trained architecture.
  • Build the feature dataset with uv run vad-data.
  • Device is selected automatically; training metrics are logged to TensorBoard.

Validation tests

  • uv run ruff check . — lint clean
  • uv run ruff format --check . — formatting clean
  • uv run pytest (with coverage) — integration tests pass
  • uv sync — package metadata/build valid (GPL-3.0 license)
  • CLI: uv run vad-data builds dataset on real LibriSpeech data
  • CLI: uv run vad-train trains, exports, and logs to TensorBoard
  • CLI: uv run vad-inference loads checkpoint and runs predictions

@filippogiruzzi
filippogiruzzi merged commit 77e311b into master May 29, 2026
1 check passed
@filippogiruzzi
filippogiruzzi deleted the refactor/migrate-to-pytorch-and-simplify-architecture branch May 29, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant