网页 综合 更新时间 2026-11-15 00:14:11

AudioConverter layer

自动蜘蛛 keras.io 正文约 1325 字
AudioConverter layer
Convert raw audio for models that support audio input.
This class converts from raw audio tensors of any length, to preprocessed audio for pretrained model inputs. It is meant to be a convenient way to write custom preprocessing code that is not model specific. This layer should be instantiated via the from_preset() constructor, which will create the correct subclass of this layer for the model preset.
The layer will take as input a raw audio tensor with shape (batch_size, num_samples), and output a preprocessed audio input for modeling. The exact structure of the preprocessed input will vary per model. Preprocessing will often include computing a spectogram of the raw audio signal.
Instantiate a keras_hub.layers.AudioConverter from a model preset.
A preset is a directory of configs, weights and other file assets used to save and load a pre-trained model. The preset can be passed as one of:
You can run cls.presets.keys() to list all built-in presets available on the class.
This constructor can be called in one of two ways. Either from the base class like keras_hub.models.AudioConverter.from_preset(), or from a model class like keras_hub.models.WhisperAudioConverter.from_preset(). If calling from the base class, the subclass of the returning object will be inferred from the config in the preset directory.
访问原文 返回搜索 https://keras.io/keras_hub/api/preprocessing_layers/audio_converter/
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。