ydqmkkx)LICENSE, preserving the original copyright)respiro-en.pt
checkpoint. No retraining or architectural change was performed; the network is
numerically identical to the original within float tolerance (max abs diff of the
per-frame probabilities vs. the original PyTorch model ≈ 3e-6 across the upstream
sample clips).respiro-en.onnx (opset 17)feat — float32 [1, 3, 128, T]
librosa.power_to_db(melspectrogram(...), ref=np.max))n_fft=400, hop_length=160 (10 ms hop), n_mels=128,
Slaney mel scale (htk=False), power=2.0, power_to_db(ref=np.max, top_db=80)prob — float32 [1, T], per-frame breath probability in [0, 1] (10 ms hop)T (sequence length) is dynamic.Note on the export: the original network feeds alengthtensor to a torchaudio Conformer purely to build a self-attention padding mask. For a single, full-length (batch=1, unpadded) input that mask is all-valid, so it has no effect on the output. To make the exported graph robust to arbitraryT, thetorch.nn.MultiheadAttentionmodules were replaced with an equivalent dynamic-shape implementation (same weights) before export, which removed the need for thelengthinput. The exported model therefore has a single input,feat.
Tools/convert_respiro_onnx.py in the pbCosmo repository (one-time,
offline). The C++ application (pbCosmo) replicates the exact librosa/torch feature
extraction natively and runs this ONNX via ONNX Runtime.