未验证 提交 48f7e4f7 编写于 作者: M MRXLT 提交者: GitHub

Merge pull request #837 from MRXLT/release/0.3

[cherry pick] to release 0.3
...@@ -16,6 +16,7 @@ from paddle_serving_client import Client ...@@ -16,6 +16,7 @@ from paddle_serving_client import Client
from paddle_serving_app.reader import * from paddle_serving_app.reader import *
import sys import sys
import numpy as np import numpy as np
from paddle_serving_app.reader import BlazeFacePostprocess
preprocess = Sequential([ preprocess = Sequential([
File2Image(), File2Image(),
......
...@@ -30,7 +30,7 @@ else: ...@@ -30,7 +30,7 @@ else:
class ImageService(WebService): class ImageService(WebService):
def init_imagenet_setting(self): def init_imagenet_setting(self):
self.seq = Sequential([ self.seq = Sequential([
Base64ToImage(), Resize(256), CenterCrop(224), RGB2BGR(), Transpose( URL2Image(), Resize(256), CenterCrop(224), RGB2BGR(), Transpose(
(2, 0, 1)), Div(255), Normalize([0.485, 0.456, 0.406], (2, 0, 1)), Div(255), Normalize([0.485, 0.456, 0.406],
[0.229, 0.224, 0.225], True) [0.229, 0.224, 0.225], True)
]) ])
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
from .chinese_bert_reader import ChineseBertReader from .chinese_bert_reader import ChineseBertReader
from .image_reader import ImageReader, File2Image, URL2Image, Sequential, Normalize, Base64ToImage 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 CenterCrop, Resize, Transpose, Div, RGB2BGR, BGR2RGB, ResizeByFactor
from .image_reader import RCNNPostprocess, SegPostprocess, PadStride from .image_reader import RCNNPostprocess, SegPostprocess, PadStride, BlazeFacePostprocess
from .image_reader import DBPostProcess, FilterBoxes, GetRotateCropImage, SortedBoxes from .image_reader import DBPostProcess, FilterBoxes, GetRotateCropImage, SortedBoxes
from .lac_reader import LACReader from .lac_reader import LACReader
from .senta_reader import SentaReader from .senta_reader import SentaReader
......
...@@ -221,6 +221,6 @@ class WebService(object): ...@@ -221,6 +221,6 @@ class WebService(object):
return feed, fetch return feed, fetch
def postprocess(self, feed=[], fetch=[], fetch_map=None): def postprocess(self, feed=[], fetch=[], fetch_map=None):
for key in fetch_map.iterkeys(): for key in fetch_map:
fetch_map[key] = fetch_map[key].tolist() fetch_map[key] = fetch_map[key].tolist()
return fetch_map return fetch_map
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册