Просмотр исходного кода

Hub device mismatch bug fix (#1619)

5.0
Glenn Jocher GitHub 3 лет назад
Родитель
Сommit
68e6ab668b
Не найден GPG ключ соответствующий данной подписи Идентификатор GPG ключа: 4AEE18F83AFDEB23
1 измененных файлов: 2 добавлений и 2 удалений
  1. +2
    -2
      utils/general.py

+ 2
- 2
utils/general.py Просмотреть файл

@@ -265,7 +265,7 @@ def non_max_suppression(prediction, conf_thres=0.1, iou_thres=0.6, classes=None,
detections with shape: nx6 (x1, y1, x2, y2, conf, cls)
"""

nc = prediction[0].shape[1] - 5 # number of classes
nc = prediction.shape[2] - 5 # number of classes
xc = prediction[..., 4] > conf_thres # candidates

# Settings
@@ -277,7 +277,7 @@ def non_max_suppression(prediction, conf_thres=0.1, iou_thres=0.6, classes=None,
merge = False # use merge-NMS

t = time.time()
output = [torch.zeros(0, 6)] * prediction.shape[0]
output = [torch.zeros((0, 6), device=prediction.device)] * prediction.shape[0]
for xi, x in enumerate(prediction): # image index, image inference
# Apply constraints
# x[((x[..., 2:4] < min_wh) | (x[..., 2:4] > max_wh)).any(1), 4] = 0 # width-height

Загрузка…
Отмена
Сохранить