Add files via upload

This commit is contained in:
Uyghur 2021-06-17 15:16:55 +09:00 committed by GitHub
parent c581782dcc
commit 213943c5bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

17
tonu.py Normal file
View File

@ -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))