Ant-Brain / EfficientWord-Net

OneShot Learning-based hotword detection.
https://ant-brain.github.io/EfficientWord-Net/
Apache License 2.0
231 stars 37 forks source link

can't create reference file with model type resnet_50_arc ! #30

Closed OnlinePage closed 1 year ago

OnlinePage commented 1 year ago

Hi been trying to create the new reference file with below command python -m eff_word_net.generate_reference --input-dir ./mywakewordaudios --output-dir ./ --wakeword mywakeword --model-type resnet_50_arc

Also seems like when generating audio for the same wakeword using generate audio command I was getting 500 response, maybe api request is being limited.

But I created around 8 audios(1-1.5s long) of my wake word using audacity and yet failed to create reference file using resnet_50_arc. However with First_Iteration_Siamese reference file is being easily created.

here is the error trace I got: eff_word_net\audio_processing.py", line 199, in audioToVector assert inpAudio.shape == (self.window_frames, ) #1.5 sec long window

TheSeriousProgrammer commented 1 year ago

its a minor bug it will be helpful if you could share your audio files to recreate the error

zerocool-11 commented 1 year ago

I had this similar issue, I fixed it by recording the hot word samples for 2 seconds instead of 1 but when i run the inference script it throws a similar error

    assert inpAudio.shape == (self.window_frames, ) #1.5 sec long window
AssertionError

i am attaching both json file and my inference code to recreate the error

EfficientWord-Net Version: 1.0.2

TheSeriousProgrammer commented 1 year ago

Have recently made a commit which should fix the same, however its not up in the pypi repo yet, can you try installing from source using github?

zerocool-11 commented 1 year ago

hi @TheSeriousProgrammer thanks, it's working fine now though it often throws this error OSError: [Errno -9981] Input overflowed to fix this, I just updated your stream.py in line number 94 to this


get_next_frame = lambda : (
                np.frombuffer(mic_stream.read(CHUNK,exception_on_overflow = False),dtype=np.int16)
            ),

I just passed the exception_on_overflow as False in the pyaudio stream read function

I just wanted to let you know so that you could add it to your next commit, maybe...

TheSeriousProgrammer commented 1 year ago

that sounds good , can you make a pr of the same? @zerocool-11

zerocool-11 commented 1 year ago

Done... :) @TheSeriousProgrammer