Commit 448503c7 authored by W.D.R.P. Sandeepa's avatar W.D.R.P. Sandeepa

implemented Keyword_Spotting_service function

parent 4d50138c
...@@ -45,4 +45,13 @@ class _Keyword_Spotting_Service: ...@@ -45,4 +45,13 @@ class _Keyword_Spotting_Service:
# extract MFCCs # extract MFCCs
MFCCs = librosa.feature.mfcc(signal, n_mfcc=n_mfcc, n_fft=n_fft, hop_length=hop_length) MFCCs = librosa.feature.mfcc(signal, n_mfcc=n_mfcc, n_fft=n_fft, hop_length=hop_length)
return MFCCs.T return MFCCs.T
\ No newline at end of file
def Keyword_Spotting_service():
# ensure that we only have 1 instance of KSS
if _Keyword_Spotting_Service._instance is None:
_Keyword_Spotting_Service._instance = _Keyword_Spotting_Service()
_Keyword_Spotting_Service.model = keras.models.load_model(MODEL_PATH)
return _Keyword_Spotting_Service._instance
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment