mirror of
https://github.com/ultralytics/ultralytics
synced 2026-04-21 14:07:18 +00:00
Allow show_conf to be used independently of show_labels in visualization (#23951)
Signed-off-by: Onuralp SEZER <onuralp@ultralytics.com> Co-authored-by: Onuralp SEZER <onuralp@ultralytics.com> Co-authored-by: Jing Qiu <61612323+Laughing-q@users.noreply.github.com>
This commit is contained in:
parent
475e886fdb
commit
aa78ea6b7e
1 changed files with 1 additions and 1 deletions
|
|
@ -534,7 +534,7 @@ class Results(SimpleClass, DataExportMixin):
|
|||
for i, d in enumerate(reversed(pred_boxes)):
|
||||
c, d_conf, id = int(d.cls), float(d.conf) if conf else None, int(d.id.item()) if d.is_track else None
|
||||
name = ("" if id is None else f"id:{id} ") + names[c]
|
||||
label = (f"{name} {d_conf:.2f}" if conf else name) if labels else None
|
||||
label = (f"{name} {d_conf:.2f}" if conf else name) if labels else (f"{d_conf:.2f}" if conf else None)
|
||||
box = d.xyxyxyxy.squeeze() if is_obb else d.xyxy.squeeze()
|
||||
annotator.box_label(
|
||||
box,
|
||||
|
|
|
|||
Loading…
Reference in a new issue