|
|
@@ -11,16 +11,15 @@ PaddleX已经集成了基于Python的高性能预测接口,在安装PaddleX后
|
|
|
接下来的预测部署将使用PaddleX python高性能预测接口,接口说明可参考[paddlex.deploy](./apis/deploy.md)
|
|
|
|
|
|
|
|
|
-* 单张图片预测
|
|
|
+* 图片预测
|
|
|
|
|
|
```python
|
|
|
import paddlex as pdx
|
|
|
predictor = pdx.deploy.Predictor('./inference_model')
|
|
|
result = predictor.predict(img_file='test.img')
|
|
|
-
|
|
|
```
|
|
|
|
|
|
-* 单张图片预测、并评估预测速度
|
|
|
+* 图片预测、并评估预测速度
|
|
|
|
|
|
**关于预测速度的说明**:加载模型后,前几张图片的预测速度会较慢,这是因为运行启动时涉及到内存显存初始化等步骤,通常在预测20-30张图片后模型的预测速度达到稳定。**如果需要评估预测速度,可通过指定预热轮数warmup_iters完成预热**。**为获得更加精准的预测速度,可指定repeats重复预测后取时间平均值**。
|
|
|
|
|
|
@@ -30,14 +29,4 @@ predictor = pdx.deploy.Predictor('./inference_model')
|
|
|
result = predictor.predict(img_file='test.img',
|
|
|
warmup_iters=100,
|
|
|
repeats=100)
|
|
|
-
|
|
|
-```
|
|
|
-
|
|
|
-* 批量图片预测
|
|
|
-
|
|
|
-```python
|
|
|
-import paddlex as pdx
|
|
|
-predictor = pdx.deploy.Predictor('./inference_model')
|
|
|
-image_list = ['test1.jpg', 'test2.jpg']
|
|
|
-result = predictor.batch_predict(img_file=image_list)
|
|
|
```
|