Spaces:
Running
Running
Update Yolov5_Deepsort/models/yolo.py
Browse files
Yolov5_Deepsort/models/yolo.py
CHANGED
@@ -52,7 +52,8 @@ class Detect(nn.Module):
|
|
52 |
self.grid[i] = self._make_grid(nx, ny).to(x[i].device)
|
53 |
|
54 |
y = x[i].sigmoid()
|
55 |
-
if self.inplace:
|
|
|
56 |
y[..., 0:2] = (y[..., 0:2] * 2. - 0.5 + self.grid[i]) * self.stride[i] # xy
|
57 |
y[..., 2:4] = (y[..., 2:4] * 2) ** 2 * self.anchor_grid[i] # wh
|
58 |
else: # for YOLOv5 on AWS Inferentia https://github.com/ultralytics/yolov5/pull/2953
|
|
|
52 |
self.grid[i] = self._make_grid(nx, ny).to(x[i].device)
|
53 |
|
54 |
y = x[i].sigmoid()
|
55 |
+
#if self.inplace:
|
56 |
+
if True:
|
57 |
y[..., 0:2] = (y[..., 0:2] * 2. - 0.5 + self.grid[i]) * self.stride[i] # xy
|
58 |
y[..., 2:4] = (y[..., 2:4] * 2) ** 2 * self.anchor_grid[i] # wh
|
59 |
else: # for YOLOv5 on AWS Inferentia https://github.com/ultralytics/yolov5/pull/2953
|