Skip to content

Commit

Permalink
fix(augmentation): fix Mix augmentation import
Browse files Browse the repository at this point in the history
  • Loading branch information
hbredin committed Nov 8, 2024
1 parent 540fc65 commit dda685f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pyannote/audio/augmentation/mix.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import torch
from torch import Tensor
from torch_audiomentations import Mix
from torch_audiomentations.augmentations.mix import Mix


class MixSpeakerDiarization(Mix):
Expand Down Expand Up @@ -85,7 +85,6 @@ def randomize_parameters(
targets: Optional[Tensor] = None,
target_rate: Optional[int] = None,
):

batch_size, num_channels, num_samples = samples.shape
snr_distribution = torch.distributions.Uniform(
low=torch.tensor(
Expand Down Expand Up @@ -116,7 +115,6 @@ def randomize_parameters(
batch_size, dtype=torch.int64
)
for n in range(max_num_speakers + 1):

# indices of samples with exactly n speakers
samples_with_n_speakers = torch.where(num_speakers == n)[0]
num_samples_with_n_speakers = len(samples_with_n_speakers)
Expand Down

0 comments on commit dda685f

Please sign in to comment.