提交 fbbe3e75 编写于 作者: C chenjian

fix Chinese readme 代码示例->预测代码示例

上级 61090fb2
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
| [零基础Linux安装](../../../../docs/docs_ch/get_start/linux_quickstart.md) | [零基础MacOS安装](../../../../docs/docs_ch/get_start/mac_quickstart.md) | [零基础Linux安装](../../../../docs/docs_ch/get_start/linux_quickstart.md) | [零基础MacOS安装](../../../../docs/docs_ch/get_start/mac_quickstart.md)
## 三、模型API预测 ## 三、模型API预测
- ### 1、代码示例 - ### 1、预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
# Photo2Cartoon # Photo2Cartoon
|模型名称|Photo2Cartoon| |模型名称|Photo2Cartoon|
| :--- | :---: | | :--- | :---: |
|类别|图像 - 图像生成| |类别|图像 - 图像生成|
|网络|U-GAT-IT| |网络|U-GAT-IT|
|数据集|cartoon_data| |数据集|cartoon_data|
|是否支持Fine-tuning|否| |是否支持Fine-tuning|否|
|模型大小|205MB| |模型大小|205MB|
|最新更新日期|2021-02-26| |最新更新日期|2021-02-26|
|数据指标|-| |数据指标|-|
## 一、模型基本信息 ## 一、模型基本信息
- ### 应用效果展示 - ### 应用效果展示
- 样例结果示例: - 样例结果示例:
<p align="center"> <p align="center">
<img src="https://img-blog.csdnimg.cn/20201224164040624.jpg" hspace='10'/> <br /> <img src="https://img-blog.csdnimg.cn/20201224164040624.jpg" hspace='10'/> <br />
</p> </p>
- ### 模型介绍 - ### 模型介绍
- 本模型封装自[小视科技photo2cartoon项目的paddlepaddle版本](https://github.com/minivision-ai/photo2cartoon-paddle) - 本模型封装自[小视科技photo2cartoon项目的paddlepaddle版本](https://github.com/minivision-ai/photo2cartoon-paddle)
## 二、安装 ## 二、安装
- ### 1、环境依赖 - ### 1、环境依赖
- paddlepaddle >= 2.0.0 - paddlepaddle >= 2.0.0
- paddlehub >= 2.0.0 | [如何安装paddlehub](../../../../docs/docs_ch/get_start/installation.rst) - paddlehub >= 2.0.0 | [如何安装paddlehub](../../../../docs/docs_ch/get_start/installation.rst)
- ### 2、安装 - ### 2、安装
- ```shell - ```shell
$ hub install Photo2Cartoon $ hub install Photo2Cartoon
``` ```
- 如您安装时遇到问题,可参考:[零基础windows安装](../../../../docs/docs_ch/get_start/windows_quickstart.md) - 如您安装时遇到问题,可参考:[零基础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) | [零基础Linux安装](../../../../docs/docs_ch/get_start/linux_quickstart.md) | [零基础MacOS安装](../../../../docs/docs_ch/get_start/mac_quickstart.md)
## 三、模型API预测 ## 三、模型API预测
- ### 1、代码示例 - ### 1、预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
import cv2 import cv2
model = hub.Module(name="Photo2Cartoon") model = hub.Module(name="Photo2Cartoon")
result = model.Cartoon_GEN(images=[cv2.imread('/PATH/TO/IMAGE')]) result = model.Cartoon_GEN(images=[cv2.imread('/PATH/TO/IMAGE')])
# or # or
# result = model.Cartoon_GEN(paths=['/PATH/TO/IMAGE']) # result = model.Cartoon_GEN(paths=['/PATH/TO/IMAGE'])
``` ```
- ### 2、API - ### 2、API
- ```python - ```python
def Cartoon_GEN(images=None, def Cartoon_GEN(images=None,
paths=None, paths=None,
batch_size=1, batch_size=1,
output_dir='output', output_dir='output',
visualization=False, visualization=False,
use_gpu=False): use_gpu=False):
``` ```
- 人像卡通化图像生成API。 - 人像卡通化图像生成API。
- **参数** - **参数**
- images (list\[numpy.ndarray\]): 图片数据,ndarray.shape 为 \[H, W, C\]<br/> - images (list\[numpy.ndarray\]): 图片数据,ndarray.shape 为 \[H, W, C\];<br/>
- paths (list\[str\]): 输入图像路径;<br/> - paths (list\[str\]): 输入图像路径;<br/>
- output\_dir (str): 图片的保存路径,默认设为 output;<br/> - output\_dir (str): 图片的保存路径,默认设为 output;<br/>
- batch_size (int) : batch大小;<br/> - batch_size (int) : batch大小;<br/>
- visualization (bool) : 是否将结果保存为图片文件;;<br/> - visualization (bool) : 是否将结果保存为图片文件;;<br/>
- use_gpu (bool) : 是否使用 GPU 进行推理。 - use_gpu (bool) : 是否使用 GPU 进行推理。
**NOTE:** paths和images两个参数选择其一进行提供数据 **NOTE:** paths和images两个参数选择其一进行提供数据
- **返回** - **返回**
- res (list\[numpy.ndarray\]): 输出图像数据,ndarray.shape 为 \[H, W, C\] - res (list\[numpy.ndarray\]): 输出图像数据,ndarray.shape 为 \[H, W, C\]
## 四、更新历史 ## 四、更新历史
* 1.0.0 * 1.0.0
初始发布 初始发布
- ```shell - ```shell
$ hub install Photo2Cartoon==1.0.0 $ hub install Photo2Cartoon==1.0.0
``` ```
# U2Net_Portrait # U2Net_Portrait
|模型名称|U2Net_Portrait| |模型名称|U2Net_Portrait|
| :--- | :---: | | :--- | :---: |
|类别|图像 - 图像生成| |类别|图像 - 图像生成|
|网络|U^2Net| |网络|U^2Net|
|数据集|-| |数据集|-|
|是否支持Fine-tuning|否| |是否支持Fine-tuning|否|
|模型大小|254MB| |模型大小|254MB|
|最新更新日期|2021-02-26| |最新更新日期|2021-02-26|
|数据指标|-| |数据指标|-|
## 一、模型基本信息 ## 一、模型基本信息
- ### 应用效果展示 - ### 应用效果展示
- 样例结果示例: - 样例结果示例:
<p align="center"> <p align="center">
<img src="https://ai-studio-static-online.cdn.bcebos.com/07f73466f3294373965e06c141c4781992f447104a94471dadfabc1c3d920861" height='50%' hspace='10'/> <img src="https://ai-studio-static-online.cdn.bcebos.com/07f73466f3294373965e06c141c4781992f447104a94471dadfabc1c3d920861" height='50%' hspace='10'/>
<br /> <br />
输入图像 输入图像
<br /> <br />
<img src="https://ai-studio-static-online.cdn.bcebos.com/c6ab02cf27414a5ba5921d9e6b079b487f6cda6026dc4d6dbca8f0167ad7cae3" height='50%' hspace='10'/> <img src="https://ai-studio-static-online.cdn.bcebos.com/c6ab02cf27414a5ba5921d9e6b079b487f6cda6026dc4d6dbca8f0167ad7cae3" height='50%' hspace='10'/>
<br /> <br />
输出图像 输出图像
<br /> <br />
</p> </p>
- ### 模型介绍 - ### 模型介绍
- U2Net_Portrait 可以用于提取人脸的素描结果。 - U2Net_Portrait 可以用于提取人脸的素描结果。
## 二、安装 ## 二、安装
- ### 1、环境依赖 - ### 1、环境依赖
- paddlepaddle >= 2.0.0 - paddlepaddle >= 2.0.0
- paddlehub >= 2.0.0 | [如何安装paddlehub](../../../../docs/docs_ch/get_start/installation.rst) - paddlehub >= 2.0.0 | [如何安装paddlehub](../../../../docs/docs_ch/get_start/installation.rst)
- ### 2、安装 - ### 2、安装
- ```shell - ```shell
$ hub install U2Net_Portrait $ hub install U2Net_Portrait
``` ```
- 如您安装时遇到问题,可参考:[零基础windows安装](../../../../docs/docs_ch/get_start/windows_quickstart.md) - 如您安装时遇到问题,可参考:[零基础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) | [零基础Linux安装](../../../../docs/docs_ch/get_start/linux_quickstart.md) | [零基础MacOS安装](../../../../docs/docs_ch/get_start/mac_quickstart.md)
## 三、模型API预测 ## 三、模型API预测
- ### 1、代码示例 - ### 1、预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
import cv2 import cv2
model = hub.Module(name="U2Net_Portrait") model = hub.Module(name="U2Net_Portrait")
result = model.Cartoon_GEN(images=[cv2.imread('/PATH/TO/IMAGE')]) result = model.Cartoon_GEN(images=[cv2.imread('/PATH/TO/IMAGE')])
# or # or
# result = model.Cartoon_GEN(paths=['/PATH/TO/IMAGE']) # result = model.Cartoon_GEN(paths=['/PATH/TO/IMAGE'])
``` ```
- ### 2、API - ### 2、API
- ```python - ```python
def Portrait_GEN(images=None, def Portrait_GEN(images=None,
paths=None, paths=None,
scale=1, scale=1,
batch_size=1, batch_size=1,
output_dir='output', output_dir='output',
face_detection=True, face_detection=True,
visualization=False): visualization=False):
``` ```
- 人脸画像生成API。 - 人脸画像生成API。
- **参数** - **参数**
- images (list\[numpy.ndarray\]): 图片数据,ndarray.shape 为 \[H, W, C\]<br/> - images (list\[numpy.ndarray\]): 图片数据,ndarray.shape 为 \[H, W, C\];<br/>
- paths (list\[str\]): 输入图像路径;<br/> - paths (list\[str\]): 输入图像路径;<br/>
- scale (float) : 缩放因子(与face_detection相关联);<br/> - scale (float) : 缩放因子(与face_detection相关联);<br/>
- batch_size (int) : batch大小;<br/> - batch_size (int) : batch大小;<br/>
- output\_dir (str): 图片的保存路径,默认设为 output;<br/> - output\_dir (str): 图片的保存路径,默认设为 output;<br/>
- visualization (bool) : 是否将结果保存为图片文件;;<br/> - visualization (bool) : 是否将结果保存为图片文件;;<br/>
**NOTE:** paths和images两个参数选择其一进行提供数据 **NOTE:** paths和images两个参数选择其一进行提供数据
- **返回** - **返回**
- res (list\[numpy.ndarray\]): 输出图像数据,ndarray.shape 为 \[H, W, C\] - res (list\[numpy.ndarray\]): 输出图像数据,ndarray.shape 为 \[H, W, C\]
## 四、更新历史 ## 四、更新历史
* 1.0.0 * 1.0.0
初始发布 初始发布
- ```shell - ```shell
$ hub install U2Net_Portrait==1.0.0 $ hub install U2Net_Portrait==1.0.0
``` ```
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
## 三、模型API预测 ## 三、模型API预测
- ### 1、代码示例 - ### 1、预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
## 三、模型API预测 ## 三、模型API预测
- ### 1、代码示例 - ### 1、预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
## 三、模型API预测 ## 三、模型API预测
- ### 1、代码示例 - ### 1、预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
## 三、模型API预测 ## 三、模型API预测
- ### 1、代码示例 - ### 1、预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
## 三、模型API预测 ## 三、模型API预测
- ### 1、代码示例 - ### 1、预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
## 三、模型API预测 ## 三、模型API预测
- ### 1、代码示例 - ### 1、预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
## 三、模型API预测 ## 三、模型API预测
- ### 1、代码示例 - ### 1、预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
## 三、模型API预测 ## 三、模型API预测
- ### 1、代码示例 - ### 1、预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
$ hub run stylepro_artistic --input_path "/PATH/TO/IMAGE" $ hub run stylepro_artistic --input_path "/PATH/TO/IMAGE"
``` ```
- 通过命令行方式实现风格转换模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现风格转换模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、代码示例 - ### 2、预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现文字识别模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现文字识别模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
``` ```
- 通过命令行方式实现分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
``` ```
- 通过命令行方式实现分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
``` ```
- 通过命令行方式实现分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
``` ```
- 通过命令行方式实现分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
``` ```
- 通过命令行方式实现分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
``` ```
- 通过命令行方式实现分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
``` ```
- 通过命令行方式实现分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
``` ```
- 通过命令行方式实现分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
``` ```
- 通过命令行方式实现分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
``` ```
- 通过命令行方式实现菜品分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现菜品分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
``` ```
- 通过命令行方式实现分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
``` ```
- 通过命令行方式实现分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
``` ```
- 通过命令行方式实现分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
``` ```
- 通过命令行方式实现分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
``` ```
- 通过命令行方式实现分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
## 三、模型API预测 ## 三、模型API预测
- ### 1、预测代码示例 - ### 1、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
``` ```
- 通过命令行方式实现菜品分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现菜品分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
``` ```
- 通过命令行方式实现分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -84,7 +84,7 @@ def save_inference_model(dirname, ...@@ -84,7 +84,7 @@ def save_inference_model(dirname,
* params\_filename: 参数文件名称,默认为\_\_params\_\_(仅当`combined`为True时生效) * params\_filename: 参数文件名称,默认为\_\_params\_\_(仅当`combined`为True时生效)
* combined: 是否将参数保存到统一的一个文件中 * combined: 是否将参数保存到统一的一个文件中
## 预测代码示例 ## 预测预测代码示例
```python ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
``` ```
- 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现图像分类模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、预测代码示例 - ### 2、预测预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
# MiDaS_Large # MiDaS_Large
|模型名称|MiDaS_Large| |模型名称|MiDaS_Large|
| :--- | :---: | | :--- | :---: |
|类别|图像 - 深度估计| |类别|图像 - 深度估计|
|网络|-| |网络|-|
|数据集|3D Movies, WSVD, ReDWeb, MegaDepth| |数据集|3D Movies, WSVD, ReDWeb, MegaDepth|
|是否支持Fine-tuning|否| |是否支持Fine-tuning|否|
|模型大小|399MB| |模型大小|399MB|
|最新更新日期|2021-02-26| |最新更新日期|2021-02-26|
|数据指标|-| |数据指标|-|
## 一、模型基本信息 ## 一、模型基本信息
- ### 应用效果展示 - ### 应用效果展示
- 样例结果示例: - 样例结果示例:
<p align="center"> <p align="center">
<img src="https://img-blog.csdnimg.cn/20201227112600975.jpg" width='70%' hspace='10'/> <br /> <img src="https://img-blog.csdnimg.cn/20201227112600975.jpg" width='70%' hspace='10'/> <br />
</p> </p>
- ### 模型介绍 - ### 模型介绍
- MiDaS_Large是一个单目深度估计模型,模型可通过输入图像估计其中的深度信息。 - MiDaS_Large是一个单目深度估计模型,模型可通过输入图像估计其中的深度信息。
## 二、安装 ## 二、安装
- ### 1、环境依赖 - ### 1、环境依赖
- paddlepaddle >= 2.0.0 - paddlepaddle >= 2.0.0
- paddlehub >= 2.0.0 | [如何安装paddlehub](../../../../docs/docs_ch/get_start/installation.rst) - paddlehub >= 2.0.0 | [如何安装paddlehub](../../../../docs/docs_ch/get_start/installation.rst)
- ### 2、安装 - ### 2、安装
- ```shell - ```shell
$ hub install MiDaS_Large $ hub install MiDaS_Large
``` ```
- 如您安装时遇到问题,可参考:[零基础windows安装](../../../../docs/docs_ch/get_start/windows_quickstart.md) - 如您安装时遇到问题,可参考:[零基础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) | [零基础Linux安装](../../../../docs/docs_ch/get_start/linux_quickstart.md) | [零基础MacOS安装](../../../../docs/docs_ch/get_start/mac_quickstart.md)
## 三、模型API预测 ## 三、模型API预测
- ### 1、代码示例 - ### 1、预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
import cv2 import cv2
model = hub.Module(name="MiDaS_Large") model = hub.Module(name="MiDaS_Large")
result = model.depth_estimation(images=[cv2.imread('/PATH/TO/IMAGE')]) result = model.depth_estimation(images=[cv2.imread('/PATH/TO/IMAGE')])
# or # or
# result = model.depth_estimation(paths=['/PATH/TO/IMAGE']) # result = model.depth_estimation(paths=['/PATH/TO/IMAGE'])
``` ```
- ### 2、API - ### 2、API
- ```python - ```python
def depth_estimation(images=None, def depth_estimation(images=None,
paths=None, paths=None,
batch_size=1, batch_size=1,
output_dir='output', output_dir='output',
visualization=False): visualization=False):
``` ```
- 深度估计API。 - 深度估计API。
- **参数** - **参数**
- images (list\[numpy.ndarray\]): 图片数据,ndarray.shape 为 \[H, W, C\]<br/> - images (list\[numpy.ndarray\]): 图片数据,ndarray.shape 为 \[H, W, C\];<br/>
- paths (list\[str\]): 图片的路径;<br/> - paths (list\[str\]): 图片的路径;<br/>
- batch_size (int) : batch 的大小;<br/> - batch_size (int) : batch 的大小;<br/>
- output\_dir (str): 图片的保存路径,默认设为 output;<br/> - output\_dir (str): 图片的保存路径,默认设为 output;<br/>
- visualization (bool) : 是否将结果保存为图片文件。 - visualization (bool) : 是否将结果保存为图片文件。
**NOTE:** paths和images两个参数选择其一进行提供数据 **NOTE:** paths和images两个参数选择其一进行提供数据
- **返回** - **返回**
- res (list\[numpy.ndarray\]): 图像深度数据,ndarray.shape 为 \[H, W\] - res (list\[numpy.ndarray\]): 图像深度数据,ndarray.shape 为 \[H, W\]
## 四、更新历史 ## 四、更新历史
* 1.0.0 * 1.0.0
初始发布 初始发布
- ```shell - ```shell
$ hub install MiDaS_Large==1.0.0 $ hub install MiDaS_Large==1.0.0
``` ```
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
``` ```
- 通过命令行方式实现人脸检测模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现人脸检测模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、代码示例 - ### 2、预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
``` ```
- 通过命令行方式实现人脸检测模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现人脸检测模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、代码示例 - ### 2、预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
``` ```
- 通过命令行方式实现人脸检测模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现人脸检测模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、代码示例 - ### 2、预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
``` ```
- 通过命令行方式实现人脸检测模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现人脸检测模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、代码示例 - ### 2、预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
``` ```
- 通过命令行方式实现人脸检测模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现人脸检测模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、代码示例 - ### 2、预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
``` ```
- 通过命令行方式实现人脸检测模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现人脸检测模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、代码示例 - ### 2、预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
``` ```
- 通过命令行方式实现人脸检测模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现人脸检测模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、代码示例 - ### 2、预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
$ hub run faster_rcnn_resnet50_coco2017 --input_path "/PATH/TO/IMAGE" $ hub run faster_rcnn_resnet50_coco2017 --input_path "/PATH/TO/IMAGE"
``` ```
- 通过命令行方式实现目标检测模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现目标检测模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、代码示例 - ### 2、预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
``` ```
- 通过命令行方式实现目标检测模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现目标检测模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、代码示例 - ### 2、预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
$ hub run ssd_mobilenet_v1_pascal --input_path "/PATH/TO/IMAGE" $ hub run ssd_mobilenet_v1_pascal --input_path "/PATH/TO/IMAGE"
``` ```
- 通过命令行方式实现目标检测模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现目标检测模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、代码示例 - ### 2、预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
$ hub run ssd_vgg16_512_coco2017 --input_path "/PATH/TO/IMAGE" $ hub run ssd_vgg16_512_coco2017 --input_path "/PATH/TO/IMAGE"
``` ```
- 通过命令行方式实现目标检测模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现目标检测模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、代码示例 - ### 2、预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
$ hub run yolov3_darknet53_coco2017 --input_path "/PATH/TO/IMAGE" $ hub run yolov3_darknet53_coco2017 --input_path "/PATH/TO/IMAGE"
``` ```
- 通过命令行方式实现目标检测模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst) - 通过命令行方式实现目标检测模型的调用,更多请见 [PaddleHub命令行指令](../../../../docs/docs_ch/tutorial/cmd_usage.rst)
- ### 2、代码示例 - ### 2、预测代码示例
- ```python - ```python
import paddlehub as hub import paddlehub as hub
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册