data_juicer.ops.mapper.video_clip_reassembly_mapper module#
- class data_juicer.ops.mapper.video_clip_reassembly_mapper.VideoClipReassemblyMapper(*args, **kwargs)[source]#
Bases:
MapperReassemble hand-action results from overlapping video clips.
When long videos are chopped into overlapping clips (e.g. 5 s with 2 s overlap via
VideoSplitByDurationMapper), each clip is processed independently through the 3-D motion labelling pipeline. This operator merges the per-clip results back into one unified result per original video, including:hand_action_tagsโ states, actions, valid_frame_ids, jointsvideo_camera_pose_tagsโcam_c2warrayhand_reconstruction_hawor_tagsโ frame_ids converted to globalvideo_framesโ per-clip frame path lists merged into one global listcamera_calibration_moge_tagsโ per-clip depth/intrinsics mergedclipsโ replaced with the original video path
Clip global offsets are determined automatically by pixel-matching overlapping frames between consecutive clips, rather than assuming an ideal step size. This handles ffmpeg keyframe-alignment drift that causes actual clip boundaries to differ from the nominal
(split_duration - overlap_duration) * fpscalculation.- Reference (paper ยง3.1):
โTo enhance efficiency, we chop long videos into overlapping 20-second clips in this stage and recompose their results.โ
- __init__(hand_action_field: str = 'hand_action_tags', camera_pose_field: str = 'video_camera_pose_tags', hand_reconstruction_field: str = 'hand_reconstruction_hawor_tags', frame_field: str = 'video_frames', moge_field: str = 'camera_calibration_moge_tags', clip_field: str = 'clips', video_key: str = 'videos', split_duration: float = None, overlap_duration: float = None, fps: float = None, *args, **kwargs)[source]#
Base class that conducts data editing.
- Parameters:
text_key โ the key name of field that stores sample texts to be processed.
image_key โ the key name of field that stores sample image list to be processed
audio_key โ the key name of field that stores sample audio list to be processed
video_key โ the key name of field that stores sample video list to be processed
image_bytes_key โ the key name of field that stores sample image bytes list to be processed
query_key โ the key name of field that stores sample queries
response_key โ the key name of field that stores responses
history_key โ the key name of field that stores history of queries and responses