mirror of
https://github.com/pyannote/pyannote-audio.git
synced 2026-11-20 13:07:51 +09:00
improve: use "linear" interpolation instead of "nearest"
This commit is contained in:
1 parent
977c3de8f7
commit
9c3fec0152
1 file changed
+2
-1
@@ -64,6 +64,7 @@ class StatsPool(nn.Module):
|
||||
|
||||
else:
|
||||
weights = weights.unsqueeze(dim=1)
|
||||
# (batch, 1, frames)
|
||||
|
||||
num_frames = sequences.shape[2]
|
||||
num_weights = weights.shape[2]
|
||||
@@ -71,7 +72,7 @@ class StatsPool(nn.Module):
|
||||
warnings.warn(
|
||||
f"Mismatch between frames ({num_frames}) and weights ({num_weights}) numbers."
|
||||
)
|
||||
weights = F.interpolate(weights, size=num_frames, mode="nearest")
|
||||
weights = F.interpolate(weights, size=num_frames, mode="linear")
|
||||
|
||||
v1 = weights.sum(dim=2)
|
||||
mean = torch.sum(sequences * weights, dim=2) / v1
|
||||
|
||||
Reference in new issue
Block a user