提交 2d771844 编写于 作者: F felixhjh

cos_dcn_r50_fpn_1x_coco和ppyolo_r50vd_dcn_1x_coco 框偏移bug

上级 9da9c19c
...@@ -16,5 +16,5 @@ This model support TensorRT, if you want a faster inference, please use `--use_t ...@@ -16,5 +16,5 @@ This model support TensorRT, if you want a faster inference, please use `--use_t
### Perform prediction ### Perform prediction
``` ```
python3 test_client.py 000000570688.jpg python3 test_client.py 000000014439.jpg
``` ```
...@@ -18,5 +18,5 @@ python3 -m paddle_serving_server.serve --model serving_server --port 9494 --gpu_ ...@@ -18,5 +18,5 @@ python3 -m paddle_serving_server.serve --model serving_server --port 9494 --gpu_
### 执行预测 ### 执行预测
``` ```
python3 test_client.py 000000570688.jpg python3 test_client.py 000000014439.jpg
``` ```
...@@ -12,18 +12,18 @@ ...@@ -12,18 +12,18 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from paddle_serving_client import Client
from paddle_serving_app.reader import *
import sys import sys
import numpy as np import numpy as np
from paddle_serving_client import Client
from paddle_serving_app.reader import *
import cv2
preprocess = Sequential([ preprocess = Sequential([
File2Image(), BGR2RGB(), Div(255.0), File2Image(), BGR2RGB(), Resize(
Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225], False), (608, 608), interpolation=cv2.INTER_LINEAR), Div(255.0), Transpose(
Resize(640, 640), Transpose((2, 0, 1)) (2, 0, 1))
]) ])
postprocess = RCNNPostprocess("label_list.txt", "output") postprocess = RCNNPostprocess("label_list.txt", "output", [608, 608])
client = Client() client = Client()
client.load_client_config("serving_client/serving_client_conf.prototxt") client.load_client_config("serving_client/serving_client_conf.prototxt")
...@@ -38,3 +38,5 @@ fetch_map = client.predict( ...@@ -38,3 +38,5 @@ fetch_map = client.predict(
fetch=["save_infer_model/scale_0.tmp_1"], fetch=["save_infer_model/scale_0.tmp_1"],
batch=False) batch=False)
print(fetch_map) print(fetch_map)
fetch_map["image"] = sys.argv[1]
postprocess(fetch_map)
...@@ -16,5 +16,5 @@ This model support TensorRT, if you want a faster inference, please use `--use_t ...@@ -16,5 +16,5 @@ This model support TensorRT, if you want a faster inference, please use `--use_t
### Perform prediction ### Perform prediction
``` ```
python3 test_client.py 000000570688.jpg python3 test_client.py 000000014439.jpg
``` ```
...@@ -18,5 +18,5 @@ python3 -m paddle_serving_server.serve --model serving_server --port 9494 --gpu_ ...@@ -18,5 +18,5 @@ python3 -m paddle_serving_server.serve --model serving_server --port 9494 --gpu_
### 执行预测 ### 执行预测
``` ```
python3 test_client.py 000000570688.jpg python3 test_client.py 000000014439.jpg
``` ```
...@@ -12,18 +12,18 @@ ...@@ -12,18 +12,18 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from paddle_serving_client import Client
from paddle_serving_app.reader import *
import sys import sys
import numpy as np import numpy as np
from paddle_serving_client import Client
from paddle_serving_app.reader import *
import cv2
preprocess = Sequential([ preprocess = Sequential([
File2Image(), BGR2RGB(), File2Image(), BGR2RGB(), Resize(
Normalize([123.675, 116.28, 103.53], [58.395, 57.12, 57.375], False), (608, 608), interpolation=cv2.INTER_LINEAR), Div(255.0), Transpose(
Resize((512, 512)), Transpose((2, 0, 1)) (2, 0, 1))
]) ])
postprocess = RCNNPostprocess("label_list.txt", "output") postprocess = RCNNPostprocess("label_list.txt", "output", [608, 608])
client = Client() client = Client()
client.load_client_config("serving_client/serving_client_conf.prototxt") client.load_client_config("serving_client/serving_client_conf.prototxt")
...@@ -33,9 +33,10 @@ im = preprocess(sys.argv[1]) ...@@ -33,9 +33,10 @@ im = preprocess(sys.argv[1])
fetch_map = client.predict( fetch_map = client.predict(
feed={ feed={
"image": im, "image": im,
"im_shape": np.array([512, 512]),
"scale_factor": np.array([1.0, 1.0]).reshape(-1), "scale_factor": np.array([1.0, 1.0]).reshape(-1),
}, },
fetch=["save_infer_model/scale_0.tmp_1"], fetch=["save_infer_model/scale_0.tmp_1"],
batch=False) batch=False)
print(fetch_map) print(fetch_map)
fetch_map["image"] = sys.argv[1]
postprocess(fetch_map)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册