tflite_model_maker.audio_classifier.BrowserFftSpec

Model good at detecting speech commands, using Browser FFT spectrum.

model_dir The location to save the model checkpoint files.
strategy An instance of TF distribute strategy. If none, it will use the default strategy (either SingleDeviceStrategy or the current scoped strategy.

target_sample_rate

Methods

create_model

create_serving_model

Create a model for serving.

export_tflite

Converts the retrained model to tflite format and saves it.

This method overrides the default CustomModel._export_tflite method, and include the pre-processing in the exported TFLite library since support library can't handle audio tasks yet.

Args
model An instance of the keras classification model to be exported.
tflite_filepath File path to save tflite model.
with_metadata Whether the output tflite model contains metadata.
export_metadata_json_file Whether to export metadata in json file. If True, export the metadata in the same directory as tflite model.Used only if with_metadata is True.
index_to_label A list that map from index to label class name.

get_default_quantization_config

Gets the default quantization configuration.

preprocess_ds

Returns a preprocessed dataset.

run_classifier

EXPECTED_WAVEFORM_LENGTH 44032