|
|
@ -535,9 +535,9 @@ class Results(SimpleClass): |
|
|
|
# Plot Detect results |
|
|
|
# Plot Detect results |
|
|
|
if pred_boxes is not None and show_boxes: |
|
|
|
if pred_boxes is not None and show_boxes: |
|
|
|
for i, d in enumerate(reversed(pred_boxes)): |
|
|
|
for i, d in enumerate(reversed(pred_boxes)): |
|
|
|
c, conf, id = int(d.cls), float(d.conf) if conf else None, None if d.id is None else int(d.id.item()) |
|
|
|
c, d_conf, id = int(d.cls), float(d.conf) if conf else None, None if d.id is None else int(d.id.item()) |
|
|
|
name = ("" if id is None else f"id:{id} ") + names[c] |
|
|
|
name = ("" if id is None else f"id:{id} ") + names[c] |
|
|
|
label = (f"{name} {conf:.2f}" if conf else name) if labels else None |
|
|
|
label = (f"{name} {d_conf:.2f}" if conf else name) if labels else None |
|
|
|
box = d.xyxyxyxy.reshape(-1, 4, 2).squeeze() if is_obb else d.xyxy.squeeze() |
|
|
|
box = d.xyxyxyxy.reshape(-1, 4, 2).squeeze() if is_obb else d.xyxy.squeeze() |
|
|
|
annotator.box_label( |
|
|
|
annotator.box_label( |
|
|
|
box, |
|
|
|
box, |
|
|
|