Skip to content

Commit

Permalink
[Fix] MotionbertLabel codec (#2739)
Browse files Browse the repository at this point in the history
  • Loading branch information
LareinaM committed Oct 9, 2023
1 parent 0549504 commit 134aca9
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions mmpose/codecs/motionbert_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,6 @@ def encode(self,
if keypoints_visible is None:
keypoints_visible = np.ones(keypoints.shape[:2], dtype=np.float32)

if lifting_target is None:
lifting_target = [keypoints[..., 0, :, :]]

# set initial value for `lifting_target_weight`
if lifting_target_visible is None:
lifting_target_visible = np.ones(
Expand All @@ -127,6 +124,7 @@ def encode(self,

encoded = dict()

assert lifting_target is not None
lifting_target_label = lifting_target.copy()
keypoint_labels = keypoints.copy()

Expand Down Expand Up @@ -154,9 +152,7 @@ def encode(self,
if self.mode == 'train':
w, h = w / 1000, h / 1000
lifting_target_label[
..., :2] = lifting_target_label[..., :2] / w * 2 - [
0.001, h / w
]
..., :2] = lifting_target_label[..., :2] / w * 2 - [1, h / w]
lifting_target_label[..., 2] = lifting_target_label[..., 2] / w * 2
lifting_target_label[..., :, :] = lifting_target_label[
..., :, :] - lifting_target_label[...,
Expand Down

0 comments on commit 134aca9

Please sign in to comment.