first commit
Browse files- checkpoint_85000.pth +3 -0
- prepare_model.py +67 -0
- samples/VCTK_p294.wav +0 -0
- samples/VCTK_p297.wav +0 -0
- samples/VCTK_p299.wav +0 -0
- samples/VCTK_p300.wav +0 -0
- samples/VCTK_p301.wav +0 -0
- samples/VCTK_p305.wav +0 -0
- samples/VCTK_p306.wav +0 -0
- samples/VCTK_p308.wav +0 -0
- samples/VCTK_p310.wav +0 -0
- samples/VCTK_p318.wav +0 -0
- samples/VCTK_p329.wav +0 -0
- samples/VCTK_p330.wav +0 -0
- samples/VCTK_p333.wav +0 -0
- samples/VCTK_p339.wav +0 -0
- samples/VCTK_p341.wav +0 -0
- samples/VCTK_p361.wav +0 -0
- samples/VCTK_p362.wav +0 -0
- speakers-log.json +121 -0
- supplemental/config_se.json +121 -0
- supplemental/language_ids.json +5 -0
- supplemental/model_se.pth.tar +3 -0
- supplemental/speaker_ids.json +25 -0
- supplemental/speakers-base.json +0 -0
- supplemental/speakers-combined.pth +3 -0
- supplemental/speakers-dataset.pth +3 -0
- supplemental/speakers.json +0 -0
checkpoint_85000.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2af1fb646f30a382b1a299af4336b283decefa7cb53aebc62140c5f435e6bb56
|
3 |
+
size 1043207181
|
prepare_model.py
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import json
|
2 |
+
import os
|
3 |
+
import subprocess
|
4 |
+
|
5 |
+
# Load the data from the provided dictionary
|
6 |
+
data = {
|
7 |
+
"VCTK_p294": {"age": 33, "gender": "F", "accents": "American", "region": "San Francisco", "comments": ""},
|
8 |
+
"VCTK_p297": {"age": 20, "gender": "F", "accents": "American", "region": "New York", "comments": ""},
|
9 |
+
"VCTK_p299": {"age": 25, "gender": "F", "accents": "American", "region": "California", "comments": ""},
|
10 |
+
"VCTK_p300": {"age": 23, "gender": "F", "accents": "American", "region": "California", "comments": ""},
|
11 |
+
"VCTK_p301": {"age": 23, "gender": "F", "accents": "American", "region": "North Carolina", "comments": ""},
|
12 |
+
"VCTK_p305": {"age": 19, "gender": "F", "accents": "American", "region": "Philadelphia", "comments": ""},
|
13 |
+
"VCTK_p306": {"age": 21, "gender": "F", "accents": "American", "region": "New York", "comments": ""},
|
14 |
+
"VCTK_p308": {"age": 18, "gender": "F", "accents": "American", "region": "Alabama", "comments": ""},
|
15 |
+
"VCTK_p310": {"age": 21, "gender": "F", "accents": "American", "region": "Tennessee", "comments": ""},
|
16 |
+
"VCTK_p318": {"age": 32, "gender": "F", "accents": "American", "region": "Napa", "comments": ""},
|
17 |
+
"VCTK_p329": {"age": 23, "gender": "F", "accents": "American", "region": "America", "comments": ""},
|
18 |
+
"VCTK_p330": {"age": 26, "gender": "F", "accents": "American", "region": "America", "comments": ""},
|
19 |
+
"VCTK_p333": {"age": 19, "gender": "F", "accents": "American", "region": "Indiana", "comments": ""},
|
20 |
+
"VCTK_p361": {"age": 19, "gender": "F", "accents": "American", "region": "New Jersey", "comments": ""},
|
21 |
+
"VCTK_p362": {"age": 29, "gender": "F", "accents": "American", "region": "America", "comments": ""},
|
22 |
+
"VCTK_p339": {"age": 21, "gender": "F", "accents": "American", "region": "Pennsylvania", "comments": ""},
|
23 |
+
"VCTK_p341": {"age": 26, "gender": "F", "accents": "American", "region": "Ohio", "comments": ""}
|
24 |
+
}
|
25 |
+
|
26 |
+
|
27 |
+
# Convert the data to JSON format
|
28 |
+
json_data = json.dumps(data, indent=2)
|
29 |
+
|
30 |
+
# Save the JSON data to a file
|
31 |
+
with open('speakers-log.json', 'w') as file:
|
32 |
+
file.write(json_data)
|
33 |
+
|
34 |
+
# Run the TTS command to get the speaker indices
|
35 |
+
command = "tts --model_path checkpoint_85000.pth --config_path config.json --list_speaker_idxs | grep -vE '^(\s*\||\s*>|\s*$)'"
|
36 |
+
output = subprocess.check_output(command, shell=True, text=True)
|
37 |
+
|
38 |
+
# Parse the JSON output into a Python dictionary
|
39 |
+
speaker_indices = eval(output)
|
40 |
+
|
41 |
+
# Load the speaker IDs from speakers.json
|
42 |
+
with open('speakers-log.json', 'r') as file:
|
43 |
+
speaker_ids = json.load(file)
|
44 |
+
|
45 |
+
|
46 |
+
for speaker_idx in speaker_indices:
|
47 |
+
# # Remove the 'VCTK_' prefix
|
48 |
+
speaker_id = speaker_idx
|
49 |
+
# speaker_id = speaker_idx.replace('VCTK_', '')
|
50 |
+
|
51 |
+
# Lookup the speaker ID in the loaded speaker IDs
|
52 |
+
if speaker_id in speaker_ids:
|
53 |
+
speaker_id_json = speaker_ids[speaker_id]
|
54 |
+
else:
|
55 |
+
continue
|
56 |
+
|
57 |
+
# # Generate the TTS command to create the audio file
|
58 |
+
text = f"Hello, I am from {speaker_id_json['region']}. I hope that you will select my voice for your project. Thank you."
|
59 |
+
# # make samples directory if it doesn't exist
|
60 |
+
if not os.path.exists("samples"):
|
61 |
+
os.makedirs("samples")
|
62 |
+
|
63 |
+
out_path = f"samples/{speaker_id}.wav"
|
64 |
+
tts_command = f"tts --text \"{text}\" --model_path checkpoint_85000.pth --language_idx en --config_path config.json --speaker_idx \"{speaker_id}\" --out_path {out_path}"
|
65 |
+
|
66 |
+
# Execute the TTS command
|
67 |
+
os.system(tts_command)
|
samples/VCTK_p294.wav
ADDED
Binary file (220 kB). View file
|
|
samples/VCTK_p297.wav
ADDED
Binary file (228 kB). View file
|
|
samples/VCTK_p299.wav
ADDED
Binary file (212 kB). View file
|
|
samples/VCTK_p300.wav
ADDED
Binary file (219 kB). View file
|
|
samples/VCTK_p301.wav
ADDED
Binary file (215 kB). View file
|
|
samples/VCTK_p305.wav
ADDED
Binary file (239 kB). View file
|
|
samples/VCTK_p306.wav
ADDED
Binary file (237 kB). View file
|
|
samples/VCTK_p308.wav
ADDED
Binary file (191 kB). View file
|
|
samples/VCTK_p310.wav
ADDED
Binary file (229 kB). View file
|
|
samples/VCTK_p318.wav
ADDED
Binary file (221 kB). View file
|
|
samples/VCTK_p329.wav
ADDED
Binary file (222 kB). View file
|
|
samples/VCTK_p330.wav
ADDED
Binary file (242 kB). View file
|
|
samples/VCTK_p333.wav
ADDED
Binary file (208 kB). View file
|
|
samples/VCTK_p339.wav
ADDED
Binary file (211 kB). View file
|
|
samples/VCTK_p341.wav
ADDED
Binary file (234 kB). View file
|
|
samples/VCTK_p361.wav
ADDED
Binary file (204 kB). View file
|
|
samples/VCTK_p362.wav
ADDED
Binary file (211 kB). View file
|
|
speakers-log.json
ADDED
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"VCTK_p294": {
|
3 |
+
"age": 33,
|
4 |
+
"gender": "F",
|
5 |
+
"accents": "American",
|
6 |
+
"region": "San Francisco",
|
7 |
+
"comments": ""
|
8 |
+
},
|
9 |
+
"VCTK_p297": {
|
10 |
+
"age": 20,
|
11 |
+
"gender": "F",
|
12 |
+
"accents": "American",
|
13 |
+
"region": "New York",
|
14 |
+
"comments": ""
|
15 |
+
},
|
16 |
+
"VCTK_p299": {
|
17 |
+
"age": 25,
|
18 |
+
"gender": "F",
|
19 |
+
"accents": "American",
|
20 |
+
"region": "California",
|
21 |
+
"comments": ""
|
22 |
+
},
|
23 |
+
"VCTK_p300": {
|
24 |
+
"age": 23,
|
25 |
+
"gender": "F",
|
26 |
+
"accents": "American",
|
27 |
+
"region": "California",
|
28 |
+
"comments": ""
|
29 |
+
},
|
30 |
+
"VCTK_p301": {
|
31 |
+
"age": 23,
|
32 |
+
"gender": "F",
|
33 |
+
"accents": "American",
|
34 |
+
"region": "North Carolina",
|
35 |
+
"comments": ""
|
36 |
+
},
|
37 |
+
"VCTK_p305": {
|
38 |
+
"age": 19,
|
39 |
+
"gender": "F",
|
40 |
+
"accents": "American",
|
41 |
+
"region": "Philadelphia",
|
42 |
+
"comments": ""
|
43 |
+
},
|
44 |
+
"VCTK_p306": {
|
45 |
+
"age": 21,
|
46 |
+
"gender": "F",
|
47 |
+
"accents": "American",
|
48 |
+
"region": "New York",
|
49 |
+
"comments": ""
|
50 |
+
},
|
51 |
+
"VCTK_p308": {
|
52 |
+
"age": 18,
|
53 |
+
"gender": "F",
|
54 |
+
"accents": "American",
|
55 |
+
"region": "Alabama",
|
56 |
+
"comments": ""
|
57 |
+
},
|
58 |
+
"VCTK_p310": {
|
59 |
+
"age": 21,
|
60 |
+
"gender": "F",
|
61 |
+
"accents": "American",
|
62 |
+
"region": "Tennessee",
|
63 |
+
"comments": ""
|
64 |
+
},
|
65 |
+
"VCTK_p318": {
|
66 |
+
"age": 32,
|
67 |
+
"gender": "F",
|
68 |
+
"accents": "American",
|
69 |
+
"region": "Napa",
|
70 |
+
"comments": ""
|
71 |
+
},
|
72 |
+
"VCTK_p329": {
|
73 |
+
"age": 23,
|
74 |
+
"gender": "F",
|
75 |
+
"accents": "American",
|
76 |
+
"region": "America",
|
77 |
+
"comments": ""
|
78 |
+
},
|
79 |
+
"VCTK_p330": {
|
80 |
+
"age": 26,
|
81 |
+
"gender": "F",
|
82 |
+
"accents": "American",
|
83 |
+
"region": "America",
|
84 |
+
"comments": ""
|
85 |
+
},
|
86 |
+
"VCTK_p333": {
|
87 |
+
"age": 19,
|
88 |
+
"gender": "F",
|
89 |
+
"accents": "American",
|
90 |
+
"region": "Indiana",
|
91 |
+
"comments": ""
|
92 |
+
},
|
93 |
+
"VCTK_p361": {
|
94 |
+
"age": 19,
|
95 |
+
"gender": "F",
|
96 |
+
"accents": "American",
|
97 |
+
"region": "New Jersey",
|
98 |
+
"comments": ""
|
99 |
+
},
|
100 |
+
"VCTK_p362": {
|
101 |
+
"age": 29,
|
102 |
+
"gender": "F",
|
103 |
+
"accents": "American",
|
104 |
+
"region": "America",
|
105 |
+
"comments": ""
|
106 |
+
},
|
107 |
+
"VCTK_p339": {
|
108 |
+
"age": 21,
|
109 |
+
"gender": "F",
|
110 |
+
"accents": "American",
|
111 |
+
"region": "Pennsylvania",
|
112 |
+
"comments": ""
|
113 |
+
},
|
114 |
+
"VCTK_p341": {
|
115 |
+
"age": 26,
|
116 |
+
"gender": "F",
|
117 |
+
"accents": "American",
|
118 |
+
"region": "Ohio",
|
119 |
+
"comments": ""
|
120 |
+
}
|
121 |
+
}
|
supplemental/config_se.json
ADDED
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"model": "speaker_encoder",
|
3 |
+
"run_name": "speaker_encoder",
|
4 |
+
"run_description": "resnet speaker encoder trained with commonvoice all languages dev and train, Voxceleb 1 dev and Voxceleb 2 dev",
|
5 |
+
"epochs": 100000,
|
6 |
+
"batch_size": null,
|
7 |
+
"eval_batch_size": null,
|
8 |
+
"mixed_precision": false,
|
9 |
+
"run_eval": true,
|
10 |
+
"test_delay_epochs": 0,
|
11 |
+
"print_eval": false,
|
12 |
+
"print_step": 50,
|
13 |
+
"tb_plot_step": 100,
|
14 |
+
"tb_model_param_stats": false,
|
15 |
+
"save_step": 1000,
|
16 |
+
"checkpoint": true,
|
17 |
+
"keep_all_best": false,
|
18 |
+
"keep_after": 10000,
|
19 |
+
"num_loader_workers": 8,
|
20 |
+
"num_val_loader_workers": 0,
|
21 |
+
"use_noise_augment": false,
|
22 |
+
"output_path": "../checkpoints/speaker_encoder/language_balanced/normalized/angleproto-4-samples-by-speakers/",
|
23 |
+
"distributed_backend": "nccl",
|
24 |
+
"distributed_url": "tcp://localhost:54321",
|
25 |
+
"audio": {
|
26 |
+
"fft_size": 512,
|
27 |
+
"win_length": 400,
|
28 |
+
"hop_length": 160,
|
29 |
+
"frame_shift_ms": null,
|
30 |
+
"frame_length_ms": null,
|
31 |
+
"stft_pad_mode": "reflect",
|
32 |
+
"sample_rate": 16000,
|
33 |
+
"resample": false,
|
34 |
+
"preemphasis": 0.97,
|
35 |
+
"ref_level_db": 20,
|
36 |
+
"do_sound_norm": false,
|
37 |
+
"do_trim_silence": false,
|
38 |
+
"trim_db": 60,
|
39 |
+
"power": 1.5,
|
40 |
+
"griffin_lim_iters": 60,
|
41 |
+
"num_mels": 64,
|
42 |
+
"mel_fmin": 0.0,
|
43 |
+
"mel_fmax": 8000.0,
|
44 |
+
"spec_gain": 20,
|
45 |
+
"signal_norm": false,
|
46 |
+
"min_level_db": -100,
|
47 |
+
"symmetric_norm": false,
|
48 |
+
"max_norm": 4.0,
|
49 |
+
"clip_norm": false,
|
50 |
+
"stats_path": null,
|
51 |
+
"do_rms_norm": true,
|
52 |
+
"db_level": -27.0
|
53 |
+
},
|
54 |
+
"datasets": [
|
55 |
+
{
|
56 |
+
"name": "voxceleb2",
|
57 |
+
"path": "/workspace/scratch/ecasanova/datasets/VoxCeleb/vox2_dev_aac/",
|
58 |
+
"meta_file_train": null,
|
59 |
+
"ununsed_speakers": null,
|
60 |
+
"meta_file_val": null,
|
61 |
+
"meta_file_attn_mask": "",
|
62 |
+
"language": "voxceleb"
|
63 |
+
}
|
64 |
+
],
|
65 |
+
"model_params": {
|
66 |
+
"model_name": "resnet",
|
67 |
+
"input_dim": 64,
|
68 |
+
"use_torch_spec": true,
|
69 |
+
"log_input": true,
|
70 |
+
"proj_dim": 512
|
71 |
+
},
|
72 |
+
"audio_augmentation": {
|
73 |
+
"p": 0.5,
|
74 |
+
"rir": {
|
75 |
+
"rir_path": "/workspace/store/ecasanova/ComParE/RIRS_NOISES/simulated_rirs/",
|
76 |
+
"conv_mode": "full"
|
77 |
+
},
|
78 |
+
"additive": {
|
79 |
+
"sounds_path": "/workspace/store/ecasanova/ComParE/musan/",
|
80 |
+
"speech": {
|
81 |
+
"min_snr_in_db": 13,
|
82 |
+
"max_snr_in_db": 20,
|
83 |
+
"min_num_noises": 1,
|
84 |
+
"max_num_noises": 1
|
85 |
+
},
|
86 |
+
"noise": {
|
87 |
+
"min_snr_in_db": 0,
|
88 |
+
"max_snr_in_db": 15,
|
89 |
+
"min_num_noises": 1,
|
90 |
+
"max_num_noises": 1
|
91 |
+
},
|
92 |
+
"music": {
|
93 |
+
"min_snr_in_db": 5,
|
94 |
+
"max_snr_in_db": 15,
|
95 |
+
"min_num_noises": 1,
|
96 |
+
"max_num_noises": 1
|
97 |
+
}
|
98 |
+
},
|
99 |
+
"gaussian": {
|
100 |
+
"p": 0.0,
|
101 |
+
"min_amplitude": 0.0,
|
102 |
+
"max_amplitude": 1e-05
|
103 |
+
}
|
104 |
+
},
|
105 |
+
"storage": {
|
106 |
+
"sample_from_storage_p": 0.5,
|
107 |
+
"storage_size": 40
|
108 |
+
},
|
109 |
+
"max_train_step": 1000000,
|
110 |
+
"loss": "angleproto",
|
111 |
+
"grad_clip": 3.0,
|
112 |
+
"lr": 0.0001,
|
113 |
+
"lr_decay": false,
|
114 |
+
"warmup_steps": 4000,
|
115 |
+
"wd": 1e-06,
|
116 |
+
"steps_plot_stats": 100,
|
117 |
+
"num_speakers_in_batch": 100,
|
118 |
+
"num_utters_per_speaker": 4,
|
119 |
+
"skip_speakers": true,
|
120 |
+
"voice_len": 2.0
|
121 |
+
}
|
supplemental/language_ids.json
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"en": 0,
|
3 |
+
"fr-fr": 1,
|
4 |
+
"pt-br": 2
|
5 |
+
}
|
supplemental/model_se.pth.tar
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8f96efb20cbeeefd81fd8336d7f0155bf8902f82f9474e58ccb19d9e12345172
|
3 |
+
size 44610930
|
supplemental/speaker_ids.json
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"female-en-5": 0,
|
3 |
+
"female-en-5\n": 1,
|
4 |
+
"female-pt-4\n": 2,
|
5 |
+
"male-en-2": 3,
|
6 |
+
"male-en-2\n": 4,
|
7 |
+
"male-pt-3\n": 5,
|
8 |
+
"VCTK_p294": 6,
|
9 |
+
"VCTK_p297": 7,
|
10 |
+
"VCTK_p299": 8,
|
11 |
+
"VCTK_p300": 9,
|
12 |
+
"VCTK_p301": 10,
|
13 |
+
"VCTK_p305": 11,
|
14 |
+
"VCTK_p306": 12,
|
15 |
+
"VCTK_p308": 13,
|
16 |
+
"VCTK_p310": 14,
|
17 |
+
"VCTK_p318": 15,
|
18 |
+
"VCTK_p329": 16,
|
19 |
+
"VCTK_p330": 17,
|
20 |
+
"VCTK_p333": 18,
|
21 |
+
"VCTK_p339": 19,
|
22 |
+
"VCTK_p341": 20,
|
23 |
+
"VCTK_p361": 21,
|
24 |
+
"VCTK_p362": 22
|
25 |
+
}
|
supplemental/speakers-base.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
supplemental/speakers-combined.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3c1cc64ed8d2b769cafcfef9bbc89ea6579994a3311ebb3ab585d30b4fe2fb21
|
3 |
+
size 31821551
|
supplemental/speakers-dataset.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:34564e100952d66a78676f41a2f4b8a236e3f3e0222fdbc2b97ae07d98c1e33d
|
3 |
+
size 31640687
|
supplemental/speakers.json
ADDED
Binary file (110 MB). View file
|
|