mirror of
https://github.com/macaodha/batdetect2.git
synced 2026-01-10 17:19:34 +01:00
Move detections array to cpu
This commit is contained in:
parent
5b9a5a968f
commit
d3d2a28130
@ -24,7 +24,6 @@ from batdetect2.preprocess import MAX_FREQ, MIN_FREQ
|
||||
from batdetect2.typing import ModelOutput
|
||||
from batdetect2.typing.postprocess import (
|
||||
BatDetect2Prediction,
|
||||
DetectionsArray,
|
||||
DetectionsTensor,
|
||||
PostprocessorProtocol,
|
||||
RawPrediction,
|
||||
|
||||
@ -96,12 +96,12 @@ class DetectionsTensor(NamedTuple):
|
||||
|
||||
def numpy(self) -> DetectionsArray:
|
||||
return DetectionsArray(
|
||||
scores=self.scores.detach().numpy(),
|
||||
sizes=self.sizes.detach().numpy(),
|
||||
class_scores=self.class_scores.detach().numpy(),
|
||||
times=self.times.detach().numpy(),
|
||||
frequencies=self.frequencies.detach().numpy(),
|
||||
features=self.features.detach().numpy(),
|
||||
scores=self.scores.detach().cpu().numpy(),
|
||||
sizes=self.sizes.detach().cpu().numpy(),
|
||||
class_scores=self.class_scores.detach().cpu().numpy(),
|
||||
times=self.times.detach().cpu().numpy(),
|
||||
frequencies=self.frequencies.detach().cpu().numpy(),
|
||||
features=self.features.detach().cpu().numpy(),
|
||||
)
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user