Package: lsHotword
lsHotwordlsHotwordis Wake Word detector and Easy to use Module Which is open-Source andFree License.If you face any problem you can contact me on my E-mail at the last of this Document. For any Help we also have YouTube channel link is at the last of this file.Install lsHotword using pipTo install lsHotword open cmd and type-pip install lsHotword --upgradeMake sure your python should be on path.Training Your Own ModelCreate DatasetTo train your own Model you have to create your Dataset.
Record 10 audio with voiceActivateand place it under "Positives folder" and record 10 **Non-Activate Word ** Which are not Activate and place it under negatives folder. And like that record 2 or more than 2 background noises in different environments of 10 seconds. Make sure to record these audios in 44100 Hz sample rate, either will you have to change too many parameters.You can use free software and tools like-AudacityEdit audio clips to select only 10 sec of background noise or exact part where you said you hotword in audio.FFMpegfor converting the sample rate to 44100HzExamples are provided on Github for audio(from deeplearning.ai's deep learning program).
Your Directory should look like this-data/background/file1.wavfile2.wavfile3.wavpositives/file4.wavfile5.wavfile6.wav..negatives/file7.wavfile8.wavfile9.wav..Then open command prompt here (eg. outside "data" folder) and type-.lshUITrainerPress enter and you will see this window-Importpositivesaudio folder.Importnegativeaudio folder.Importbackgroundnoise samples folder.Import Output directory where you want to save model after training.No. of training examples to generate keep it 30 and increase it if you have more data and for more better accuracy in result.No. ofEpochs(How much times you want to train your model eg 100-400).Batch size increase it if you have more GPU power or keep it same.When 1-7 all steps are done then start training by clicking on this button.And you will see something like that-When training finishes  you see the output directory where wake word model is saved.Without GUI (Optional)This is an alternative way, if GUI Trainer is not working or you want to do it step by step.Type this commmand to generate training examples from raw data-lsHDatagen --input ./data --nsamp 32Heredatais the folder where both folders"positives and negatives"are located andnsampare number of training examples you want to generate. After finishing this process you will see two files 'X.npy and Y.npy' outside data folder.
Now its time to train our Hotword Model open cmd again here and type-lsHTrainer --inX X.npy --inY Y.npy --epochs 600and then after few minutes you will get your model  with namemodel.h5, Hurray!! you just created your own hotword or wake word model.Test Hotword Model liveNow test it using this command-'lsHTestModel --model < path to model >'lsHTestModel --model ./model.h5and then you will see a text like<< Waiting for Hotword >>when you see this text then try to speak your wake word and see a chime sound will beep!!Using Trained ModelAfter installinglsHotwordand training your own model e.gmodel.h5then you are ready to use it any program where you want to use it. Example-from lsHotword.ls import Hotword

path_to_model = "./model.h5"          # path to model where it is located
hotword = Hotword(path_to_model)      # create object of Hotword

#Now call HotwordLoop function
if hotword.HotwordLoop():
    print('Wake word Detected!!')    # print when hotword is detected.And thats all you are ready to go use it in any program you want to make. If you want to contribute to this little project then feel free to make push request on dev branch.This module is created with the help ofDeeplearning.ai 's Deep Learning Program.For More InformationFor more information or send your query at:iamhemantindia@protonmail.comOrOr Checkout Our Youtube Channel Logical Spot (Hemant Kumar)Feel free toContributeat -