bert
bert copied to clipboard
fix
https://github.com/WongKinYiu/yolov7/blob/a4724d55924708b4cee0dacbc875545b4b3abe3f/utils/plots.py#L436
# utils/plots.py #L436-L444
def output_to_keypoint(output):
# Convert model output to target format [batch_id, class_id, x, y, w, h, conf]
targets = []
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.detach().cpu().numpy()[index])])
return np.array(targets)