### Install Training Dependencies Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/reproduction.md Installs necessary packages for training, including support for PEP 660. Ensure pip is up-to-date before running. ```bash pip install --upgrade pip # enable PEP 660 support pip install -e .[train,optional] ``` ```zsh pip install -e '.[train,optional]' ``` -------------------------------- ### Install UTMOSv2 Dependencies Source: https://github.com/sarulab-speech/utmosv2/blob/main/README.md Install the project dependencies using uv or pip. The '[optional]' flag installs additional dependencies required for certain features. ```bash uv sync --extra optional ``` ```bash pip install --upgrade pip # enable PEP 660 support pip install -e .[optional] # install with optional dependencies ``` -------------------------------- ### Install UTMOSv2 Source: https://github.com/sarulab-speech/utmosv2/blob/main/quickstart.ipynb Installs the UTMOSv2 library from GitHub. Ensure Git LFS is configured to skip smudging if needed. ```python !GIT_LFS_SKIP_SMUDGE=1 pip install git+https://github.com/sarulab-speech/UTMOSv2.git ``` -------------------------------- ### Install Training Dependencies Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/training.md Installs the necessary dependencies for training UTMOSv2, including support for PEP 660. Ensure pip is up-to-date before running. ```bash pip install --upgrade pip # enable PEP 660 support pip install -e .[train,optional] ``` -------------------------------- ### Install UTMOSv2 Library Source: https://github.com/sarulab-speech/utmosv2/blob/main/README.md Install the UTMOSv2 library from GitHub using uv or pip. This is the first step before using the library in your Python code. ```bash uv add git+https://github.com/sarulab-speech/UTMOSv2.git # If you're using pip: # pip install git+https://github.com/sarulab-speech/UTMOSv2.git ``` -------------------------------- ### Install Training Dependencies (zsh) Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/training.md Installs training dependencies for zsh users, requiring escaped square brackets in the pip command. ```zsh pip install -e '.[train,optional]' ``` -------------------------------- ### Train UTMOSv2 with Weights & Biases Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/training.md Command to enable Weights & Biases (wandb) for experiment tracking during training. Requires API key setup. ```bash python train.py --config spec_only --data_config data_config.json --wandb ``` -------------------------------- ### Install Optional Dependencies for Inference Scripts Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/inference.md Install additional dependencies required for using the `inference.py` scripts. Ensure pip is up-to-date for PEP 660 support. ```bash pip install --upgrade pip # enable PEP 660 support pip install -e .[optional] ``` -------------------------------- ### Install Optional Dependencies with Zsh Escaping Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/inference.md If using zsh, escape the square brackets when installing optional dependencies for the inference scripts. ```zsh pip install -e '.[optional]' ``` -------------------------------- ### Data Configuration JSON Structure Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/training.md Example JSON structure for configuring custom training data. Specifies dataset name, directory, and MOS list file. ```json { "data": [ { "name": "dataset1", "dir": "/path/to/your/dataset1", "mos_list": "/path/to/your/moslist1.txt" }, { "name": "dataset2", "dir": "/path/to/your/dataset2", "mos_list": "/path/to/your/moslist2.txt" } // Add more data entries as needed ] } ``` -------------------------------- ### Train UTMOSv2 Paper Experiments (SSL Stage 1) Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/reproduction.md Use this command to train the first stage of the SSL-only model for UTMOSv2. ```bash python train.py --reproduce --config ssl_only_stage1 ``` -------------------------------- ### Clone UTMOSv2 Repository Source: https://github.com/sarulab-speech/utmosv2/blob/main/README.md Clone the UTMOSv2 repository and navigate to its directory. This is the first step to set up the project locally. ```bash git clone https://github.com/sarulab-speech/UTMOSv2.git cd UTMOSv2 ``` -------------------------------- ### Run Inference Script with Configuration Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/inference.md Use this command to run the inference script with a specified configuration file, input directory, and output path. By default, it uses the fusion_stage3 model. ```bash python inference.py --config configuration_file_name --input_dir /path/to/wav/dir/ --out_path /path/to/output/file.csv ``` -------------------------------- ### Train UTMOSv2 with Custom Data Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/training.md Command to initiate UTMOSv2 training using a specified data configuration file. ```bash python train.py --config spec_only --data_config data_config.json ``` -------------------------------- ### Fine-tune UTMOSv2 from Pre-trained Weights Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/training.md Command to continue training from existing weights by specifying the --weight option. Useful for further training or fine-tuning. ```bash python train.py --config spec_only --data_config data_config.json --weight /path/to/your/weights.pth ``` -------------------------------- ### Specify Configuration File for Predictions in Python Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/inference.md Create a UTMOSv2 model by providing a configuration file name to `utmosv2.create_model` in Python. ```python model = utmosv2.create_model(config="configuration_file_name") mos = model.predict(input_dir="/path/to/wav/dir/") ``` -------------------------------- ### Train UTMOSv2 Paper Experiments (SSL Stage 2) Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/reproduction.md Use this command to train the second stage of the SSL-only model, requiring the first stage weights. ```bash python train.py --reproduce --config ssl_only_stage2 --weight ssl_only_stage1 ``` -------------------------------- ### Train UTMOSv2 Paper Experiments (w/o SSL) Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/reproduction.md Use this command to train the UTMOSv2 system without SSL components, focusing on spectral information. ```bash python train.py --reproduce --config spec_only ``` -------------------------------- ### Train Competition Submission (SSL Stage 1) Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/reproduction.md Use this command to train the first stage of the SSL-only model for the competition submission. ```bash python train.py --reproduce --config c_ssl_only_stage1 ``` -------------------------------- ### Train Competition Submission (SSL Stage 2) Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/reproduction.md Use this command to train the second stage of the SSL-only model for the competition submission, requiring the first stage weights. ```bash python train.py --reproduce --config c_ssl_only_stage2 --weight ssl_only_stage1 ``` -------------------------------- ### Train Competition Submission (Spectral Stage 1) Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/reproduction.md Use this command to train the first stage of the spectral-only model for the competition submission. ```bash python train.py --reproduce --config c_spec_only_stage1 ``` -------------------------------- ### Train UTMOSv2 Paper Experiments (Fusion w/o Stage 1 & 2) Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/reproduction.md Use this command to train the fusion model excluding both stage 1 and stage 2. ```bash python train.py --reproduce --config fusion_wo_stage1and2 ``` -------------------------------- ### Train UTMOSv2 Paper Experiments (Fusion w/o Stage 2) Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/reproduction.md Use this command to train the fusion model excluding stage 2. ```bash python train.py --reproduce --config fusion_wo_stage2 ``` -------------------------------- ### Predict MOS for WAV Files in a Directory Source: https://github.com/sarulab-speech/utmosv2/blob/main/quickstart.ipynb Creates a pre-trained UTMOSv2 model and predicts the MOS for all WAV files within a specified directory. ```python model = utmosv2.create_model(pretrained=True) mos = model.predict(input_dir="/path/to/wav/dir/") print(mos) ``` -------------------------------- ### Train Competition Submission (Spectral Stage 2) Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/reproduction.md Use this command to train the second stage of the spectral-only model for the competition submission, requiring the first stage weights. ```bash python train.py --reproduce --config c_spec_only_stage2 --weight c_spec_only_stage1 ``` -------------------------------- ### Train UTMOSv2 Paper Experiments (Fusion Stage 2) Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/reproduction.md Use this command to train the second stage of the fusion model for UTMOSv2. ```bash python train.py --reproduce --config fusion_stage2 ``` -------------------------------- ### Train Competition Submission (Fusion Stage 2) Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/reproduction.md Use this command to train the second stage of the fusion model for the competition submission. ```bash python train.py --reproduce --config c_fusion_stage2 ``` -------------------------------- ### Train Competition Submission (Fusion Stage 3) Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/reproduction.md Use this command to train the third stage of the fusion model for the competition submission, requiring the second stage weights. ```bash python train.py --reproduce --config c_fusion_stage3 --weight c_fusion_stage2 ``` -------------------------------- ### Create Model and Predict in Python Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/inference.md Integrate UTMOSv2 into your Python code by creating a model instance with a specific checkpoint path and then using the predict method. ```python model = utmosv2.create_model(checkpoint_path="/path/to/your/weight.pth") MOS = model.predict(input_dir="/path/to/wav/dir/") ``` -------------------------------- ### Train UTMOSv2 Paper Experiments (Fusion Stage 3) Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/reproduction.md Use this command to train the third stage of the fusion model, requiring the second stage weights. ```bash python train.py --reproduce --config fusion_stage3 --weight fusion_stage2 ``` -------------------------------- ### Inference with Trained Weights Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/reproduction.md Run inference using trained weights. Specify the configuration name, input directory, validation list path, and number of repetitions. ```bash python inference.py --reproduce --config fusion_stage3 --input_dir data/main/DATA --val_list_path voicemos2024-track1-eval-phase/DATA/sets/eval_list.txt --fold -1 --num_repetitions 5 ``` -------------------------------- ### Predict MOS for a Subset of Files in Python using File Path Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/inference.md In Python, use the `predict` method with `val_list_path` to specify a text file containing the list of WAV files for prediction. ```python mos = model.predict(input_dir="/path/to/wav/dir/", val_list_path="/path/to/your/val/list.txt") ``` -------------------------------- ### Train UTMOSv2 Paper Experiments (w/o BVCC Datasets) Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/reproduction.md Commands to train UTMOSv2 experiments excluding BVCC datasets. Similar replacements can be made for 'bc', 'somos', and 'sarulab'. ```bash python train.py --reproduce --config spec_only_wo_bvcc ``` ```bash python train.py --reproduce --config ssl_only_stage1_wo_bvcc ``` ```bash python train.py --reproduce --config ssl_only_stage2_wo_bvcc --weight ssl_only_stage1_wo_bvcc ``` ```bash python train.py --reproduce --config fusion_stage2_wo_bvcc ``` ```bash python train.py --reproduce --config fusion_stage3_wo_bvcc --weight fusion_stage2_wo_bvcc ``` -------------------------------- ### Run Inference Script with Custom Weights Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/inference.md Execute the inference script using custom weights by specifying the --weight option along with the input and output paths. ```bash python inference.py --input_dir /path/to/wav/dir/ --out_path /path/to/output/file.csv --weight /path/to/your/weight.pth ``` -------------------------------- ### Predict MOS for a Single WAV File Source: https://github.com/sarulab-speech/utmosv2/blob/main/quickstart.ipynb Creates a pre-trained UTMOSv2 model and predicts the MOS for a single audio file specified by its path. ```python model = utmosv2.create_model(pretrained=True) mos = model.predict(input_path="/path/to/wav/file.wav") print(mos) ``` -------------------------------- ### Predict MOS for All WAV Files in a Directory Source: https://github.com/sarulab-speech/utmosv2/blob/main/README.md Use the inference script to predict the MOS for all WAV files within a specified directory. Provide the input directory path and the output CSV file path. ```python python inference.py --input_dir /path/to/wav/dir/ --out_path /path/to/output/file.csv ``` -------------------------------- ### Predict MOS for a Subset of Files using Inference Script Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/inference.md Use the `inference.py` script with `val_list_path` to predict MOS scores for a specified subset of WAV files. ```bash python inference.py --input_dir /path/to/wav/dir/ --out_path /path/to/output/file.csv --val_list_path /path/to/your/val/list.txt ``` -------------------------------- ### Import UTMOSv2 Library Source: https://github.com/sarulab-speech/utmosv2/blob/main/quickstart.ipynb Imports the necessary utmosv2 library for use in your Python script. ```python import utmosv2 ``` -------------------------------- ### Run Inference with Different Weights per Fold Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/inference.md Iterate through folds and run the inference script using distinct weights for each fold by specifying the --weight and --fold arguments. ```bash for i in {0..5}; do python inference.py --input_path /path/to/wav/file.wav --out_path /path/to/output/file.csv --weight /path/to/your/weight_fold${i}.pth --fold $i done ``` -------------------------------- ### Predict MOS for a Subset of Files in Python using Direct List Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/inference.md Provide a Python list of utterance IDs directly to the `predict` method to process only specific files. ```python mos = model.predict( input_dir="/path/to/wav/dir/", val_list=["sys00691-utt0682e32", "sys00691-utt31fd854", "sys00691-utt33a4826", ...] ) ``` -------------------------------- ### Specify Fold and Repetitions for Accurate Predictions in Python Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/inference.md Create a UTMOSv2 model specifying a fold and use the `predict` method with `num_repetitions` for more accurate predictions in Python. ```python model = utmosv2.create_model(fold=2) mos = model.predict(input_dir="/path/to/wav/dir/", num_repetitions=5) ``` -------------------------------- ### Predict MOS with 'somos' Data Domain using Inference Script Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/inference.md Execute the `inference.py` script to predict MOS scores, setting the data domain to 'somos'. ```bash python inference.py --input_dir /path/to/wav/dir/ --out_path /path/to/output/file.csv --predict_dataset somos ``` -------------------------------- ### Specify Fold and Repetitions for Accurate Predictions using Inference Script Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/inference.md Run the `inference.py` script, specifying the `--fold` and `--num_repetitions` arguments for enhanced prediction accuracy. ```bash python inference.py --input_dir /path/to/wav/dir/ --out_path /path/to/output/file.csv --fold 2 --num_repetitions 5 ``` -------------------------------- ### Predict MOS with 'somos' Data Domain in Python Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/inference.md Use the `predict` method in Python to make MOS predictions, specifying the 'somos' data domain. ```python mos = model.predict(input_dir="/path/to/wav/dir/", predict_dataset="somos") ``` -------------------------------- ### Predict MOS from Tensor or Array Source: https://github.com/sarulab-speech/utmosv2/blob/main/README.md Use the UTMOSv2 library to predict MOS scores from audio data already loaded in memory as a PyTorch tensor or NumPy array. Ensure the data has the correct shape and sampling rate. ```python import utmosv2 model = utmosv2.create_model(pretrained=True) # data: torch.Tensor or np.ndarray with shape (batch_size, sequence_length) or (sequence_length,) # sr: Sampling rate of the input audio data. If not provided, it defaults to 16000 Hz. mos = model.predict(data=data, sr=16000) # Returns a torch.Tensor or np.ndarray with shape (batch_size,) or (1,) ``` -------------------------------- ### MOS List File Format Source: https://github.com/sarulab-speech/utmosv2/blob/main/docs/training.md Format for the MOS list file, mapping audio file identifiers to their corresponding MOS values. ```text sys64e2f-utt491a78a,2.375 sys64e2f-utt8485f83,3.625 sys7ab3c-utt1417b69,4.0 ... ``` -------------------------------- ### Predict MOS for a Single WAV File Source: https://github.com/sarulab-speech/utmosv2/blob/main/README.md Use the inference script to predict the Mean Opinion Score (MOS) for a single WAV file. Specify the input WAV file path and the output CSV file path. ```python python inference.py --input_path /path/to/wav/file.wav --out_path /path/to/output/file.csv ``` -------------------------------- ### UTMOSv2 Citation Source: https://github.com/sarulab-speech/utmosv2/blob/main/README.md BibTeX entry for citing the UTMOSv2 paper in academic publications. Use this when referencing the project in research. ```bibtex @inproceedings{baba2024utmosv2, title = {The T05 System for The {V}oice{MOS} {C}hallenge 2024: Transfer Learning from Deep Image Classifier to Naturalness {MOS} Prediction of High-Quality Synthetic Speech}, author = {Baba, Kaito and Nakata, Wataru and Saito, Yuki and Saruwatari, Hiroshi}, booktitle = {IEEE Spoken Language Technology Workshop (SLT)}, year = {2024}, pages = {818--824}, doi = {10.1109/SLT61566.2024.10832315}, } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.