Merge pull request #2039 from cuicheng01/update_person_exists_doc
update PULC_quickstart.mdpull/2040/head
commit
810588ce1c
|
@ -7,8 +7,9 @@
|
||||||
|
|
||||||
- [1. 模型和应用场景介绍](#1)
|
- [1. 模型和应用场景介绍](#1)
|
||||||
- [2. 模型快速体验](#2)
|
- [2. 模型快速体验](#2)
|
||||||
- [2.1 安装 paddleclas](#2.1)
|
- [2.1 安装 paddlepaddle](#2.1)
|
||||||
- [2.2 预测](#2.2)
|
- [2.2 安装 paddleclas](#2.2)
|
||||||
|
- [2.3 预测](#2.3)
|
||||||
- [3. 模型训练、评估和预测](#3)
|
- [3. 模型训练、评估和预测](#3)
|
||||||
- [3.1 环境配置](#3.1)
|
- [3.1 环境配置](#3.1)
|
||||||
- [3.2 数据准备](#3.2)
|
- [3.2 数据准备](#3.2)
|
||||||
|
@ -67,27 +68,46 @@
|
||||||
|
|
||||||
<a name="2.1"></a>
|
<a name="2.1"></a>
|
||||||
|
|
||||||
### 2.1 安装 paddleclas
|
### 2.1 安装 paddlepaddle
|
||||||
|
|
||||||
使用如下命令快速安装 paddlepaddle, paddleclas
|
- 您的机器安装的是 CUDA9 或 CUDA10,请运行以下命令安装
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python3 -m pip install paddlepaddle-gpu -i https://mirror.baidu.com/pypi/simple
|
||||||
|
```
|
||||||
|
|
||||||
|
- 您的机器是CPU,请运行以下命令安装
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python3 -m pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple
|
||||||
|
```
|
||||||
|
|
||||||
|
更多的版本需求,请参照[飞桨官网安装文档](https://www.paddlepaddle.org.cn/install/quick)中的说明进行操作。
|
||||||
|
|
||||||
|
### 2.2 安装 paddleclas
|
||||||
|
|
||||||
|
使用如下命令快速安装 paddleclas
|
||||||
|
|
||||||
```
|
```
|
||||||
pip3 install paddlepaddle paddleclas
|
pip3 install paddleclas
|
||||||
```
|
```
|
||||||
|
|
||||||
<a name="2.2"></a>
|
<a name="2.2"></a>
|
||||||
|
|
||||||
### 2.2 预测
|
### 2.3 预测
|
||||||
|
|
||||||
|
点击[这里](https://paddleclas.bj.bcebos.com/data/PULC/pulc_demo_imgs.zip)下载 demo 数据并解压,然后在终端中切换到相应目录。
|
||||||
|
|
||||||
* 使用命令行快速预测
|
* 使用命令行快速预测
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
paddleclas --model_name=person_exists --infer_imgs=deploy/images/PULC/person_exists/objects365_01780782.jpg
|
paddleclas --model_name=person_exists --infer_imgs=pulc_demo_imgs/person_exists/objects365_01780782.jpg
|
||||||
```
|
```
|
||||||
|
|
||||||
结果如下:
|
结果如下:
|
||||||
```
|
```
|
||||||
>>> result
|
>>> result
|
||||||
class_ids: [0], scores: [0.9955421453341842], label_names: ['nobody'], filename: deploy/images/PULC/person_exists/objects365_01780782.jpg
|
class_ids: [0], scores: [0.9955421453341842], label_names: ['nobody'], filename: pulc_demo_imgs/person_exists/objects365_01780782.jpg
|
||||||
Predict complete!
|
Predict complete!
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -98,7 +118,7 @@ Predict complete!
|
||||||
```python
|
```python
|
||||||
import paddleclas
|
import paddleclas
|
||||||
model = paddleclas.PaddleClas(model_name="person_exists")
|
model = paddleclas.PaddleClas(model_name="person_exists")
|
||||||
result = model.predict(input_data="deploy/images/PULC/person_exists/objects365_01780782.jpg")
|
result = model.predict(input_data="pulc_demo_imgs/person_exists/objects365_01780782.jpg")
|
||||||
print(next(result))
|
print(next(result))
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -106,7 +126,7 @@ print(next(result))
|
||||||
|
|
||||||
```
|
```
|
||||||
>>> result
|
>>> result
|
||||||
[{'class_ids': [0], 'scores': [0.9955421453341842], 'label_names': ['nobody'], 'filename': 'PaddleClas/deploy/images/PULC/person_exists/objects365_01780782.jpg'}]
|
[{'class_ids': [0], 'scores': [0.9955421453341842], 'label_names': ['nobody'], 'filename': 'pulc_demo_imgs/person_exists/objects365_01780782.jpg'}]
|
||||||
```
|
```
|
||||||
|
|
||||||
<a name="3"></a>
|
<a name="3"></a>
|
||||||
|
|
Loading…
Reference in New Issue