Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Fix 3d inferencer to improve performance with videopose3d #2709

Merged
merged 1 commit into from
Sep 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading