diff --git a/ultralytics/yolo/engine/results.py b/ultralytics/yolo/engine/results.py index c347da0..4e9f6f3 100644 --- a/ultralytics/yolo/engine/results.py +++ b/ultralytics/yolo/engine/results.py @@ -290,8 +290,8 @@ class Results(SimpleClass): seg = masks[j].xyn[0].copy().reshape(-1) # reversed mask.xyn, (n,2) to (n*2) line = (c, *seg) if kpts is not None: - kpt = kpts[j].xyn.reshape(-1).tolist() - line += (*kpt, ) + kpt = torch.cat((kpts[j].xyn, kpts[j].conf[..., None]), 2) if kpts[j].has_visible else kpts[j].xyn + line += (*kpt.reshape(-1).tolist(), ) line += (conf, ) * save_conf + (() if id is None else (id, )) texts.append(('%g ' * len(line)).rstrip() % line)