Open hhwer opened 1 year ago
In file “AlphaPose/tree/master/scripts/demo_api.py” line 255-line 258,the operation on tensors takes a long time when there are many person.
pose_coords.append(torch.from_numpy(pose_coord).unsqueeze(0)) pose_scores.append(torch.from_numpy(pose_score).unsqueeze(0)) preds_img = torch.cat(pose_coords) preds_scores = torch.cat(pose_scores)
Just keep the data as numpy with original shape, and use numpy.stack to combine thems will save lots of time.
pose_coords.append(pose_coord) pose_scores.append(pose_score) preds_img = np.stack(pose_coords) pose_scores =np.stack(pose_scores)
In file “AlphaPose/tree/master/scripts/demo_api.py” line 255-line 258,the operation on tensors takes a long time when there are many person.
Just keep the data as numpy with original shape, and use numpy.stack to combine thems will save lots of time.