Skip to main content

Robust pitch prediction using PyTorch

Project description

RobPitch

Overview

RobPitch is a pitch detection model trained to be robust against noise and reverberation environments. The model has been trained on 1600 hours of high-quality data, supplemented by an equivalent amount of simulated noisy and reverberant data, ensuring effective performance under challenging acoustic conditions.

Installation via pip

Install RobPitch using the following command:

pip install rob-pitch==0.1.2

Example of Usage

import robpitch

# Init model
model = robpitch.load_model()

# process the audio
outputs = model.infer("path/to/audio")
pitch = outputs['pitch']
latent_feature = outputs['latent']

Local Setup

Model Download

  • Download the model from model

Example of Local Usage

import torch
import numpy as np

from robpitch import RobPitch
from utils.audio import load_audio

# Initialize the model
robpitch = RobPitch()
device = torch.device("cpu")

# Load model from checkpoint
model = robpitch.load_from_checkpoint(
    config_path="config.yaml",
    ckpt_path="model.bin",
    device=device
)

# Load and process the audio
wav = load_audio(
    "path/to/audio",
    sampling_rate=16000,
    volume_normalize=True
)
wav = torch.from_numpy(wav).unsqueeze(0).float().to(device)

# Get model outputs
outputs = model(wav)
pitch = outputs['pitch']
latent_feature = outputs['latent']

For more detailed usage examples, refer to the exp/demo.ipynb notebook.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rob_pitch-0.1.2.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rob_pitch-0.1.2-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

Details for the file rob_pitch-0.1.2.tar.gz.

File metadata

  • Download URL: rob_pitch-0.1.2.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for rob_pitch-0.1.2.tar.gz
Algorithm Hash digest
SHA256 7d3c5f9b7dbb71fab1a38f8fd0d0848e3d44645ed2effc18675a1c1db719f10f
MD5 cfa2fe65c7fc71083cd5db5aa1d31409
BLAKE2b-256 1d1c0dfdfbfd1e62f1702569a7bd395da6df0d39ef97a5b5b262f8bdafd684e7

See more details on using hashes here.

File details

Details for the file rob_pitch-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: rob_pitch-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 17.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for rob_pitch-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3341452ec9a25050336242e327046033be966dc2f073e448d983671a60f0b981
MD5 4c6e712c94d59b92b81bd593ba210ceb
BLAKE2b-256 61b7d5e813030599f6e8b55340329d6d79488e223a9b43f7475ab2f98efb82fd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page