Skip to content

pchampio/yaapt.torch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yaapt.torch

Implementation of the YAAPT pitch tracker in PyTorch.
This version relies solely on PyTorch, does not hog all CPU threads (making it possible to use in a dataloader), is torch.jit-able, and is batch compatible.

Setup

For using (no development required)

pip install yaapt.torch

To install for development, clone the repository, and then run the following from within the root directory.

pip install -e .

Usage

import torchaudio, yaapt_torch
audio, sr = torchaudio.load("audio.wav")

yaapt_opts = {
    "sr": sr,
    "frame_length": 35.0,
    "frame_space": 20.0,
    "nccf_thresh1": 0.25,
    "tda_frame_length": 25.0,
}

pitch = yaapt_torch.yaapt(
    audio, # (Batch, feature) torch.tensor input
    yaapt_opts,
)
print(pitch) # (Batch, F0) torch.tensor output

Credits

This repository aims to wrap up these implementations in easy-installable PyPi packages, which can be used directly in PyTorch based neural network training.

Citing

If you find this repository useful, please cite our project:

@misc{yaapt_torch,
  author = {Pierre Champion},
  title = {The YAAPT pitch tracker in PyTorch},
  year = {2024},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/pchampio/yaapt.torch}},
}

About

YAAPT Pitch Tracking function in PyTorch

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages