diff --git a/modules/thirdparty/image/depth_estimation/MiDaS_Large/README.md b/modules/thirdparty/image/depth_estimation/MiDaS_Large/README.md index 319c8a53c7c34c962c542e7edbf67690073a7b8e..ce6d1028e2a82e05a53377a6d115a7425fae84c1 100644 --- a/modules/thirdparty/image/depth_estimation/MiDaS_Large/README.md +++ b/modules/thirdparty/image/depth_estimation/MiDaS_Large/README.md @@ -1,73 +1,92 @@ -## 模型概述 -MiDas v2.1 large 单目深度估计模型 +# MiDaS_Large -模型可通过输入图像估计其中的深度信息 +|模型名称|MiDaS_Large| +| :--- | :---: | +|类别|图像 - 深度估计| +|网络|-| +|数据集|3D Movies, WSVD, ReDWeb, MegaDepth| +|是否支持Fine-tuning|否| +|模型大小|399MB| +|最新更新日期|2021-02-26| +|数据指标|-| -模型权重转换自 [MiDas](https://github.com/intel-isl/MiDaS) 官方开源项目 +## 一、模型基本信息 -## 模型安装 +- ### 应用效果展示 + - 样例结果示例: +

+
+

-```shell -$hub install MiDaS_Large -``` -## 效果展示 -![效果展示](https://img-blog.csdnimg.cn/20201227112600975.jpg) +- ### 模型介绍 -## API 说明 + - MiDaS_Large是一个单目深度估计模型,模型可通过输入图像估计其中的深度信息。 -```python -def depth_estimation( - images=None, - paths=None, - batch_size=1, - output_dir='output', - visualization=False -) -``` -深度估计API +## 二、安装 -**参数** +- ### 1、环境依赖 -* images (list\[numpy.ndarray\]): 图片数据,ndarray.shape 为 \[H, W, C\],默认为 None; -* paths (list\[str\]): 图片的路径,默认为 None; -* batch\_size (int): batch 的大小,默认设为 1; -* visualization (bool): 是否将识别结果保存为图片文件,默认设为 False; -* output\_dir (str): 图片的保存路径,默认设为 output。 + - paddlepaddle >= 2.0.0 + - paddlehub >= 2.0.0 | [如何安装paddlehub](../../../../docs/docs_ch/get_start/installation.rst) -**返回** +- ### 2、安装 -* res (list\[numpy.ndarray\]): 图像深度数据,ndarray.shape 为 \[H, W\]。 + - ```shell + $ hub install MiDaS_Large + ``` + - 如您安装时遇到问题,可参考:[零基础windows安装](../../../../docs/docs_ch/get_start/windows_quickstart.md) + | [零基础Linux安装](../../../../docs/docs_ch/get_start/linux_quickstart.md) | [零基础MacOS安装](../../../../docs/docs_ch/get_start/mac_quickstart.md) +## 三、模型API预测 -## 预测代码示例 +- ### 1、代码示例 -```python -import cv2 -import paddlehub as hub + - ```python + import paddlehub as hub + import cv2 -# 模型加载 -# use_gpu:是否使用GPU进行预测 -model = hub.Module(name='MiDaS_Large', use_gpu=False) + model = hub.Module(name="MiDaS_Large") + result = model.depth_estimation(images=[cv2.imread('/PATH/TO/IMAGE')]) + # or + # result = model.depth_estimation(paths=['/PATH/TO/IMAGE']) + ``` -# 模型预测 -result = model.depth_estimation(images=[cv2.imread('/PATH/TO/IMAGE')]) +- ### 2、API -# or -# result = model.style_transfer(paths=['/PATH/TO/IMAGE']) -``` + - ```python + def depth_estimation(images=None, + paths=None, + batch_size=1, + output_dir='output', + visualization=False): + ``` -## 模型相关信息 + - 深度估计API。 -### 模型代码 + - **参数** -https://github.com/intel-isl/MiDaS + - images (list\[numpy.ndarray\]): 图片数据,ndarray.shape 为 \[H, W, C\];
+ - paths (list\[str\]): 图片的路径;
+ - batch_size (int) : batch 的大小;
+ - output\_dir (str): 图片的保存路径,默认设为 output;
+ - visualization (bool) : 是否将结果保存为图片文件。 -### 依赖 + **NOTE:** paths和images两个参数选择其一进行提供数据 -paddlepaddle >= 2.0.0rc0 + - **返回** + - res (list\[numpy.ndarray\]): 图像深度数据,ndarray.shape 为 \[H, W\] -paddlehub >= 2.0.0b1 + +## 四、更新历史 + +* 1.0.0 + + 初始发布 + + - ```shell + $ hub install MiDaS_Large==1.0.0 + ```