Who Is Talking (WIT) is a project aims to classify audio input and predict the gender, and age group using machine learning techniques.
We built a pipeline that takes in voice data and classifies:
- Speaker Gender (Male / Female)
- Age Group (Twenties / Fifties)
git clone https://github.com/Mohamed-Ashraf273/Who-Is-Talking.git
cd Who-Is-Talking
mkdir data
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
If you plan to train the model on your own dataset, follow these steps:
- Create a
data_train/
directory in the root of the repository. - Place your audio files inside one or more subdirectories under
data_train/
, and make sure each folder name starts withaudio
(e.g.,audio_batch1
,audio_train_set
, etc.). - It must also contain a
.csv
file that holds the corresponding labels for the audio files.
Who-Is-Talking/
├── data_train/
│ ├── audio_batch1/
│ │ ├── sample_001.wav
│ │ ├── sample_002.wav
│ │ ├── labels.csv
│ ├── filtered_data_labeled.tsv
├── model/
│ ├── model.pkl
│ │── scaler.pkl
├── src
│ infer.py
│ main.py
│ pipeline.py
├── README.md
./wit train --features './path_to_features.csv' --model model_selected
- model by default is "stacking".
- if you want to grid search over "xgboost" or "lgbm" add "--grid_search" when running the command, grid_search is supported for "xgboost" and "lgbm" only.
- for saving files like "test_val.json" or "test_data.json" add "--save_val" for test_val and "--save_test" for test_data.
./wit features --datapath './data_train/audio_batches'
- your batches name should start with "audio".
- in your audio_batches dir you should include "filtered_data_labeled.tsv" contains your data.
first check that the models in the model
path.
./wit validate --testfile './test_val.json' --model model_selected --val
- your validation file should be a json file.
- model by default "stacking".
first check that the models in the model
dir.
./wit predict --audiopath './path_to_the_dir_contains_audios'
before you build the image make sure that the test path dir in infer.py
is setted correctly.
docker build -t wit .
docker run -v "C:\path_to_the_project:/app" wit
Note: make sure you installed docker
OR
run the infer.exe file, but make sure that the test audios are in ./data
dir.
we are on 'black' format.
pip install black
python black ./path_to the_file