Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleX
提交
be3bbbcc
P
PaddleX
项目概览
PaddlePaddle
/
PaddleX
通知
138
Star
4
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
43
列表
看板
标记
里程碑
合并请求
5
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleX
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
43
Issue
43
列表
看板
标记
里程碑
合并请求
5
合并请求
5
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
be3bbbcc
编写于
7月 09, 2020
作者:
F
FlyingQianMM
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add args
上级
e5b03012
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
16 addition
and
8 deletion
+16
-8
paddlex/deploy.py
paddlex/deploy.py
+16
-8
未找到文件。
paddlex/deploy.py
浏览文件 @
be3bbbcc
...
@@ -111,8 +111,7 @@ class Predictor:
...
@@ -111,8 +111,7 @@ class Predictor:
""" 对图像做预处理
""" 对图像做预处理
Args:
Args:
image(str|np.ndarray): 图像路径;或者是解码后的排列格式为(H, W, C)且类型为float32且为BGR格式的数组。
image(list|tuple): 数组中的元素可以是图像路径,也可以是解码后的排列格式为(H,W,C)
或者是对数(元)组中的图像同时进行预测,数组中的元素可以是图像路径,也可以是解码后的排列格式为(H,W,C)
且类型为float32且为BGR格式的数组。
且类型为float32且为BGR格式的数组。
"""
"""
res
=
dict
()
res
=
dict
()
...
@@ -161,6 +160,16 @@ class Predictor:
...
@@ -161,6 +160,16 @@ class Predictor:
batch_size
=
1
,
batch_size
=
1
,
im_shape
=
None
,
im_shape
=
None
,
im_info
=
None
):
im_info
=
None
):
""" 对预测结果做后处理
Args:
results (list): 预测结果
topk (int): 分类预测时前k个最大值
batch_size (int): 预测时图像批量大小
im_shape (list): MaskRCNN的图像输入大小
im_info (list):RCNN系列和分割网络的原图大小
"""
def
offset_to_lengths
(
lod
):
def
offset_to_lengths
(
lod
):
offset
=
lod
[
0
]
offset
=
lod
[
0
]
lengths
=
[
lengths
=
[
...
@@ -219,9 +228,7 @@ class Predictor:
...
@@ -219,9 +228,7 @@ class Predictor:
""" 图片预测
""" 图片预测
Args:
Args:
image(str|np.ndarray|list|tuple): 图像路径;或者是解码后的排列格式为(H, W, C)且类型为float32且为BGR格式的数组。
image(str|np.ndarray): 图像路径;或者是解码后的排列格式为(H, W, C)且类型为float32且为BGR格式的数组。
或者是对数(元)组中的图像同时进行预测,数组中的元素可以是图像路径,也可以是解码后的排列格式为(H,W,C)
且类型为float32且为BGR格式的数组。
topk(int): 分类预测时使用,表示预测前topk的结果
topk(int): 分类预测时使用,表示预测前topk的结果
"""
"""
preprocessed_input
=
self
.
preprocess
([
image
])
preprocessed_input
=
self
.
preprocess
([
image
])
...
@@ -243,9 +250,10 @@ class Predictor:
...
@@ -243,9 +250,10 @@ class Predictor:
""" 图片预测
""" 图片预测
Args:
Args:
image(str|np.ndarray|list|tuple): 图像路径;或者是解码后的排列格式为(H, W, C)且类型为float32且为BGR格式的数组。
image_list(list|tuple): 对列表(或元组)中的图像同时进行预测,列表中的元素可以是图像路径
或者是对数(元)组中的图像同时进行预测,数组中的元素可以是图像路径,也可以是解码后的排列格式为(H,W,C)
也可以是解码后的排列格式为(H,W,C)且类型为float32且为BGR格式的数组。
且类型为float32且为BGR格式的数组。
thread_num (int): 并发执行各图像预处理时的线程数。
topk(int): 分类预测时使用,表示预测前topk的结果
topk(int): 分类预测时使用,表示预测前topk的结果
"""
"""
preprocessed_input
=
self
.
preprocess
(
image_list
)
preprocessed_input
=
self
.
preprocess
(
image_list
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录