Giter Site home page Giter Site logo

tandav / pitch-detectors Goto Github PK

View Code? Open in Web Editor NEW
17.0 2.0 1.0 771 KB

collection of pitch (f0, fundamental frequency) detection algorithms with unified interface

Python 96.76% Dockerfile 3.24%
f0-detection f0-estimation fundamental-frequency-estimation pitch-detection pitch-estimation pitch-tracking

pitch-detectors's Introduction

pipeline status

pitch-detectors

collection of pitch (f0, fundamental frequency) detection algorithms with unified interface

list of algorithms

algorithm cpu gpu MDBStemSynth accuracy Mir1K accuracy
Crepe 0.886 ± 0.059 0.759 ± 0.073
Penn 0.699 ± 0.263 0.660 ± 0.090
PipTrack 0.524 ± 0.286 0.864 ± 0.071
PraatAC 0.777 ± 0.302 0.859 ± 0.074
PraatCC 0.776 ± 0.300 0.872 ± 0.068
PraatSHS 0.534 ± 0.238 0.578 ± 0.169
Pyin 0.722 ± 0.252 0.888 ± 0.047
Rapt 0.791 ± 0.282 0.827 ± 0.078
Reaper 0.792 ± 0.261 0.795 ± 0.083
Spice 0.024 ± 0.034 0.889 ± 0.046
Swipe 0.784 ± 0.276 0.796 ± 0.062
TorchCrepe 0.764 ± 0.273 0.774 ± 0.084
TorchYin 0.735 ± 0.268 0.866 ± 0.052
World 0.869 ± 0.135 0.842 ± 0.075
Yaapt 0.740 ± 0.271 0.744 ± 0.107
Yin 0.749 ± 0.269 0.884 ± 0.043

accuracy is mean raw pitch accuracy

install

pip install pitch-detectors

All agorithms tested on python3.12, this is recommended python version to use

usage

from scipy.io import wavfile
from pitch_detectors import algorithms
import matplotlib.pyplot as plt

fs, a = wavfile.read('data/b1a5da49d564a7341e7e1327aa3f229a.wav')
pitch = algorithms.Crepe(a, fs)
plt.plot(pitch.t, pitch.f0)
plt.show()

Alt text Colab notebook with plots for all algorithms/models

additional features

  • robust (vote + median) ensemble algorithm using all models
  • json import/export

notes:

Tests are running in subprocess (using scripts/run_algorithm.py) to avoid pytorch cuda import caching. It's difficult to disable gpu after it has been initialized. (pytorch/pytorch#9158) It is also difficult to set correct PATH and LD_LIBRARY_PATH without a subprocess.

pitch-detectors's People

Contributors

tandav avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

runngezhang-jx

pitch-detectors's Issues

Colab script

Can you please share a colab notebook with all the algorithms and plots for a file?

I am facing an issue with

  • penn
  • torchcrepe

add benchmarks on some dataset

Add median to comparison

The MIR-1k [17] dataset contains
1000 audio tracks with people singing Chinese pop songs. The
dataset is annotated with pitch at a granularity of 10 ms and
it also contains voiced/unvoiced frame annotations. It comes
with two stereo channels representing, respectively, the singing
voice and the accompaniment music.

pitch ground truth labels in PitchLabel (.pv files) are midi-note values, not hz. You have to convert it to get f0

Use right channel in Wavfile folder

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.