mirror of https://github.com/coqui-ai/TTS.git
fix type annotations
This commit is contained in:
parent
ab7f299d48
commit
e229f5c081
|
@ -241,7 +241,7 @@ class SpeakerManager:
|
||||||
"""
|
"""
|
||||||
return [x["embedding"] for x in self.x_vectors.values() if x["name"] == speaker_idx]
|
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.
|
"""Get mean x_vector of a speaker ID.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
@ -250,7 +250,7 @@ class SpeakerManager:
|
||||||
randomize (bool, optional): Pick random `num_samples`of x_vectors. Defaults to False.
|
randomize (bool, optional): Pick random `num_samples`of x_vectors. Defaults to False.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
np.Array: Mean x_vector.
|
np.ndarray: Mean x_vector.
|
||||||
"""
|
"""
|
||||||
x_vectors = self.get_x_vectors_by_speaker(speaker_idx)
|
x_vectors = self.get_x_vectors_by_speaker(speaker_idx)
|
||||||
if num_samples is None:
|
if num_samples is None:
|
||||||
|
@ -315,11 +315,11 @@ class SpeakerManager:
|
||||||
x_vector = _compute(wav_file)
|
x_vector = _compute(wav_file)
|
||||||
return x_vector[0].tolist()
|
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.
|
"""Compute x_vector from features.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
feats (Union[torch.Tensor, np.Array]): Input features.
|
feats (Union[torch.Tensor, np.ndarray]): Input features.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
List: computed x_vector.
|
List: computed x_vector.
|
||||||
|
|
Loading…
Reference in New Issue