From 863b0fc0f98bec37b479e5880709486ca3fcf7cc Mon Sep 17 00:00:00 2001 From: Zifan Jiang Date: Mon, 17 Mar 2025 17:45:26 +0000 Subject: [PATCH 1/2] fix masking issue in interpolate --- src/python/pose_format/numpy/pose_body.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/python/pose_format/numpy/pose_body.py b/src/python/pose_format/numpy/pose_body.py index 60d60ea..ccfab49 100644 --- a/src/python/pose_format/numpy/pose_body.py +++ b/src/python/pose_format/numpy/pose_body.py @@ -339,13 +339,18 @@ def interpolate(self, new_fps: int = None, kind='cubic'): for people in points: new_frames = [] for frames in people: - mask = frames.transpose()[0].mask + mask = frames.transpose()[-1].mask + # print(mask) partial_steps = ma.array(steps, mask=mask).compressed() if partial_steps.shape[0] == 0: # No data for this point new_frames.append(np.zeros((_new_frames, frames.shape[1]))) else: + # print(frames) + # print(frames.shape) + # print(frames.compressed().shape) + # print(partial_steps.shape) partial_frames = frames.compressed().reshape(partial_steps.shape[0], frames.shape[1]) if len(partial_steps) == 1: From 35904a865a03adf8a2a69adbf8a0357fcbe17f61 Mon Sep 17 00:00:00 2001 From: Zifan Jiang Date: Fri, 21 Mar 2025 15:00:10 +0000 Subject: [PATCH 2/2] remove and add comments --- src/python/pose_format/numpy/pose_body.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/python/pose_format/numpy/pose_body.py b/src/python/pose_format/numpy/pose_body.py index ccfab49..4f01618 100644 --- a/src/python/pose_format/numpy/pose_body.py +++ b/src/python/pose_format/numpy/pose_body.py @@ -339,18 +339,13 @@ def interpolate(self, new_fps: int = None, kind='cubic'): for people in points: new_frames = [] for frames in people: - mask = frames.transpose()[-1].mask - # print(mask) + mask = frames.transpose()[-1].mask # takes mask from confidence value partial_steps = ma.array(steps, mask=mask).compressed() if partial_steps.shape[0] == 0: # No data for this point new_frames.append(np.zeros((_new_frames, frames.shape[1]))) else: - # print(frames) - # print(frames.shape) - # print(frames.compressed().shape) - # print(partial_steps.shape) partial_frames = frames.compressed().reshape(partial_steps.shape[0], frames.shape[1]) if len(partial_steps) == 1: