data_juicer.ops.mapper.video_hand_motion_smooth_mapper module#

class data_juicer.ops.mapper.video_hand_motion_smooth_mapper.VideoHandMotionSmoothMapper(*args, **kwargs)[源代码]#

基类:Mapper

Apply smoothing to world-space hand motions and remove outliers.

Reads hand action results (states, actions, joints_world) produced by VideoHandActionComputeMapper and applies:

  1. Extreme outlier replacement — frames whose instantaneous wrist speed exceeds median + outlier_velocity_threshold * MAD are replaced by linear interpolation from neighbors (not deleted).

  2. Savitzky-Golay smoothing — positions are smoothed with a Savitzky-Golay filter that preserves motion peaks while removing high-frequency jitter.

  3. Quaternion smoothing — orientations are smoothed in quaternion space to avoid gimbal lock and discontinuities.

  4. Action recomputation — 7-DoF actions are re-derived from the smoothed states so they stay consistent.

Reference (paper §3.1):

"we apply spline smoothing to the world-space hand motions and remove outliers"

__init__(hand_action_field: str = 'hand_action_tags', savgol_window: int = 11, savgol_polyorder: int = 3, outlier_velocity_threshold: float = 5.0, min_frames_for_smoothing: int = 5, smooth_joints: bool = True, *args, **kwargs)[源代码]#

Initialization method.

参数:
  • hand_action_field -- Meta field storing hand action results (output of VideoHandActionComputeMapper).

  • savgol_window -- Window length for Savitzky-Golay filter. Must be odd. Larger = smoother but may lose fast motions.

  • savgol_polyorder -- Polynomial order for Savitzky-Golay filter. Must be less than savgol_window.

  • outlier_velocity_threshold -- Frames whose wrist speed exceeds median + threshold * MAD are replaced by interpolation. Higher = more conservative (fewer replacements).

  • min_frames_for_smoothing -- Minimum number of valid frames required to apply smoothing.

  • smooth_joints -- Whether to also smooth joints_world (21-joint MANO skeleton in world space).

process_single(sample=None, rank=None)[源代码]#

For sample level, sample --> sample

参数:

sample -- sample to process

返回:

processed sample