-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.py
More file actions
36 lines (25 loc) · 853 Bytes
/
Copy pathexample.py
File metadata and controls
36 lines (25 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from speaker_identifier import *
""" Flags for execution control"""
TRAINING_VAD = True # whether to use VAD for training data
PREDICTING_VAD = True # whether to use VAD for predicting data
def main():
train_example_dir = "example_data/train_data"
test_example_dir = "example_data/test_data"
user1 = SpeakerIdentifier(
model_name="user1",
training_ds_dir=train_example_dir,
)
user1.train(
train_data_dir=train_example_dir,
with_vad=TRAINING_VAD,
)
predictions = user1.predict(
test_data_dir=test_example_dir,
with_vad=PREDICTING_VAD,
)
print("audio: prediction")
for key, value in predictions.items():
print(f"{key}: {value.best_prediction}")
print(user1.timer)
if __name__ == "__main__":
main()