From 213943c5bff4081dfb7bcc1dfdc46b2c7900419b Mon Sep 17 00:00:00 2001 From: Uyghur Date: Thu, 17 Jun 2021 15:16:55 +0900 Subject: [PATCH] Add files via upload --- tonu.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tonu.py diff --git a/tonu.py b/tonu.py new file mode 100644 index 0000000..22712bf --- /dev/null +++ b/tonu.py @@ -0,0 +1,17 @@ +import sys +import os +from data import featurelen +from UModel import UModel + +if __name__ == '__main__': + model = UModel(featurelen) + + if len(sys.argv)<2: + print("Using \n\tpython tonu.py audiofile | audiolist.txt | folder") + else: + device = 'cpu' + model.to(device) + audiofile = sys.argv[1] + print(f"\n======================\nRecognizing file {audiofile}") + txt = model.predict(audiofile,device) + print("%s -> %s" %(os.path.basename(audiofile),txt))