CREPE for MLX β€” original MARL weights, converted

Converted weights of CREPE (Convolutional Representation for Pitch Estimation) for MLX on Apple Silicon. These are the original pretrained CREPE networks, not retrained or re-derived: each float32 tensor is the pinned upstream HDF5 tensor, renamed into MLX's layout and validated by SHA-256 per file and per bundle.

The network is a CNN on raw 1024-sample frames of 16 kHz audio, predicting 360-bin pitch salience at 10 ms frame rate.

Attribution

This is an independent conversion of MARL CREPE, the reference implementation of

Kim, Park, Lee, Kwon, Kim, Lee, Nam β€” CREPE: A Convolutional Representation for Pitch Estimation, ICASSP 2018 Β· arXiv:1802.06182

Upstream project github.com/marl/crepe
Source commit c9b71ce61491454125a0693f584f7244f29d9884 (v0.0.16)
Weights commit bb29b8d99a89924476d112d27ed470e4ac5617c0 (branch models)
License MIT, Copyright Β© 2018 Jong Wook Kim β€” see LICENSE
PyTorch port (credited) maxrmorrison/torchcrepe, MIT Β© 2020 Max Morrison

The weights are distributed inside the MIT-licensed marl/crepe repository; this repository redistributes them in converted form under the same license and makes no separate weight-license claim. Nothing here is official MARL output.

Capacities

Capacity Parameters Artifact Bundle SHA-256
tiny 487,096 weights/v1/tiny-4160316c659e72b7 4160316c659e72b765c572a3f71a5e09bc7244037fc422db6818f35b0e87f435
small 1,629,192 weights/v1/small-a1067df74eff4327 a1067df74eff4327123c76b872ab282cfdd037bf3e6e848461052bd68c4b008b
medium 5,879,464 weights/v1/medium-ac7747945d0da0c0 ac7747945d0da0c0f36871ce55371fb296c12cb98afa3c25f7c87144abe5ff4c
large 12,751,176 weights/v1/large-c8168d99c5666b6e c8168d99c5666b6e4cc77a3a569fb71f9adfb26a7fa3aa281055dd9bef4f2ba2
full 22,244,328 weights/v1/full-45a60f0f7f814cab 45a60f0f7f814cab0ee69804a6c0c9029c58d8a79dfd6c04899cfbcad196a13a

Capacity multipliers are the upstream ones: 4, 8, 16, 24, 32.

Layout

weights/v1/
  index.json                     # capacity -> artifact, bundle hash, parameter count
  full-45a60f0f7f814cab/
    manifest.json                # per-tensor name, shape, dtype, layout, sha256
    tensors/                     # 38 float32 .npy files, one per upstream tensor

manifest.json records, for every tensor, its upstream key, MLX key, layout (identity or transpose), shape, element count and SHA-256, and the artifact's bundle_sha256 covers the manifest plus every tensor. Load and verify it like this:

import hashlib, json, pathlib
import numpy as np

artifact = pathlib.Path("weights/v1/full-45a60f0f7f814cab")
manifest = json.loads((artifact / "manifest.json").read_text())
params = {t["name"]: np.load(artifact / t["file"]) for t in manifest["tensors"]}
print(manifest["parameter_count"], "parameters,", len(params), "tensors")
# every tensor is validated against t["sha256"] the same way; bundle_sha256 covers both

Inference

The reference implementation is crepe_mlx (this project), which composes preprocessing β†’ converted model β†’ decoder and keeps TensorFlow/PyTorch out of the runtime path:

import soundfile as sf, soxr
import crepe_mlx

y, sr = sf.read("speech.wav", dtype="float32", always_2d=True)
y = soxr.resample(y.mean(axis=1), sr, 16000)      # 16 kHz mono, as upstream

time, frequency, confidence, activation = crepe_mlx.predict(
    y, 16000, model_capacity="full", viterbi=False,
)
# one row per 10 ms frame: time [s], f0 [Hz] (NaN when no bin has salience),
# confidence = max salience, activation [frames, 360]

Additive keyword-only options: batch_size (default 256; bounded memory on long audio), device, models_root, dtype (float32 only), verify. predict(..., viterbi=True) adds offline Viterbi smoothing; it is non-causal and not a streaming path.

Fidelity

The conversion is validated frame by frame against an independent TensorFlow run of the pinned upstream source with genuine weights β€” 100 conditions across all five capacities, 16/44.1/48 kHz, both centering modes, 5/10/20 ms hops:

check measured gate
activation, model+decoder on identical normalized frames max abs 2.09e-06 atol 1e-4, rtol 1e-3
confidence max abs 1.68e-06 1e-4
F0 (voiced frames, 13,820) median worst 0.0016 cent, p99 worst 0.42 cent 0.1 / 1 cent
timestamps exact 1e-9 s
octave errors 0 β€”

Sixteen-kilohertz input is bit-identical to the oracle. On resampled input the runtime uses soxr HQ while the oracle shim used scipy.signal.resample_poly (its substitute for resampy), so the end-to-end elementwise gate does not apply to the two real 44.1 kHz excerpts; the model and decoder are held to it there via the oracle's own frames.

Speed

Apple M1 Max (32 GB), macOS 27, MLX 0.32.4, float32, GPU, batch 256, otherwise idle machine:

capacity audio RTF (compute s per audio s)
tiny 10 s 0.0067
tiny 30 s 0.0061
full 10 s 0.098
full 30 s 0.105
full, batch_size=1 10 s 1.18

RTF depends on batch size and hardware; it is not a comparison across runtimes. Peak memory for a 60 s input at batch 32 is ~190 MB, versus ~15 GB for a whole-input full-capacity pass.

Limitations

  • Monophonic pitch estimation; the upstream model's domain is speech and monophonic instruments. Not a polyphonic transcriber.
  • Centered framing and Viterbi are offline semantics β€” frame i is centred at i Γ— 10 ms and needs 512 samples of right context. Do not treat it as zero-latency streaming.
  • confidence is CREPE's maximum salience, not a calibrated voiced probability; the API applies no voicing threshold. Choose and document your own threshold, as benchmark comparisons do.
  • Only float32 is supported. Quantized or compiled variants are not shipped here.
  • Trained on upstream data; no training, fine-tuning or evaluation data is published here.

Citation

@inproceedings{kim2018crepe,
  title     = {{CREPE}: A Convolutional Representation for Pitch Estimation},
  author    = {Kim, Jong Wook and Salamon, Justin and Li, Peter and Bello, Juan Pablo},
  booktitle = {2018 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)},
  pages     = {161--165},
  year      = {2018},
  doi       = {10.1109/ICASSP.2018.8461329}
}
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Paper for clarsam/crepe-mlx