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] MotionbertLabel codec #2739

Merged
merged 2 commits into from
Oct 9, 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
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
Loading