From 13594cf6d42bc3a49ff226570aa77b6bf7615f7f Mon Sep 17 00:00:00 2001 From: Mohammad Khoshbin Date: Thu, 28 Jul 2022 03:05:17 +0430 Subject: [PATCH] add tensor.detach for yolo_pose bug (#333) --- utils/plots.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/plots.py b/utils/plots.py index fdacc43..fdd8d0e 100644 --- a/utils/plots.py +++ b/utils/plots.py @@ -439,8 +439,8 @@ def output_to_keypoint(output): for i, o in enumerate(output): kpts = o[:,6:] o = o[:,:6] - for index, (*box, conf, cls) in enumerate(o.cpu().numpy()): - targets.append([i, cls, *list(*xyxy2xywh(np.array(box)[None])), conf, *list(kpts.cpu().numpy()[index])]) + for index, (*box, conf, cls) in enumerate(o.detach().cpu().numpy()): + targets.append([i, cls, *list(*xyxy2xywh(np.array(box)[None])), conf, *list(kpts.detach().cpu().numpy()[index])]) return np.array(targets)