Browse Source
Fix for stereo audio
Signed-off-by: Jael Gu <mengjia.gu@zilliz.com>
main
1 changed files with
2 additions and
1 deletions
-
panns.py
|
|
@ -74,7 +74,8 @@ class Panns(NNOperator): |
|
|
|
resampler = torchaudio.transforms.Resample(sr, self.sample_rate, dtype=audio.dtype) |
|
|
|
audio = resampler(audio) |
|
|
|
|
|
|
|
audio = audio[None, :] |
|
|
|
if len(audio.shape) == 1: |
|
|
|
audio = audio[None, :] |
|
|
|
clipwise_output, embedding = self.tagger.inference(audio) |
|
|
|
|
|
|
|
sorted_indexes = numpy.argsort(clipwise_output[0])[::-1] |
|
|
|