add tensor.detach for yolo_pose bug (#333)

pull/342/head
Mohammad Khoshbin 2022-07-28 03:05:17 +04:30 committed by GitHub
parent 86cc5d0c4f
commit 13594cf6d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -439,8 +439,8 @@ def output_to_keypoint(output):
for i, o in enumerate(output): for i, o in enumerate(output):
kpts = o[:,6:] kpts = o[:,6:]
o = o[:,:6] o = o[:,:6]
for index, (*box, conf, cls) in enumerate(o.cpu().numpy()): for index, (*box, conf, cls) in enumerate(o.detach().cpu().numpy()):
targets.append([i, cls, *list(*xyxy2xywh(np.array(box)[None])), conf, *list(kpts.cpu().numpy()[index])]) targets.append([i, cls, *list(*xyxy2xywh(np.array(box)[None])), conf, *list(kpts.detach().cpu().numpy()[index])])
return np.array(targets) return np.array(targets)