MCPcopy Create free account
hub / github.com/Walter0807/MotionBERT / flip_data

Function flip_data

lib/utils/utils_data.py:54–66  ·  view source on GitHub ↗

horizontal flip data: [N, F, 17, D] or [F, 17, D]. X (horizontal coordinate) is the first channel in D. Return result: same

(data)

Source from the content-addressed store, hash-verified

52 return result
53
54def flip_data(data):
55 """
56 horizontal flip
57 data: [N, F, 17, D] or [F, 17, D]. X (horizontal coordinate) is the first channel in D.
58 Return
59 result: same
60 """
61 left_joints = [4, 5, 6, 11, 12, 13]
62 right_joints = [1, 2, 3, 14, 15, 16]
63 flipped_data = copy.deepcopy(data)
64 flipped_data[..., 0] *= -1 # flip x of all joints
65 flipped_data[..., left_joints+right_joints, :] = flipped_data[..., right_joints+left_joints, :]
66 return flipped_data
67
68def resample(ori_len, target_len, replay=False, randomness=True):
69 if replay:

Callers 9

infer_wild_mesh.pyFile · 0.90
evaluateFunction · 0.90
infer_wild.pyFile · 0.90
__getitem__Method · 0.90
__getitem__Method · 0.90
augment3DMethod · 0.90
__getitem__Method · 0.90
__getitem__Method · 0.90
validateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected