Spaces:
Sleeping
Sleeping
fixed nan
Browse files- box-metrics.py +2 -5
box-metrics.py
CHANGED
@@ -156,7 +156,7 @@ class box_metrics(evaluate.Metric):
|
|
156 |
detections_i = detections_i.astype(int)
|
157 |
|
158 |
for pair in zip(labels_i, detections_i, ious_v):
|
159 |
-
|
160 |
iou = pair[2]
|
161 |
t_box = frame_labels[pair[0]][1:]
|
162 |
p_box = frame_detections[pair[1]][:4]
|
@@ -176,9 +176,6 @@ class box_metrics(evaluate.Metric):
|
|
176 |
p_w = p_box[2].item()-p_box[0].item()
|
177 |
t_h = t_box[3].item()-t_box[1].item()
|
178 |
p_h = p_box[3].item()-p_box[1].item()
|
179 |
-
|
180 |
-
if t_h < 10:
|
181 |
-
continue
|
182 |
|
183 |
ious = np.append(ious, iou)
|
184 |
beps = np.append(beps, bep)
|
@@ -192,7 +189,7 @@ class box_metrics(evaluate.Metric):
|
|
192 |
e_n_heights = np.append(e_n_heights, (p_h-t_h)/t_h)
|
193 |
e_n_bottom_x = np.append(e_n_bottom_x, (p_xc-t_xc)/t_w)
|
194 |
e_n_bottom_y = np.append(e_n_bottom_y, (p_yc-t_yc)/t_h)
|
195 |
-
|
196 |
output[sequence][model] = {
|
197 |
"iou": np.mean(ious),
|
198 |
"bep": np.mean(beps),
|
|
|
156 |
detections_i = detections_i.astype(int)
|
157 |
|
158 |
for pair in zip(labels_i, detections_i, ious_v):
|
159 |
+
|
160 |
iou = pair[2]
|
161 |
t_box = frame_labels[pair[0]][1:]
|
162 |
p_box = frame_detections[pair[1]][:4]
|
|
|
176 |
p_w = p_box[2].item()-p_box[0].item()
|
177 |
t_h = t_box[3].item()-t_box[1].item()
|
178 |
p_h = p_box[3].item()-p_box[1].item()
|
|
|
|
|
|
|
179 |
|
180 |
ious = np.append(ious, iou)
|
181 |
beps = np.append(beps, bep)
|
|
|
189 |
e_n_heights = np.append(e_n_heights, (p_h-t_h)/t_h)
|
190 |
e_n_bottom_x = np.append(e_n_bottom_x, (p_xc-t_xc)/t_w)
|
191 |
e_n_bottom_y = np.append(e_n_bottom_y, (p_yc-t_yc)/t_h)
|
192 |
+
|
193 |
output[sequence][model] = {
|
194 |
"iou": np.mean(ious),
|
195 |
"bep": np.mean(beps),
|