--- id: torchfcpe version: "0.0.4" license: MIT license_treatment: permissive maintenance: aging --- # torchfcpe — The official Pytorch implementation of Fast Context-based Pitch Estimation (FCPE) License: permissive · Maintenance: aging · Downloads: 143.5K/mo ## 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 above — 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 pip install torchfcpe uv add torchfcpe 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: unspecified - Install friction: low - Maintenance: aging - Downloads: 143.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags pitch detection audio, fundamental frequency estimation, f0 extraction pytorch, speech pitch analysis, music pitch detection, fcpe pitch estimator, audio f0 extraction, audio-processing, pitch-detection, deep-learning [View on SkillFed](https://skillfed.io/packages/torchfcpe) · [View on PyPI](https://pypi.org/project/torchfcpe/)