Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
da8e0818
S
Serving
项目概览
PaddlePaddle
/
Serving
大约 1 年 前同步成功
通知
185
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
da8e0818
编写于
9月 09, 2020
作者:
J
Jiawei Wang
提交者:
GitHub
9月 09, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #831 from MRXLT/0.3.2-qa
bug fix for 0.3.2
上级
40f8673b
8baf8561
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
6 addition
and
5 deletion
+6
-5
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/paddle_serving_app/reader/__init__.py
python/paddle_serving_app/reader/__init__.py
+1
-1
python/paddle_serving_server/web_service.py
python/paddle_serving_server/web_service.py
+1
-1
python/paddle_serving_server_gpu/web_service.py
python/paddle_serving_server_gpu/web_service.py
+1
-1
未找到文件。
python/examples/imagenet/benchmark.py
浏览文件 @
da8e0818
...
...
@@ -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
浏览文件 @
da8e0818
...
...
@@ -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_app/reader/__init__.py
浏览文件 @
da8e0818
...
...
@@ -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_server/web_service.py
浏览文件 @
da8e0818
...
...
@@ -123,7 +123,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/web_service.py
浏览文件 @
da8e0818
...
...
@@ -178,7 +178,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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录