CoolFace
Modelpublic

smkrv/speech-emotion-classification-onnx

sourceHugging Faceapache-2.0updated 7mo agoView on Hugging Face
1likes
Model Card

Speech Emotion Classification — ONNX (INT8)

ONNX INT8-quantized version of prithivMLmods/Speech-Emotion-Classification for on-device inference in macOS apps via ONNX Runtime C API.

Model Details

  • —Architecture: Wav2Vec2ForSequenceClassification (facebook/wav2vec2-base-960h fine-tuned)
  • —Format: ONNX INT8 quantized
  • —Size: ~91 MB (INT8), ~361 MB (FP32)
  • —Input: Raw audio waveform (16kHz, mono), shape [1, num_samples]
  • —Output: 8-class emotion logits

Emotion Labels

IDLabelFull
0ANGAnger
1CALCalm
2DISDisgust
3FEAFear
4HAPHappy
5NEUNeutral
6SADSad
7SURSurprised

Usage

On-device real-time speech emotion classification. Inference via ONNX Runtime C API.

swift
// Swift — load and run via OnnxRuntimeWrapper
let wrapper = OnnxRuntimeWrapper()
try wrapper.load(modelPath: "model_int8.onnx")
let logits = try wrapper.run(inputName: "input_values", inputData: audioBuffer, inputShape: [1, Int64(audioBuffer.count)])
let emotionIdx = logits.firstIndex(of: logits.max()!)!

Files

  • —model_int8.onnx — INT8 quantized model (recommended for on-device use)
  • —model.onnx — FP32 full precision model
  • —config.json — Model configuration with label mappings

Attribution

Original model by prithivMLmods. Converted to ONNX by onnx-community. INT8 quantization and packaging for macOS by @smkrv.