diff --git a/panns.py b/panns.py index b6af5c0..76635bb 100644 --- a/panns.py +++ b/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) diff --git a/result.png b/result.png index f7861af..396f9d1 100644 Binary files a/result.png and b/result.png differ