Add Dockerfile-conda FROM continuumio/miniconda3:latest (#4706)

This commit is contained in:
Glenn Jocher 2023-09-03 23:44:11 +02:00 committed by GitHub
parent 02b857e14c
commit a1c1d6b483
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 152 additions and 28 deletions

View file

@ -24,7 +24,6 @@ from pathlib import Path
import numpy as np
import torch
from scipy.optimize import linear_sum_assignment
from ultralytics.cfg import get_cfg, get_save_dir
from ultralytics.data.utils import check_cls_dataset, check_det_dataset
@ -226,9 +225,11 @@ class BaseValidator:
iou = iou.cpu().numpy()
for i, threshold in enumerate(self.iouv.cpu().tolist()):
if use_scipy:
# WARNING: known issue that reduces mAP in https://github.com/ultralytics/ultralytics/pull/4708
import scipy # scope import to avoid importing for all commands
cost_matrix = iou * (iou >= threshold)
if cost_matrix.any():
labels_idx, detections_idx = linear_sum_assignment(cost_matrix, maximize=True)
labels_idx, detections_idx = scipy.optimize.linear_sum_assignment(cost_matrix, maximize=True)
valid = cost_matrix[labels_idx, detections_idx] > 0
if valid.any():
correct[detections_idx[valid], i] = True