Unverified 提交 52c1399f authored 作者: Glenn Jocher's avatar Glenn Jocher 提交者: GitHub

DetectMultiBackend() return `device` update (#6958)

Fixes ONNX validation that returns outputs on CPU.
上级 c84dd27d
......@@ -458,7 +458,8 @@ class DetectMultiBackend(nn.Module):
y = (y.astype(np.float32) - zero_point) * scale # re-scale
y[..., :4] *= [w, h, w, h] # xywh normalized to pixels
y = torch.tensor(y) if isinstance(y, np.ndarray) else y
if isinstance(y, np.ndarray):
y = torch.tensor(y, device=self.device)
return (y, []) if val else y
def warmup(self, imgsz=(1, 3, 640, 640)):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论