superkogito / voice-based-gender-recognition Goto Github PK
View Code? Open in Web Editor NEW:sound: :boy: :girl:Voice based gender recognition using Mel-frequency cepstrum coefficients (MFCC) and Gaussian mixture models (GMM)
License: MIT License
:sound: :boy: :girl:Voice based gender recognition using Mel-frequency cepstrum coefficients (MFCC) and Gaussian mixture models (GMM)
License: MIT License
thanks for model. i did not install it from requirements so stuck with errors.
and fixed em.
so to start it working with updated sklearn:
in Voice-based-gender-recognition\Code\ModelsTrainer.py change:
#from sklearn.mixture import GMM
from sklearn import mixture
#females_gmm = GMM(n_components = 16, n_iter = 200, covariance_type='diag', n_init = 3)
#males_gmm = GMM(n_components = 16, n_iter = 200, covariance_type='diag', n_init = 3)
females_gmm = mixture.GaussianMixture(n_components = 16, max_iter = 200, covariance_type='diag', n_init = 3)
males_gmm = mixture.GaussianMixture(n_components = 16, max_iter = 200, covariance_type='diag', n_init = 3)
also in FeaturesExtractor.py to avoid warnings:
#nfft = 512,
nfft = 2400,
also i have to change a bit GenderIdentifier.py (i use Windows) when i use it alone:
expected_gender = file.split("\\")[1][:-1]
#expected_gender = file.split("/")[1][:-1]
#gender_identifier = GenderIdentifier("TestingData/females", "TestingData/males", "females.gmm", "males.gmm")
gender_identifier = GenderIdentifier("females", "males", "females.gmm", "males.gmm")
and finally i saw strange thing - the model identifies upside-down:
--> TESTING : 1073565748.wem.wav
+ FEMALE SCORE : 0.487
+ MALE SCORE : 0.8
+ EXPECTATION : 1073565748.wem.wa
+ IDENTIFICATION : male
----------------------------------------------------
--> TESTING : 1073638869.wem.wav
+ FEMALE SCORE : -0.127
+ MALE SCORE : 0.432
+ EXPECTATION : 1073638869.wem.wa
+ IDENTIFICATION : male
----------------------------------------------------
--> TESTING : 1073566498.wem.wav
+ FEMALE SCORE : 0.661
+ MALE SCORE : 0.229
+ EXPECTATION : 1073566498.wem.wa
+ IDENTIFICATION : female
----------------------------------------------------
*** Accuracy = 0.0% ***
True results: male -> female, female -> male.
May be somewhere is wrong path?
ok.fixed the last just changed *args in GenderIdentifier.py like follows:
gender_identifier = GenderIdentifier("males", "females", "males.gmm","females.gmm")
I see the python files rely on files for input.
Can I pipe a .wav file into a python script?
I'm exploring possibilities for classifying a voice in real time.
I got the program working fine. Very nice code. Thank you.
Hello,
In testing this implementation on some real-life recordings I took, I happened to get very negative scores for the file named "female2.wav". I'm wondering how this happened, and more specifically how the scoring algorithm works (the documentation for the score function appears to say that it is a log probability, but somehow we have positive values?). Any indication as to how this one .wav file could have generated negative scores while other similar ones generated positive ones would be greatly appreciated.
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
hi, i am currently working on my second phase of experiment using your source code. thank you :) i just have one doubt: the audio and rate in features vector, im having troubles in sampling_rate when i tried to substitute it with 44100. can you please tell me where im going wrong?
Originally posted by @thxrgxxs in #4 (comment)
Sorry for the inconvenience, I’m stuck a little bit with NN code. Is the input for the NN is the super vector?
Hi, thank you for sharing your code.I am using your code for my further research recently. And now I have a question in the process of practice. I am appreciation it if get your answer.
In the model training of the Code file, you used the Gaussian mixture model. But in the model training of the nnCode, svmCode, and hmmCode files, you used the Gaussian HMM. Why should it be set like this?
I downloaded the Zip file of the depository and launched
pip on the repository.txt
There seems to be an incompatibility between the version of scikit-learn and scipy. So finally I get the message
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for scipy
Running setup.py clean for scipy
error: subprocess-exited-with-error
× python setup.py clean did not run successfully.
│ exit code: 1
╰─> [11 lines of output]
/private/var/folders/1n/fvs3dd2d5gqghwcw8khb41_h0000gn/T/pip-install-wrqba4ts/scipy_d52b27f83b4d4bcbab2d2a119d86fdd9/setup.py:114: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import imp
`setup.py clean` is not supported, use one of the following instead:
- `git clean -xdf` (cleans all files)
- `git clean -Xdf` (cleans all versioned files, doesn't touch
files that aren't checked into the git repo)
Add `--force` to your command to use it anyway if you must (unsupported).
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed cleaning build dir for scipy
Failed to build scikit-learn scipy
ERROR: Could not build wheels for scikit-learn, scipy, which is required to install pyproject.toml-based projects
Here is the output I get when I then run Run.py:
python Run.py
Files extraction was successfull ...
TrainingData was created ...
TestingData was created ...
TrainingData/females was created ...
TrainingData/males was created ...
TestingData/females was created ...
TestingData/males was created ...
Traceback (most recent call last):
File "Code/ModelsTrainer.py", line 5, in
from sklearn.mixture import GMM
ImportError: cannot import name 'GMM' from 'sklearn.mixture' (/Users/yannis/miniconda3/lib/python3.8/site-packages/sklearn/mixture/init.py)
Traceback (most recent call last):
File "Code/GenderIdentifier.py", line 5, in
from FeaturesExtractor import FeaturesExtractor
File "/Users/yannis/Downloads/LIVRE/PYTHON/EXOS/01-4/Voice-based-gender-recognition-master/Code/FeaturesExtractor.py", line 4, in
from python_speech_features import mfcc
ModuleNotFoundError: No module named 'python_speech_features'
What am I doing wrong? How can I solve this problem?
Thanx for the great work.
The problem has been solved.
bro i a started run.py and training stucks at PROCESSNG TrainingData/males\m0004_us_m0004_00114.wav what should i do?
I used more than 3,000 male voices and more than 3,000 female voices, and most of the results of the training identified male voices as female voices
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.