Instructions to use SayedShaun/resemble-enhance-litert with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT
How to use SayedShaun/resemble-enhance-litert with LiteRT:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Resemble Enhance LiteRT
Experimental Resemble Enhance conversion for local speech denoising and enhancement. Choose the model weight format with dtype:
| dtype | Approximate model size | Description |
|---|---|---|
"fp32" |
1.42 GB | Float32 weights. |
"fp16" |
712 MB | Float16-stored weights; default. |
"int8" |
360 MB | Experimental INT8 weights; the vocoder uses weight-only quantization. |
All versions have float32 inputs and outputs. INT8 is a mixed quantization configuration, not a fully integer model; parts of the pipeline use floating-point computation.
Original model author: Resemble AI
License: MIT, copyright ยฉ 2023 Resemble AI
Python inference
Tested on Linux x86-64 with Python 3.12. Install the dependencies and download the inference class:
pip install 'huggingface_hub>=0.23,<3' ai-edge-litert==2.1.2 'numpy>=1.26,<3' 'scipy>=1.11,<2' 'soundfile>=0.12,<1'
hf download SayedShaun/resemble-enhance-litert inference.py --local-dir .
Create the class with the repository ID and enhance a file:
import soundfile as sf
from inference import ResembleEnhancer
model = ResembleEnhancer("SayedShaun/resemble-enhance-litert", dtype="int8")
audio, sample_rate = model.enhance("input.wav")
sf.write("enhanced.wav", audio, sample_rate)
The constructor downloads only the selected model files from the Hub and uses the Hugging Face cache. Set dtype="fp32", "fp16" (the default), or "int8"; from_pretrained(repo_id, dtype=...) accepts the same option. Inference runs locally. You can also pass a mono or (frames, channels) NumPy float array with model.enhance(samples, sample_rate=16000). The returned audio is mono float32 at 44.1 kHz.
inference.py runs the neural networks using ai-edge-litert; NumPy and SciPy provide audio processing and the flow solver. PyTorch is not needed. It processes overlapping one-second windows.
Android Kotlin
Copy inference.kt into your Android project and add these Gradle dependencies:
implementation("com.google.ai.edge.litert:litert:2.3.0")
implementation("com.github.wendykierp:JTransforms:3.1")
The tested project uses Kotlin 2.4.0, compile SDK 35, and minimum SDK 24. Copy the five files for the chosen dtype from models/, plus mel-filters.f32, into a readable directory on the device. Run inference on a worker thread with mono 44.1 kHz floating-point samples:
import android.content.Context
import com.example.resembleandroid.ResembleEnhancer
import java.io.File
// Call on a worker thread with decoded mono 44.1 kHz audio.
fun enhanceAudio(context: Context, samples: FloatArray): FloatArray =
ResembleEnhancer(File(context.filesDir, "models"), dtype = "int8").use { engine ->
engine.enhance(samples)
}
Use dtype = "fp32", "fp16" (default), or "int8". The Kotlin API expects decoded samples; the caller handles file decoding, resampling, playback and output encoding. The source compiles and its DSP and solver unit tests pass, but the complete Android pipeline has not been run on a device or emulator. Android runtime compatibility, performance and output quality still need testing.
Limitations
This is an experimental conversion, not an official Resemble AI release. End-to-end processing has been tested on desktop, but has not been verified on an Android device. One-second chunking can introduce artifacts. In a matched-noise, one-second comparison with PyTorch, 49 of 44,100 samples exceeded an atol=0.002, rtol=0.002 numerical threshold; maximum absolute difference was 0.00378. Wider audio quality and device testing are needed.
Original model and license
The original Resemble Enhance model and code were created by Resemble AI.
- Original model: ResembleAI/resemble-enhance
- Original code: resemble-ai/resemble-enhance
- License: MIT; original copyright ยฉ 2023 Resemble AI.
This repository is an independent experimental LiteRT conversion, not an official Resemble AI release.
- Downloads last month
- -
Model tree for SayedShaun/resemble-enhance-litert
Base model
ResembleAI/resemble-enhance