skillfed

torchfcpe

The official Pytorch implementation of Fast Context-based Pitch Estimation (FCPE)

torchfcpe v0.0.4 143.5K downloads/30d#11,177 on PyPI210
Permissive license MIT AGING released

What it is and what it does

TorchFCPE is a PyTorch implementation of Fast Context-based Pitch Estimation (FCPE), a neural network model for extracting fundamental frequency (F0) from audio signals. It's designed for both speech and music analysis, taking raw audio waveforms and producing frame-by-frame pitch estimates. The package wraps a pre-trained model accessible via `spawn_bundled_infer_model()`, which you can then call with audio tensors and configuration parameters like sample rate, decoder mode, and frequency bounds.

The model itself is a standard PyTorch module, so it integrates with the PyTorch ecosystem—you can move it between devices, compile it, or fine-tune it like any other `torch.nn.Module`. It depends on einops and local-attention for its internal computations, and expects audio as a PyTorch tensor. The inference API accepts optional parameters for V/UV (voiced/unvoiced) thresholding, frequency range constraints, and output interpolation.

Use it for:

  • Extract pitch contours from speech recordings for prosody analysis or voice conversion pipelines.
  • Estimate fundamental frequency from musical recordings for melody extraction or music analysis.
  • Preprocess audio for singing voice synthesis or pitch-based audio effects.
  • Build real-time pitch tracking systems by integrating the model into streaming audio applications.
  • Validate or compare pitch estimates from other methods in audio research workflows.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

TorchFCPE estimates fundamental frequency (pitch) from audio using a PyTorch implementation of Fast Context-based Pitch Estimation, suitable for speech and music analysis.

Yes, if you need robust pitch estimation in PyTorch. The package has low install friction, permissive licensing, and no known vulnerabilities. However, maintenance is aging—the last release was March 2024 with no recent commits—so expect limited support for bugs or compatibility issues with newer PyTorch versions. Suitable for research and production use where pitch extraction is a component, not a primary concern.

Install

torchfcpe on PyPI

pip

pip install torchfcpe

uv

uv add torchfcpe

poetry

poetry add torchfcpe

Installing torchfcpe

Before you install

Low friction installation with a pure Python wheel. Maintenance status is aging—last release was 2024-03-06 and the repository shows no recent commits, though it remains unarchived with 210 stars.

License in practice

MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute the package freely provided you retain the license notice.

Quickstart

pip install torchfcpe

from torchfcpe import spawn_bundled_infer_model
import torch

model = spawn_bundled_infer_model(device='cpu')
f0 = model.infer(audio, sr=16000, decoder_mode='local_argmax', threshold=0.006)

Requires torch and torchaudio as runtime dependencies; audio input must be a torch.Tensor with appropriate shape and sample rate.

Verify before relying

  • Whether the bundled model weights are automatically downloaded on first use or require manual setup.
  • Supported audio formats and preprocessing requirements beyond the librosa example shown.
  • Performance characteristics (inference speed, memory usage) on typical hardware.
  • Whether Python version constraints exist despite requires_python being unspecified.

Package facts

License MIT (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 5 — einops, local-attention, torch, torchaudio, numpy
Maintenance aging — 891 days since the last release
Last repo commit
First released
Downloads 143,468/month — #11,177 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: torchfcpe-0.0.4-py3-none-any.whl

Keywords: pitch, audio, speech, music, pytorch, fcpe

License :: OSI Approved :: MIT License

Tags

pitch detection audiofundamental frequency estimationf0 extraction pytorchspeech pitch analysismusic pitch detectionfcpe pitch estimatoraudio f0 extraction
audio-processingpitch-detectiondeep-learning

More Artificial Intelligence packages