SuperKogito / Voice-based-gender-recognition

:sound: :boy: :girl:Voice based gender recognition using Mel-frequency cepstrum coefficients (MFCC) and Gaussian mixture models (GMM)
MIT License
202 stars 66 forks source link

how to test the network on new voices? #13

Open ranch-hands opened 1 year ago

ranch-hands commented 1 year ago

Hi thanks for your good work . will you please explain how to test the network on new data ? how can we test it on our own voices?

thanks

SuperKogito commented 1 year ago

Hello, The easiest way is to use https://github.com/SuperKogito/Voice-based-gender-recognition/blob/cecc0469196e0a212716a1b3ddc085fe8e78288a/Code/GenderIdentifier.py#L66C1-L68C32

if __name__== "__main__":
    gender_identifier = GenderIdentifier("TestingData/females", "TestingData/males", "females.gmm", "males.gmm")
    gender_identifier.process()

just place your data under a TestingData folder and pass it to GenderIdentifier() as shown above.

ranch-hands commented 1 year ago

Thanks a lot .

On Wed, Jul 5, 2023 at 12:06 PM Ayoub Malek @.***> wrote:

Hello, The easiest way is to use https://github.com/SuperKogito/Voice-based-gender-recognition/blob/cecc0469196e0a212716a1b3ddc085fe8e78288a/Code/GenderIdentifier.py#L66C1-L68C32 http://Code/GenderIdentifier.py

if name== "main": gender_identifier = GenderIdentifier("TestingData/females", "TestingData/males", "females.gmm", "males.gmm") gender_identifier.process()

just place your data under a TestingData folder and pass it to GenderIdentifier() as shown above.

— Reply to this email directly, view it on GitHub https://github.com/SuperKogito/Voice-based-gender-recognition/issues/13#issuecomment-1621294919, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASMJBK3JI5EZT4XRG25BFRTXOURRTANCNFSM6AAAAAAZ6TJCWI . You are receiving this because you authored the thread.Message ID: @.*** com>

ranch-hands commented 1 year ago

It means that each time (for testing) the network should be trained? each time the run.py downloads the dataset and builds the TestingData folder by itself.

SuperKogito commented 1 year ago

No you train once and then you test as many times as you want. the https://github.com/SuperKogito/Voice-based-gender-recognition/blob/master/nnCode/ModelsTrainer.py is responsible for the training, which results in having 2 models one for males and one for females. These models are used by the https://github.com/SuperKogito/Voice-based-gender-recognition/blob/master/nnCode/GenderIdentifier.py to test the new voices/ audios.

ranch-hands commented 1 year ago

When I give a sound to GenderIdentifier.py it gives error:

984/984 [==============================] - 2s 2ms/step - loss: 0.2400 - accuracy: 0.9044
Epoch 5/5
984/984 [==============================] - 2s 2ms/step - loss: 0.2262 - accuracy: 0.9094

--> TESTING        : testsound.m4a
Error

--> TESTING        : all_systems_go.wav

Some rows of transmat_ have zero sum because no transition from the state was ever observed.
Some rows of transmat_ have zero sum because no transition from the state was ever observed.
Some rows of transmat_ have zero sum because no transition from the state was ever observed.
Some rows of transmat_ have zero sum because no transition from the state was ever observed.
(16, 39)
Error
*** Accuracy = 100.0% ***

or:

Epoch 5/5
984/984 [==============================] - 2s 2ms/step - loss: 0.2195 - accuracy: 0.9144
--> TESTING        : testsound.wav
Error
--> TESTING        : all_systems_go.wav
(16, 39)
Error
*** Accuracy = 100.0% ***
SuperKogito commented 1 year ago

Your audios must be mono waves as far I remember so anything different will probably not work. Make sure your audio is not stereo. Use ffmpeg to convert it if needed.

alizahid999 commented 1 year ago

thanks dear, connect you very soon.

On Tue, Jul 18, 2023 at 9:08 PM Ayoub Malek @.***> wrote:

Your audios must be mono waves as far I remember so anything different will probably not work. Make sure your audio is not stereo. Use ffmpeg to convert it if needed.

— Reply to this email directly, view it on GitHub https://github.com/SuperKogito/Voice-based-gender-recognition/issues/13#issuecomment-1640525049, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUEXXD36FP76HGTEV7HI5ODXQ2YIZANCNFSM6AAAAAAZ6TJCWI . You are receiving this because you are subscribed to this thread.Message ID: <SuperKogito/Voice-based-gender-recognition/issues/13/1640525049@ github.com>