fix type annotations

pull/602/head
Eren Gölge 2021-06-01 09:45:59 +02:00
parent ab7f299d48
commit e229f5c081
1 changed files with 4 additions and 4 deletions

View File

@ -241,7 +241,7 @@ class SpeakerManager:
"""
return [x["embedding"] for x in self.x_vectors.values() if x["name"] == speaker_idx]
def get_mean_x_vector(self, speaker_idx: str, num_samples: int = None, randomize: bool = False) -> np.Array:
def get_mean_x_vector(self, speaker_idx: str, num_samples: int = None, randomize: bool = False) -> np.ndarray:
"""Get mean x_vector of a speaker ID.
Args:
@ -250,7 +250,7 @@ class SpeakerManager:
randomize (bool, optional): Pick random `num_samples`of x_vectors. Defaults to False.
Returns:
np.Array: Mean x_vector.
np.ndarray: Mean x_vector.
"""
x_vectors = self.get_x_vectors_by_speaker(speaker_idx)
if num_samples is None:
@ -315,11 +315,11 @@ class SpeakerManager:
x_vector = _compute(wav_file)
return x_vector[0].tolist()
def compute_x_vector(self, feats: Union[torch.Tensor, np.Array]) -> List:
def compute_x_vector(self, feats: Union[torch.Tensor, np.ndarray]) -> List:
"""Compute x_vector from features.
Args:
feats (Union[torch.Tensor, np.Array]): Input features.
feats (Union[torch.Tensor, np.ndarray]): Input features.
Returns:
List: computed x_vector.