Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
2e03def0
S
Serving
项目概览
PaddlePaddle
/
Serving
大约 1 年 前同步成功
通知
186
Star
833
Fork
253
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
105
列表
看板
标记
里程碑
合并请求
10
Wiki
2
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Serving
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
105
Issue
105
列表
看板
标记
里程碑
合并请求
10
合并请求
10
Pages
分析
分析
仓库分析
DevOps
Wiki
2
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
2e03def0
编写于
5月 01, 2020
作者:
D
dongdaxiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refine package shoiw list
上级
c4d9418c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
44 addition
and
71 deletion
+44
-71
python/paddle_serving_app/models/model_list.py
python/paddle_serving_app/models/model_list.py
+33
-66
python/paddle_serving_app/package.py
python/paddle_serving_app/package.py
+11
-5
未找到文件。
python/paddle_serving_app/models/model_list.py
浏览文件 @
2e03def0
...
@@ -20,76 +20,43 @@ from collections import OrderedDict
...
@@ -20,76 +20,43 @@ from collections import OrderedDict
class
ServingModels
(
object
):
class
ServingModels
(
object
):
def
__init__
(
self
):
def
__init__
(
self
):
self
.
model_dict
=
OrderedDict
()
self
.
model_dict
=
OrderedDict
()
#senta
self
.
model_dict
[
for
key
in
[
"SentimentAnalysis"
]
=
[
"senta_bilstm"
,
"senta_bow"
,
"senta_cnn"
]
"senta_bilstm"
,
"senta_bow"
,
"senta_cnn"
,
"senta_gru"
,
self
.
model_dict
[
"SemanticRepresentation"
]
=
[
"ernie_base"
]
"senta_lstm"
self
.
model_dict
[
"ChineseWordSegmentation"
]
=
[
"lac"
]
]:
self
.
model_dict
[
"ObjectDetection"
]
=
[
"faster_rcnn"
,
"yolov3"
]
self
.
model_dict
[
self
.
model_dict
[
"ImageSegmentation"
]
=
[
"unet"
,
"deeplabv3"
]
key
]
=
"https://paddle-serving.bj.bcebos.com/paddle_hub_models/text/SentimentAnalysis/"
+
key
+
".tar.gz"
self
.
model_dict
[
"ImageClassification"
]
=
[
#image classification
"resnet_v2_50_imagenet"
,
"efficientnetb6_imagenet"
for
key
in
[
]
"alexnet_imagenet"
,
"darknet53-imagenet"
,
image_class_url
=
"https://paddle-serving.bj.bcebos.com/paddle_hub_models/image/ImageClassification/"
"densenet121_imagenet"
,
image_seg_url
=
"https://paddle-serving.bj.bcebos.com/paddle_hub_models/image/ImageSegmentation/"
"densenet161_imagenet"
,
object_detection_url
=
"https://paddle-serving.bj.bcebos.com/paddle_hub_models/image/ObjectDetection/"
"densenet169_imagenet"
,
senta_url
=
"https://paddle-serving.bj.bcebos.com/paddle_hub_models/text/SentimentAnalysis/"
"densenet201_imagenet"
,
semantic_url
=
"https://paddle-serving.bj.bcebos.com/paddle_hub_models/text/SemanticRepresentation/"
"densenet264_imagenet"
wordseg_url
=
"https://paddle-serving.bj.bcebos.com/paddle_hub_models/text/ChineseWordSegmentation/"
"dpn107_imagenet"
,
"dpn131_imagenet"
,
self
.
url_dict
=
{}
"dpn68_imagenet"
,
"dpn92_imagenet"
,
def
pack_url
(
model_dict
,
key
,
url
):
"dpn98_imagenet"
,
for
i
,
value
in
enumerate
(
model_dict
[
key
]):
"efficientnetb0_imagenet"
,
self
.
url_dict
[
model_dict
[
key
][
i
]]
=
url
+
model_dict
[
key
][
"efficientnetb1_imagenet"
,
i
]
+
".tar.gz"
"efficientnetb2_imagenet"
,
"efficientnetb3_imagenet"
,
pack_url
(
self
.
model_dict
,
"SentimentAnalysis"
,
senta_url
)
"efficientnetb4_imagenet"
,
pack_url
(
self
.
model_dict
,
"SemanticRepresentation"
,
semantic_url
)
"efficientnetb5_imagenet"
,
pack_url
(
self
.
model_dict
,
"ChineseWordSegmentation"
,
wordseg_url
)
"efficientnetb6_imagenet"
,
pack_url
(
self
.
model_dict
,
"ObjectDetection"
,
object_detection_url
)
"googlenet_imagenet"
,
pack_url
(
self
.
model_dict
,
"ImageSegmentation"
,
image_seg_url
)
"inception_v4_imagenet"
,
pack_url
(
self
.
model_dict
,
"ImageClassification"
,
image_class_url
)
"inception_v2_imagenet"
,
"nasnet_imagenet"
,
"pnasnet_imagenet"
,
"resnet_v2_101_imagenet"
,
"resnet_v2_151_imagenet"
,
"resnet_v2_18_imagenet"
,
"resnet_v2_34_imagenet"
,
"resnet_v2_50_imagenet"
,
"resnext101_32x16d_wsl"
,
"resnext101_32x32d_wsl"
,
"resnext101_32x48d_wsl"
,
"resnext101_32x8d_wsl"
,
"resnext101_32x4d_imagenet"
,
"resnext101_64x4d_imagenet"
,
"resnext101_vd_32x4d_imagenet"
,
"resnext101_vd_64x4d_imagenet"
,
"resnext152_64x4d_imagenet"
,
"resnext152_vd_64x4d_imagenet"
,
"resnext50_64x4d_imagenet"
,
"resnext50_vd_32x4d_imagenet"
,
"resnext50_vd_64x4d_imagenet"
,
"se_resnext101_32x4d_imagenet"
,
"se_resnext50_32x4d_imagenet"
,
"shufflenet_v2_imagenet"
,
"vgg11_imagenet"
,
"vgg13_imagenet"
,
"vgg16_imagenet"
,
"vgg19_imagenet"
,
"xception65_imagenet"
,
"xception71_imagenet"
,
]:
self
.
model_dict
[
key
]
=
"https://paddle-serving.bj.bcebos.com/paddle_hub_models/image/ImageClassification/"
+
key
+
".tar.gz"
def
get_model_list
(
self
):
def
get_model_list
(
self
):
return
(
self
.
model_dict
.
keys
())
return
self
.
model_dict
def
download
(
self
,
model_name
):
def
download
(
self
,
model_name
):
if
model_name
in
self
.
mode
l_dict
:
if
model_name
in
self
.
ur
l_dict
:
url
=
self
.
mode
l_dict
[
model_name
]
url
=
self
.
ur
l_dict
[
model_name
]
r
=
os
.
system
(
'wget '
+
url
+
' --no-check-certificate'
)
r
=
os
.
system
(
'wget '
+
url
+
' --no-check-certificate'
)
...
...
python/paddle_serving_app/package.py
浏览文件 @
2e03def0
...
@@ -20,6 +20,7 @@ Usage:
...
@@ -20,6 +20,7 @@ Usage:
"""
"""
import
argparse
import
argparse
import
sys
from
.models
import
ServingModels
from
.models
import
ServingModels
...
@@ -36,13 +37,18 @@ if __name__ == "__main__":
...
@@ -36,13 +37,18 @@ if __name__ == "__main__":
args
=
parse_args
()
args
=
parse_args
()
if
args
.
list_model
!=
None
:
if
args
.
list_model
!=
None
:
model_handle
=
ServingModels
()
model_handle
=
ServingModels
()
model_names
=
model_handle
.
get_model_list
()
model_dict
=
model_handle
.
get_model_list
()
for
key
in
model_names
:
# Task level model list
print
(
key
)
# Text Classification, Semantic Representation
# Image Classification, Object Detection, Image Segmentation
for
key
in
model_dict
:
print
(
"-----------------------------------------------"
)
print
(
"{}: {}"
.
format
(
key
,
" | "
.
join
(
model_dict
[
key
])))
elif
args
.
get_model
!=
""
:
elif
args
.
get_model
!=
""
:
model_handle
=
ServingModels
()
model_handle
=
ServingModels
()
model_
names
=
model_handle
.
get_model_list
()
model_
dict
=
model_handle
.
url_dict
if
args
.
get_model
not
in
model_
names
:
if
args
.
get_model
not
in
model_
dict
:
print
(
print
(
"Your model name does not exist in current model list, stay tuned"
"Your model name does not exist in current model list, stay tuned"
)
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录