data_juicer.ops.mapper.video_camera_calibration_deepcalib_mapper module#

class data_juicer.ops.mapper.video_camera_calibration_deepcalib_mapper.VideoCameraCalibrationDeepcalibMapper(*args, **kwargs)[source]#

Bases: Mapper

Compute the camera intrinsics and field of view (FOV) for a static camera using DeepCalib.

__init__(model_path: str = 'weights_10_0.02.h5', frame_field: str = 'video_frames', tag_field_name: str = 'camera_calibration_deepcalib_tags', frame_batch_size: int = 8, *args, **kwargs)[source]#

Initialization method.

Parameters:
  • model_path – The path to the DeepCalib Regression model.

  • frame_field – The field name where the video frames are stored.

  • tag_field_name – The field name to store the tags. It’s “camera_calibration_deepcalib_tags” in default.

  • frame_batch_size – Number of frames to batch together for GPU inference. Larger values improve throughput but require more VRAM. Default: 8.

  • args – extra args

  • kwargs – extra args

process_single(sample=None, rank=None)[source]#

For sample level, sample –> sample

Parameters:

sample – sample to process

Returns:

processed sample