Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
633a771a
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看板
未验证
提交
633a771a
编写于
9月 09, 2020
作者:
M
MRXLT
提交者:
GitHub
9月 09, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #832 from MRXLT/release/0.3
[cherry pick to release/0.3]add commit id and fix bug
上级
8523dfa4
9d90f640
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
61 addition
and
6 deletion
+61
-6
python/CMakeLists.txt
python/CMakeLists.txt
+8
-1
python/examples/imagenet/benchmark.py
python/examples/imagenet/benchmark.py
+1
-0
python/examples/imagenet/resnet50_web_service.py
python/examples/imagenet/resnet50_web_service.py
+2
-2
python/gen_version.py
python/gen_version.py
+43
-0
python/paddle_serving_app/reader/__init__.py
python/paddle_serving_app/reader/__init__.py
+1
-1
python/paddle_serving_app/version.py
python/paddle_serving_app/version.py
+1
-0
python/paddle_serving_client/version.py
python/paddle_serving_client/version.py
+1
-0
python/paddle_serving_server/version.py
python/paddle_serving_server/version.py
+1
-0
python/paddle_serving_server/web_service.py
python/paddle_serving_server/web_service.py
+1
-1
python/paddle_serving_server_gpu/version.py
python/paddle_serving_server_gpu/version.py
+1
-0
python/paddle_serving_server_gpu/web_service.py
python/paddle_serving_server_gpu/web_service.py
+1
-1
未找到文件。
python/CMakeLists.txt
浏览文件 @
633a771a
...
...
@@ -47,6 +47,9 @@ if (SERVER)
endif
()
endif
()
configure_file
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/gen_version.py
${
CMAKE_CURRENT_BINARY_DIR
}
/gen_version.py
)
set
(
SERVING_CLIENT_CORE
${
PADDLE_SERVING_BINARY_DIR
}
/core/general-client/*.so
)
message
(
"python env: "
${
py_env
}
)
...
...
@@ -54,6 +57,7 @@ if (APP)
add_custom_command
(
OUTPUT
${
PADDLE_SERVING_BINARY_DIR
}
/.timestamp
COMMAND cp -r
${
CMAKE_CURRENT_SOURCE_DIR
}
/paddle_serving_app/
${
PADDLE_SERVING_BINARY_DIR
}
/python/
COMMAND env
${
py_env
}
${
PYTHON_EXECUTABLE
}
gen_version.py
"app"
COMMAND env
${
py_env
}
${
PYTHON_EXECUTABLE
}
setup.py bdist_wheel
DEPENDS
${
SERVING_APP_CORE
}
general_model_config_py_proto
${
PY_FILES
}
)
add_custom_target
(
paddle_python ALL DEPENDS
${
PADDLE_SERVING_BINARY_DIR
}
/.timestamp
)
...
...
@@ -65,6 +69,7 @@ add_custom_command(
COMMAND cp -r
${
CMAKE_CURRENT_SOURCE_DIR
}
/paddle_serving_client/
${
PADDLE_SERVING_BINARY_DIR
}
/python/
COMMAND
${
CMAKE_COMMAND
}
-E copy
${
SERVING_CLIENT_CORE
}
${
PADDLE_SERVING_BINARY_DIR
}
/python/paddle_serving_client/serving_client.so
COMMAND env
${
py_env
}
${
PYTHON_EXECUTABLE
}
python_tag.py
COMMAND env
${
py_env
}
${
PYTHON_EXECUTABLE
}
gen_version.py
"client"
COMMAND env
${
py_env
}
${
PYTHON_EXECUTABLE
}
setup.py bdist_wheel
DEPENDS
${
SERVING_CLIENT_CORE
}
sdk_configure_py_proto
${
PY_FILES
}
)
add_custom_target
(
paddle_python ALL DEPENDS serving_client
${
PADDLE_SERVING_BINARY_DIR
}
/.timestamp
)
...
...
@@ -75,6 +80,7 @@ if (SERVER)
add_custom_command
(
OUTPUT
${
PADDLE_SERVING_BINARY_DIR
}
/.timestamp
COMMAND cp -r
${
CMAKE_CURRENT_SOURCE_DIR
}
/paddle_serving_server/
${
PADDLE_SERVING_BINARY_DIR
}
/python/
COMMAND env
${
py_env
}
${
PYTHON_EXECUTABLE
}
gen_version.py
"server"
COMMAND env
${
py_env
}
${
PYTHON_EXECUTABLE
}
setup.py bdist_wheel
DEPENDS
${
SERVING_SERVER_CORE
}
server_config_py_proto
${
PY_FILES
}
)
add_custom_target
(
paddle_python ALL DEPENDS
${
PADDLE_SERVING_BINARY_DIR
}
/.timestamp
)
...
...
@@ -83,7 +89,8 @@ if (SERVER)
OUTPUT
${
PADDLE_SERVING_BINARY_DIR
}
/.timestamp
COMMAND cp -r
${
CMAKE_CURRENT_SOURCE_DIR
}
/paddle_serving_server_gpu/
${
PADDLE_SERVING_BINARY_DIR
}
/python/
COMMAND env
${
py_env
}
${
PYTHON_EXECUTABLE
}
paddle_serving_server_gpu/gen_cuda_version.py
${
CUDA_VERSION_MAJOR
}
COMMAND env
${
py_env
}
${
PYTHON_EXECUTABLE
}
gen_version.py
"server_gpu"
${
CUDA_VERSION_MAJOR
}
COMMAND env
${
py_env
}
${
PYTHON_EXECUTABLE
}
setup.py bdist_wheel
DEPENDS
${
SERVING_SERVER_CORE
}
server_config_py_proto
${
PY_FILES
}
)
add_custom_target
(
paddle_python ALL DEPENDS
${
PADDLE_SERVING_BINARY_DIR
}
/.timestamp
)
...
...
python/examples/imagenet/benchmark.py
浏览文件 @
633a771a
...
...
@@ -90,6 +90,7 @@ def single_func(idx, resource):
image
=
base64
.
b64encode
(
open
(
"./image_data/n01440764/"
+
file_list
[
i
]).
read
())
else
:
image_path
=
"./image_data/n01440764/"
+
file_list
[
i
]
image
=
base64
.
b64encode
(
open
(
image_path
,
"rb"
).
read
()).
decode
(
"utf-8"
)
req
=
json
.
dumps
({
"feed"
:
[{
"image"
:
image
}],
"fetch"
:
[
"score"
]})
...
...
python/examples/imagenet/resnet50_web_service.py
浏览文件 @
633a771a
...
...
@@ -13,7 +13,7 @@
# limitations under the License.
import
sys
from
paddle_serving_client
import
Client
from
paddle_serving_app.reader
import
Sequential
,
URL2Image
,
Resize
,
CenterCrop
,
RGB2BGR
,
Transpose
,
Div
,
Normalize
from
paddle_serving_app.reader
import
Sequential
,
URL2Image
,
Resize
,
CenterCrop
,
RGB2BGR
,
Transpose
,
Div
,
Normalize
,
Base64ToImage
if
len
(
sys
.
argv
)
!=
4
:
print
(
"python resnet50_web_service.py model device port"
)
...
...
@@ -30,7 +30,7 @@ else:
class
ImageService
(
WebService
):
def
init_imagenet_setting
(
self
):
self
.
seq
=
Sequential
([
URL2
Image
(),
Resize
(
256
),
CenterCrop
(
224
),
RGB2BGR
(),
Transpose
(
Base64To
Image
(),
Resize
(
256
),
CenterCrop
(
224
),
RGB2BGR
(),
Transpose
(
(
2
,
0
,
1
)),
Div
(
255
),
Normalize
([
0.485
,
0.456
,
0.406
],
[
0.229
,
0.224
,
0.225
],
True
)
])
...
...
python/
paddle_serving_server_gpu/gen_cuda
_version.py
→
python/
gen
_version.py
浏览文件 @
633a771a
...
...
@@ -15,13 +15,29 @@
import
sys
import
re
import
os
import
subprocess
new_str
=
""
with
open
(
"paddle_serving_server_gpu/version.py"
,
"r"
)
as
f
:
for
line
in
f
.
readlines
():
if
re
.
match
(
"cuda_version"
,
line
):
line
=
re
.
sub
(
r
"\d+"
,
sys
.
argv
[
1
],
line
)
new_str
=
new_str
+
line
with
open
(
"paddle_serving_server_gpu/version.py"
,
"w"
)
as
f
:
f
.
write
(
new_str
)
def
update_info
(
file_name
,
feature
,
info
):
new_str
=
""
with
open
(
file_name
,
"r"
)
as
f
:
for
line
in
f
.
readlines
():
if
re
.
match
(
feature
,
line
):
if
isinstance
(
info
,
str
):
line
=
feature
+
" =
\"
"
+
info
.
strip
()
+
"
\"\n
"
else
:
line
=
feature
+
" =
\"
"
+
info
.
decode
(
'utf-8'
).
strip
(
)
+
"
\"\n
"
new_str
=
new_str
+
line
with
open
(
file_name
,
"w"
)
as
f
:
f
.
write
(
new_str
)
if
len
(
sys
.
argv
)
>
2
:
update_info
(
"paddle_serving_server_gpu/version.py"
,
"cuda_version"
,
sys
.
argv
[
2
])
path
=
"paddle_serving_"
+
sys
.
argv
[
1
]
commit_id
=
subprocess
.
check_output
([
'git'
,
'rev-parse'
,
'HEAD'
])
update_info
(
path
+
"/version.py"
,
"commit_id"
,
commit_id
)
python/paddle_serving_app/reader/__init__.py
浏览文件 @
633a771a
...
...
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from
.chinese_bert_reader
import
ChineseBertReader
from
.image_reader
import
ImageReader
,
File2Image
,
URL2Image
,
Sequential
,
Normalize
from
.image_reader
import
ImageReader
,
File2Image
,
URL2Image
,
Sequential
,
Normalize
,
Base64ToImage
from
.image_reader
import
CenterCrop
,
Resize
,
Transpose
,
Div
,
RGB2BGR
,
BGR2RGB
,
ResizeByFactor
from
.image_reader
import
RCNNPostprocess
,
SegPostprocess
,
PadStride
from
.image_reader
import
DBPostProcess
,
FilterBoxes
,
GetRotateCropImage
,
SortedBoxes
...
...
python/paddle_serving_app/version.py
浏览文件 @
633a771a
...
...
@@ -13,3 +13,4 @@
# limitations under the License.
""" Paddle Serving App version string """
serving_app_version
=
"0.1.2"
commit_id
=
""
python/paddle_serving_client/version.py
浏览文件 @
633a771a
...
...
@@ -15,3 +15,4 @@
serving_client_version
=
"0.3.2"
serving_server_version
=
"0.3.2"
module_proto_version
=
"0.3.2"
commit_id
=
""
python/paddle_serving_server/version.py
浏览文件 @
633a771a
...
...
@@ -15,3 +15,4 @@
serving_client_version
=
"0.3.2"
serving_server_version
=
"0.3.2"
module_proto_version
=
"0.3.2"
commit_id
=
""
python/paddle_serving_server/web_service.py
浏览文件 @
633a771a
...
...
@@ -96,7 +96,7 @@ class WebService(object):
feed
=
request
.
json
[
"feed"
],
fetch
=
fetch
,
fetch_map
=
fetch_map
)
result
=
{
"result"
:
result
}
except
ValueError
as
err
:
result
=
{
"result"
:
err
}
result
=
{
"result"
:
str
(
err
)
}
return
result
def
run_rpc_service
(
self
):
...
...
python/paddle_serving_server_gpu/version.py
浏览文件 @
633a771a
...
...
@@ -16,3 +16,4 @@ serving_client_version = "0.3.2"
serving_server_version
=
"0.3.2"
module_proto_version
=
"0.3.2"
cuda_version
=
"9"
commit_id
=
""
python/paddle_serving_server_gpu/web_service.py
浏览文件 @
633a771a
...
...
@@ -151,7 +151,7 @@ class WebService(object):
feed
=
request
.
json
[
"feed"
],
fetch
=
fetch
,
fetch_map
=
fetch_map
)
result
=
{
"result"
:
result
}
except
ValueError
as
err
:
result
=
{
"result"
:
err
}
result
=
{
"result"
:
str
(
err
)
}
return
result
def
run_rpc_service
(
self
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录