Keyword Spotting (KWS) API wrapper for TFLite streaming models.
This project is only a API wrapper to assist audio processing with tflite models. Models are not provided here. You need to find a pretrained model or train your own. One open source streaming KWS model in tensorflow is the kws_streaming by Google Research. You can refer to g-kws as a nice setup guide, and use Dataset-builder to prepare your own dataset.
Simply run python3 mic_streaming.py -m /path/to/your/model.tflite
, then speak to your mic to test.
Simple example with two keywords:
gkws = TFLiteKWS(args.model, [SILENCE, NOT_KW, 'keyword1', 'keyword2'])
while True:
keyword = gkws.process(get_next_audio_frame())
if keyword:
# following up actions
Please refer to kws.py
for detailed API usage and tunning parameters.