ML-zoo icon indicating copy to clipboard operation
ML-zoo copied to clipboard

Model Validation Script

Open andreysher opened this issue 3 years ago • 1 comments

Hello and thanks for your work. I need to run model for Keyword Spotting from this zoo, but there is no any validation script with preprocessing for my .wav files. How should i prepare my data to apply models?

andreysher avatar Sep 20 '22 12:09 andreysher

Hey, Your best bet is to look into the code used for training and evaluating the keyword spotting models here

There is a script for testing the TFLite models themselves here on the whole test set.

For how to actually prepare .wavs for sending into the model this is covered in this file.

Unfortunately there isn't a function or script that shows how to perform inference on a single wav file but this shouldn't be a tricky thing to do (we might actually add this in the future). It should be a matter of just calling load_wav_file followed by calculate_mfcc and then sending this for inference. If using the quantized models you may need to quantize the input first like is done in the test_tflite.py file.

Note that the models work on 1 second mono audio clips, with a sample rate of 16000 samples per second. The window size, stride and number of mfcc features depends on the model and comes from here

Best regards, Richard

Burton2000 avatar Sep 28 '22 09:09 Burton2000