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
for
key
in
[
"senta_bilstm"
,
"senta_bow"
,
"senta_cnn"
,
"senta_gru"
,
"senta_lstm"
]:
self
.
model_dict
[
self
.
model_dict
[
key
]
=
"https://paddle-serving.bj.bcebos.com/paddle_hub_models/text/SentimentAnalysis/"
+
key
+
".tar.gz"
"SentimentAnalysis"
]
=
[
"senta_bilstm"
,
"senta_bow"
,
"senta_cnn"
]
#image classification
self
.
model_dict
[
"SemanticRepresentation"
]
=
[
"ernie_base"
]
for
key
in
[
self
.
model_dict
[
"ChineseWordSegmentation"
]
=
[
"lac"
]
"alexnet_imagenet"
,
self
.
model_dict
[
"ObjectDetection"
]
=
[
"faster_rcnn"
,
"yolov3"
]
"darknet53-imagenet"
,
self
.
model_dict
[
"ImageSegmentation"
]
=
[
"unet"
,
"deeplabv3"
]
"densenet121_imagenet"
,
self
.
model_dict
[
"ImageClassification"
]
=
[
"densenet161_imagenet"
,
"resnet_v2_50_imagenet"
,
"efficientnetb6_imagenet"
"densenet169_imagenet"
,
]
"densenet201_imagenet"
,
"densenet264_imagenet"
image_class_url
=
"https://paddle-serving.bj.bcebos.com/paddle_hub_models/image/ImageClassification/"
"dpn107_imagenet"
,
image_seg_url
=
"https://paddle-serving.bj.bcebos.com/paddle_hub_models/image/ImageSegmentation/"
"dpn131_imagenet"
,
object_detection_url
=
"https://paddle-serving.bj.bcebos.com/paddle_hub_models/image/ObjectDetection/"
"dpn68_imagenet"
,
senta_url
=
"https://paddle-serving.bj.bcebos.com/paddle_hub_models/text/SentimentAnalysis/"
"dpn92_imagenet"
,
semantic_url
=
"https://paddle-serving.bj.bcebos.com/paddle_hub_models/text/SemanticRepresentation/"
"dpn98_imagenet"
,
wordseg_url
=
"https://paddle-serving.bj.bcebos.com/paddle_hub_models/text/ChineseWordSegmentation/"
"efficientnetb0_imagenet"
,
"efficientnetb1_imagenet"
,
self
.
url_dict
=
{}
"efficientnetb2_imagenet"
,
"efficientnetb3_imagenet"
,
def
pack_url
(
model_dict
,
key
,
url
):
"efficientnetb4_imagenet"
,
for
i
,
value
in
enumerate
(
model_dict
[
key
]):
"efficientnetb5_imagenet"
,
self
.
url_dict
[
model_dict
[
key
][
i
]]
=
url
+
model_dict
[
key
][
"efficientnetb6_imagenet"
,
i
]
+
".tar.gz"
"googlenet_imagenet"
,
"inception_v4_imagenet"
,
pack_url
(
self
.
model_dict
,
"SentimentAnalysis"
,
senta_url
)
"inception_v2_imagenet"
,
pack_url
(
self
.
model_dict
,
"SemanticRepresentation"
,
semantic_url
)
"nasnet_imagenet"
,
pack_url
(
self
.
model_dict
,
"ChineseWordSegmentation"
,
wordseg_url
)
"pnasnet_imagenet"
,
pack_url
(
self
.
model_dict
,
"ObjectDetection"
,
object_detection_url
)
"resnet_v2_101_imagenet"
,
pack_url
(
self
.
model_dict
,
"ImageSegmentation"
,
image_seg_url
)
"resnet_v2_151_imagenet"
,
pack_url
(
self
.
model_dict
,
"ImageClassification"
,
image_class_url
)
"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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录