logo
Browse Source

Update

Signed-off-by: Jael Gu <mengjia.gu@zilliz.com>
main
Jael Gu 2 years ago
parent
commit
bc450b89c2
  1. 2
      panns.py
  2. BIN
      result.png

2
panns.py

@ -57,7 +57,6 @@ class Panns(NNOperator):
self.tagger = AudioTagging(checkpoint_path=weights_path, device=self.device)
self.model = self.tagger.model
self.model.eval()
self.model.to(self.device)
def __call__(self, data: List[AudioFrame]):
sr = data[0].sample_rate
@ -71,6 +70,7 @@ class Panns(NNOperator):
audio = self.int2float(audio).astype('float32')
if sr != self.sample_rate:
audio = torch.from_numpy(audio)
resampler = torchaudio.transforms.Resample(sr, self.sample_rate, dtype=audio.dtype)
audio = resampler(audio)

BIN
result.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Loading…
Cancel
Save