# video_depth_estimation_mapper Perform depth estimation on the video. 对视频执行深度估计。 Type 算子类型: **mapper** Tags 标签: gpu, video ## 🔧 Parameter Configuration 参数配置 | name 参数名 | type 类型 | default 默认值 | desc 说明 | |--------|------|--------|------| | `video_depth_model_path` | | `'video_depth_anything_vitb.pth'` | The path to the Video-Depth-Anything model. If the model is a 'metric' model, the code will automatically switch to metric mode, and the user should input the path for storing point clouds. | | `point_cloud_dir_for_metric` | | `DATA_JUICER_ASSETS_CACHE` | The path for storing point clouds (for a 'metric' model). | | `max_res` | | `1280` | The maximum resolution threshold for videos; videos exceeding this threshold will be resized. | | `torch_dtype` | | `'fp16'` | The floating point type used for model inference. Can be one of ['fp32', 'fp16'] | | `if_save_visualization` | | `False` | Whether to save visualization results. | | `save_visualization_dir` | | `DATA_JUICER_ASSETS_CACHE` | The path for saving visualization results. | | `grayscale` | | `False` | If True, the colorful palette will not be applied. | | `args` | | `''` | | | `kwargs` | | `''` | | ## 📊 Effect demonstration 效果演示 ### test ```python VideoDepthEstimationMapper(video_depth_model_path='video_depth_anything_vits.pth', point_cloud_dir_for_metric=DATA_JUICER_ASSETS_CACHE, max_res=1280, torch_dtype='fp16', if_save_visualization=True, save_visualization_dir=DATA_JUICER_ASSETS_CACHE, grayscale=False) ``` #### 📥 input data 输入数据
Sample 1: 1 video
video4.mp4:
Sample 2: 1 video
video3.mp4:
#### 📤 output data 输出数据
Sample 1: empty
depth_data
[673, 360, 480]
fps30.0
Sample 2: empty
depth_data
[1190, 640, 362]
fps24.0
### test_metric ```python VideoDepthEstimationMapper(video_depth_model_path='metric_video_depth_anything_vits.pth', point_cloud_dir_for_metric=DATA_JUICER_ASSETS_CACHE, max_res=1280, torch_dtype='fp16', if_save_visualization=True, save_visualization_dir=DATA_JUICER_ASSETS_CACHE, grayscale=False) ``` #### 📥 input data 输入数据
Sample 1: 1 video
video4.mp4:
Sample 2: 1 video
video3.mp4:
#### 📤 output data 输出数据
Sample 1: empty
depth_data
[673, 360, 480]
fps30.0
Sample 2: empty
depth_data
[1190, 640, 362]
fps24.0
## 🔗 related links 相关链接 - [source code 源代码](../../../data_juicer/ops/mapper/video_depth_estimation_mapper.py) - [unit test 单元测试](../../../tests/ops/mapper/test_video_depth_estimation_mapper.py) - [Return operator list 返回算子列表](../../Operators.md)