Skip to content

Commit

Permalink
[Fix] Fix 3d inferencer (#2709)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben-Louis authored Sep 20, 2023
1 parent 1d1350e commit 55aedb6
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions mmpose/apis/inferencers/pose3d_inferencer.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,18 @@ def preprocess_single(self,
bbox_center = stats_info.get('bbox_center', None)
bbox_scale = stats_info.get('bbox_scale', None)

for i, pose_res in enumerate(pose_results_2d):
for j, data_sample in enumerate(pose_res):
pose_results_2d_copy = []
for pose_res in pose_results_2d:
pose_res_copy = []
for data_sample in pose_res:

data_sample_copy = PoseDataSample()
data_sample_copy.gt_instances = \
data_sample.gt_instances.clone()
data_sample_copy.pred_instances = \
data_sample.pred_instances.clone()
data_sample_copy.track_id = data_sample.track_id

kpts = data_sample.pred_instances.keypoints
bboxes = data_sample.pred_instances.bboxes
keypoints = []
Expand All @@ -251,9 +261,12 @@ def preprocess_single(self,
bbox_scale + bbox_center)
else:
keypoints.append(kpt[:, :2])
pose_results_2d[i][j].pred_instances.keypoints = np.array(
keypoints)
pose_sequences_2d = collate_pose_sequence(pose_results_2d, True,
data_sample_copy.pred_instances.set_field(
np.array(keypoints), 'keypoints')
pose_res_copy.append(data_sample_copy)

pose_results_2d_copy.append(pose_res_copy)
pose_sequences_2d = collate_pose_sequence(pose_results_2d_copy, True,
target_idx)
if not pose_sequences_2d:
return []
Expand Down

0 comments on commit 55aedb6

Please sign in to comment.