Spaces:
Sleeping
Sleeping
put max_iou fix in call rather then line just for that
Browse files- user-friendly-metrics.py +1 -3
user-friendly-metrics.py
CHANGED
|
@@ -133,15 +133,13 @@ def calculate(predictions,
|
|
| 133 |
if np_references[:, 0].min() <= 0:
|
| 134 |
raise ValueError("The frame number in the references should be a positive integer")
|
| 135 |
|
| 136 |
-
max_iou = 1-max_iou #motmetrics expects iou association threshold to be smaller for stricter association
|
| 137 |
-
|
| 138 |
num_frames = int(max(np_references[:, 0].max(), np_predictions[:, 0].max()))
|
| 139 |
|
| 140 |
acc = mm.MOTAccumulator(auto_id=True)
|
| 141 |
for i in range(1, num_frames+1):
|
| 142 |
preds = np_predictions[np_predictions[:, 0] == i, 1:6]
|
| 143 |
refs = np_references[np_references[:, 0] == i, 1:6]
|
| 144 |
-
C = mm.distances.iou_matrix(refs[:,1:], preds[:,1:], max_iou = max_iou)
|
| 145 |
acc.update(refs[:,0].astype('int').tolist(), preds[:,0].astype('int').tolist(), C)
|
| 146 |
|
| 147 |
mh = mm.metrics.create()
|
|
|
|
| 133 |
if np_references[:, 0].min() <= 0:
|
| 134 |
raise ValueError("The frame number in the references should be a positive integer")
|
| 135 |
|
|
|
|
|
|
|
| 136 |
num_frames = int(max(np_references[:, 0].max(), np_predictions[:, 0].max()))
|
| 137 |
|
| 138 |
acc = mm.MOTAccumulator(auto_id=True)
|
| 139 |
for i in range(1, num_frames+1):
|
| 140 |
preds = np_predictions[np_predictions[:, 0] == i, 1:6]
|
| 141 |
refs = np_references[np_references[:, 0] == i, 1:6]
|
| 142 |
+
C = mm.distances.iou_matrix(refs[:,1:], preds[:,1:], max_iou = 1-max_iou) #motmetrics expects iou association threshold to be smaller for stricter association
|
| 143 |
acc.update(refs[:,0].astype('int').tolist(), preds[:,0].astype('int').tolist(), C)
|
| 144 |
|
| 145 |
mh = mm.metrics.create()
|