FastEnhancer folded-inference model for streaming spectral enhancement.
Adapted from aask1357/fastenhancer (revision e74cab1, models/fastenhancer/
default/model.py), the revision of the onnx-vd-v1.0.0 release. One call processes one STFT frame: spec_in is
(n_fft // 2 + 1, 1, 2) real/imag, and each RNNFormer block carries a GRU state
(freq, channels). Callers zero the states only at independent sequence starts
and feed each state_out_k back as state_in_k. The graph matches the
released ONNX inference form, with BatchNorm and weight normalization folded.
STFT/iSTFT framing, weight files and weight terms are the caller’s concern.
Construct an untrained one-frame FastEnhancer with named streaming inputs and outputs.
Inputs: spec_in (bins, 1, 2) and state_in_k (freq, channels) per block. Outputs: spec_out
and state_out_k. Fixed linear filterbanks are initialized and frozen; other weights are untrained
until imported with a mapping from fastenhancer_params (FASTENHANCER_T_ONNX or
fastenhancer_mapping).
Parameters
Parameters of build
Name
Type
Default
Description
params
FastEnhancerParams
Required
Model parameters.
input_shape
tuple[int | None, ...] | None
None
None, or ``spec_in``'s fixed shape ``(bins, 1, 2)``.
batch_size
int | None
None
Static batch size; None for a dynamic batch.
name
str | None
None
Model name; the family when None.
Returns
Returns of build
Type
Description
keras.Model
keras.Model: The model, named ``fastenhancer`` unless ``name`` is given.