blob: a311d50fcbcba1b2f4b9fce6465a496ec2ba507a [file] [log] [blame]
import voice
def detection_callback(label, score):
print('Detected: "%s", score=%s' % (label, score))
if label.startswith('exit'):
return False # stop listening
return True # keep listening
def run_voice_example():
voice.classify_audio(model_file='voice_commands_v0.7_edgetpu.tflite',
labels_file='labels_gc2.raw.txt',
dectection_callback=detection_callback)
if __name__ == '__main__':
run_voice_example()