未验证 提交 997fec86 编写于 作者: S shangliang Xu 提交者: GitHub

[TIPC] fix serving_cpp_infer (#6221)

上级 86d11239
...@@ -85,9 +85,13 @@ int mask_rcnn_r50_fpn_1x_coco::inference() { ...@@ -85,9 +85,13 @@ int mask_rcnn_r50_fpn_1x_coco::inference() {
cv::cvtColor(img, img, cv::COLOR_BGR2RGB); cv::cvtColor(img, img, cv::COLOR_BGR2RGB);
// preprocess // preprocess
std::vector<float> input(1 * 3 * im_shape_h * im_shape_w, 0.0f); Resize(&img, scale_factor_h, scale_factor_w, im_shape_h, im_shape_w);
preprocess_det(img, input.data(), scale_factor_h, scale_factor_w, im_shape_h, Normalize(&img, mean_, scale_, is_scale_);
im_shape_w, mean_, scale_, is_scale_); PadStride(&img, 32);
int input_shape_h = img.rows;
int input_shape_w = img.cols;
std::vector<float> input(1 * 3 * input_shape_h * input_shape_w, 0.0f);
Permute(img, input.data());
// create real_in // create real_in
TensorVector *real_in = new TensorVector(); TensorVector *real_in = new TensorVector();
...@@ -124,7 +128,7 @@ int mask_rcnn_r50_fpn_1x_coco::inference() { ...@@ -124,7 +128,7 @@ int mask_rcnn_r50_fpn_1x_coco::inference() {
real_in->push_back(tensor_in_0); real_in->push_back(tensor_in_0);
// image // image
in_num = 1 * 3 * im_shape_h * im_shape_w; in_num = 1 * 3 * input_shape_h * input_shape_w;
databuf_size = in_num * sizeof(float); databuf_size = in_num * sizeof(float);
databuf_data = MempoolWrapper::instance().malloc(databuf_size); databuf_data = MempoolWrapper::instance().malloc(databuf_size);
...@@ -139,7 +143,7 @@ int mask_rcnn_r50_fpn_1x_coco::inference() { ...@@ -139,7 +143,7 @@ int mask_rcnn_r50_fpn_1x_coco::inference() {
paddle::PaddleTensor tensor_in_1; paddle::PaddleTensor tensor_in_1;
tensor_in_1.name = "image"; tensor_in_1.name = "image";
tensor_in_1.dtype = paddle::PaddleDType::FLOAT32; tensor_in_1.dtype = paddle::PaddleDType::FLOAT32;
tensor_in_1.shape = {1, 3, im_shape_h, im_shape_w}; tensor_in_1.shape = {1, 3, input_shape_h, input_shape_w};
tensor_in_1.lod = in->at(0).lod; tensor_in_1.lod = in->at(0).lod;
tensor_in_1.data = paddleBuf_1; tensor_in_1.data = paddleBuf_1;
real_in->push_back(tensor_in_1); real_in->push_back(tensor_in_1);
...@@ -179,16 +183,12 @@ int mask_rcnn_r50_fpn_1x_coco::inference() { ...@@ -179,16 +183,12 @@ int mask_rcnn_r50_fpn_1x_coco::inference() {
return 0; return 0;
} }
void mask_rcnn_r50_fpn_1x_coco::preprocess_det(const cv::Mat &img, float *data, void mask_rcnn_r50_fpn_1x_coco::Resize(cv::Mat *img, float &scale_factor_h,
float &scale_factor_h, float &scale_factor_w, int &im_shape_h,
float &scale_factor_w, int &im_shape_w) {
int &im_shape_h, int &im_shape_w,
const std::vector<float> &mean,
const std::vector<float> &scale,
const bool is_scale) {
// keep_ratio // keep_ratio
int im_size_max = std::max(img.rows, img.cols); int im_size_max = std::max(img->rows, img->cols);
int im_size_min = std::min(img.rows, img.cols); int im_size_min = std::min(img->rows, img->cols);
int target_size_max = std::max(im_shape_h, im_shape_w); int target_size_max = std::max(im_shape_h, im_shape_w);
int target_size_min = std::min(im_shape_h, im_shape_w); int target_size_min = std::min(im_shape_h, im_shape_w);
float scale_min = float scale_min =
...@@ -202,46 +202,52 @@ void mask_rcnn_r50_fpn_1x_coco::preprocess_det(const cv::Mat &img, float *data, ...@@ -202,46 +202,52 @@ void mask_rcnn_r50_fpn_1x_coco::preprocess_det(const cv::Mat &img, float *data,
scale_factor_w = scale_ratio; scale_factor_w = scale_ratio;
// Resize // Resize
cv::Mat resize_img; cv::resize(*img, *img, cv::Size(), scale_ratio, scale_ratio, 2);
cv::resize(img, resize_img, cv::Size(), scale_ratio, scale_ratio, 2); im_shape_h = img->rows;
im_shape_h = resize_img.rows; im_shape_w = img->cols;
im_shape_w = resize_img.cols; }
void mask_rcnn_r50_fpn_1x_coco::Normalize(cv::Mat *img,
const std::vector<float> &mean,
const std::vector<float> &scale,
const bool is_scale) {
// Normalize // Normalize
double e = 1.0; double e = 1.0;
if (is_scale) { if (is_scale) {
e /= 255.0; e /= 255.0;
} }
cv::Mat img_fp; (*img).convertTo(*img, CV_32FC3, e);
(resize_img).convertTo(img_fp, CV_32FC3, e); for (int h = 0; h < img->rows; h++) {
for (int h = 0; h < im_shape_h; h++) { for (int w = 0; w < img->cols; w++) {
for (int w = 0; w < im_shape_w; w++) { img->at<cv::Vec3f>(h, w)[0] =
img_fp.at<cv::Vec3f>(h, w)[0] = (img->at<cv::Vec3f>(h, w)[0] - mean[0]) / scale[0];
(img_fp.at<cv::Vec3f>(h, w)[0] - mean[0]) / scale[0]; img->at<cv::Vec3f>(h, w)[1] =
img_fp.at<cv::Vec3f>(h, w)[1] = (img->at<cv::Vec3f>(h, w)[1] - mean[1]) / scale[1];
(img_fp.at<cv::Vec3f>(h, w)[1] - mean[1]) / scale[1]; img->at<cv::Vec3f>(h, w)[2] =
img_fp.at<cv::Vec3f>(h, w)[2] = (img->at<cv::Vec3f>(h, w)[2] - mean[2]) / scale[2];
(img_fp.at<cv::Vec3f>(h, w)[2] - mean[2]) / scale[2];
} }
} }
}
void mask_rcnn_r50_fpn_1x_coco::PadStride(cv::Mat *img, int stride_) {
// PadStride // PadStride
cv::Mat img_pad; if (stride_ <= 0)
int stride_ = 32; return;
int nh = int rh = img->rows;
(im_shape_h / stride_) * stride_ + (im_shape_h % stride_ != 0) * stride_; int rw = img->cols;
int nw = int nh = (rh / stride_) * stride_ + (rh % stride_ != 0) * stride_;
(im_shape_w / stride_) * stride_ + (im_shape_w % stride_ != 0) * stride_; int nw = (rw / stride_) * stride_ + (rw % stride_ != 0) * stride_;
cv::copyMakeBorder(img_fp, img_pad, 0, nh - im_shape_h, 0, nw - im_shape_w, cv::copyMakeBorder(*img, *img, 0, nh - rh, 0, nw - rw, cv::BORDER_CONSTANT,
cv::BORDER_CONSTANT, cv::Scalar(0)); cv::Scalar(0));
}
void mask_rcnn_r50_fpn_1x_coco::Permute(const cv::Mat &img, float *data) {
// Permute // Permute
int rh = img_pad.rows; int rh = img.rows;
int rw = img_pad.cols; int rw = img.cols;
int rc = img_pad.channels(); int rc = img.channels();
for (int i = 0; i < rc; ++i) { for (int i = 0; i < rc; ++i) {
cv::extractChannel(img_pad, cv::Mat(rh, rw, CV_32FC1, data + i * rh * rw), cv::extractChannel(img, cv::Mat(rh, rw, CV_32FC1, data + i * rh * rw), i);
i);
} }
} }
......
...@@ -54,10 +54,13 @@ private: ...@@ -54,10 +54,13 @@ private:
int im_shape_w = 800; int im_shape_w = 800;
float scale_factor_h = 1.0f; float scale_factor_h = 1.0f;
float scale_factor_w = 1.0f; float scale_factor_w = 1.0f;
void preprocess_det(const cv::Mat &img, float *data, float &scale_factor_h,
float &scale_factor_w, int &im_shape_h, int &im_shape_w, void Resize(cv::Mat *img, float &scale_factor_h, float &scale_factor_w,
const std::vector<float> &mean, int &im_shape_h, int &im_shape_w);
void Normalize(cv::Mat *img, const std::vector<float> &mean,
const std::vector<float> &scale, const bool is_scale); const std::vector<float> &scale, const bool is_scale);
void PadStride(cv::Mat *img, int stride_ = -1);
void Permute(const cv::Mat &img, float *data);
// read pics // read pics
cv::Mat Base2Mat(std::string &base64_data); cv::Mat Base2Mat(std::string &base64_data);
......
...@@ -50,8 +50,8 @@ private: ...@@ -50,8 +50,8 @@ private:
std::vector<float> mean_ = {0.485f, 0.456f, 0.406f}; std::vector<float> mean_ = {0.485f, 0.456f, 0.406f};
std::vector<float> scale_ = {0.229f, 0.224f, 0.225f}; std::vector<float> scale_ = {0.229f, 0.224f, 0.225f};
bool is_scale_ = true; bool is_scale_ = true;
int im_shape_h = 608; int im_shape_h = 320;
int im_shape_w = 608; int im_shape_w = 320;
float scale_factor_h = 1.0f; float scale_factor_h = 1.0f;
float scale_factor_w = 1.0f; float scale_factor_w = 1.0f;
void preprocess_det(const cv::Mat &img, float *data, float &scale_factor_h, void preprocess_det(const cv::Mat &img, float *data, float &scale_factor_h,
......
...@@ -20,7 +20,6 @@ from paddle_serving_client import Client ...@@ -20,7 +20,6 @@ from paddle_serving_client import Client
from paddle_serving_client.proto import general_model_config_pb2 as m_config from paddle_serving_client.proto import general_model_config_pb2 as m_config
import google.protobuf.text_format import google.protobuf.text_format
parser = argparse.ArgumentParser(description="args for paddleserving") parser = argparse.ArgumentParser(description="args for paddleserving")
parser.add_argument( parser.add_argument(
"--serving_client", type=str, help="the directory of serving_client") "--serving_client", type=str, help="the directory of serving_client")
...@@ -63,14 +62,14 @@ def get_test_images(infer_dir, infer_img): ...@@ -63,14 +62,14 @@ def get_test_images(infer_dir, infer_img):
return images return images
def postprocess(fetch_dict, draw_threshold=0.5): def postprocess(fetch_dict, fetch_vars, draw_threshold=0.5):
result = [] result = []
if "conv2d_441.tmp_1" in fetch_dict: if "conv2d_441.tmp_1" in fetch_dict:
heatmap = fetch_dict["conv2d_441.tmp_1"] heatmap = fetch_dict["conv2d_441.tmp_1"]
print(heatmap) print(heatmap)
result.append(heatmap) result.append(heatmap)
else: else:
bboxes = fetch_dict["multiclass_nms3_0.tmp_0"] bboxes = fetch_dict[fetch_vars[0]]
for bbox in bboxes: for bbox in bboxes:
if bbox[0] > -1 and bbox[1] > draw_threshold: if bbox[0] > -1 and bbox[1] > draw_threshold:
print(f"{int(bbox[0])} {bbox[1]} " print(f"{int(bbox[0])} {bbox[1]} "
...@@ -123,4 +122,4 @@ if __name__ == '__main__': ...@@ -123,4 +122,4 @@ if __name__ == '__main__':
image = base64.b64encode(image_data).decode('utf8') image = base64.b64encode(image_data).decode('utf8')
fetch_dict = client.predict( fetch_dict = client.predict(
feed={feed_vars[0]: image}, fetch=fetch_vars) feed={feed_vars[0]: image}, fetch=fetch_vars)
result = postprocess(fetch_dict, args.threshold) result = postprocess(fetch_dict, fetch_vars, args.threshold)
===========================cpp_infer_params===========================
model_name:picodet_l_640_coco_lcnet
python:python3.7
filename:null
##
--output_dir:./output_inference
weights:https://paddledet.bj.bcebos.com/models/picodet_l_640_coco_lcnet.pdparams
norm_export:tools/export_model.py -c configs/picodet/picodet_l_640_coco_lcnet.yml -o
quant_export:tools/export_model.py -c configs/picodet/picodet_l_640_coco_lcnet.yml --slim_config _template_pact -o
fpgm_export:tools/export_model.py -c configs/picodet/picodet_l_640_coco_lcnet.yml --slim_config _template_fpgm -o
distill_export:null
export1:null
export2:null
kl_quant_export:tools/post_quant.py -c configs/picodet/picodet_l_640_coco_lcnet.yml --slim_config _template_kl_quant -o
##
opencv_dir:default
infer_mode:norm
infer_quant:False
inference:./deploy/cpp/build/main
--device:gpu|cpu
--use_mkldnn:False
--cpu_threads:4
--batch_size:1|2
--use_tensorrt:null
--run_mode:paddle
--model_dir:
--image_dir:./dataset/coco/test2017/
--run_benchmark:False
null:null
\ No newline at end of file
===========================serving_infer_python_params===========================
model_name:picodet_l_640_coco_lcnet
python:python3.7
filename:null
##
--output_dir:./output_inference
weights:https://paddledet.bj.bcebos.com/models/picodet_l_640_coco_lcnet.pdparams
norm_export:tools/export_model.py -c configs/picodet/picodet_l_640_coco_lcnet.yml --export_serving_model True -o
quant_export:tools/export_model.py -c configs/picodet/picodet_l_640_coco_lcnet.yml --slim_config _template_pact --export_serving_model True -o
fpgm_export:tools/export_model.py -c configs/picodet/picodet_l_640_coco_lcnet.yml --slim_config _template_fpgm --export_serving_model True -o
distill_export:null
export1:null
export2:null
kl_quant_export:tools/post_quant.py -c configs/picodet/picodet_l_640_coco_lcnet.yml --slim_config _template_kl_quant --export_serving_model True -o
##
infer_mode:norm
infer_quant:False
web_service:deploy/serving/python/web_service.py --config=deploy/serving/python/config.yml
--model_dir:null
--opt:cpu:op.ppdet.local_service_conf.device_type=0|gpu:op.ppdet.local_service_conf.device_type=1
null:null
http_client:deploy/serving/python/pipeline_http_client.py
--image_file:./demo/000000014439.jpg
null:null
\ No newline at end of file
===========================train_params===========================
model_name:picodet_l_640_coco_lcnet
python:python3.7
gpu_list:0|0,1
use_gpu:True
auto_cast:null
epoch:lite_train_lite_infer=1|lite_train_whole_infer=1|whole_train_whole_infer=300
save_dir:null
TrainReader.batch_size:lite_train_lite_infer=2|lite_train_whole_infer=2|whole_train_whole_infer=32
pretrain_weights:https://paddledet.bj.bcebos.com/models/picodet_l_640_coco_lcnet.pdparams
trained_model_name:model_final.pdparams
train_infer_img_dir:./dataset/coco/test2017/
filename:null
##
trainer:norm_train
norm_train:tools/train.py -c configs/picodet/picodet_l_640_coco_lcnet.yml -o
pact_train:tools/train.py -c configs/picodet/picodet_l_640_coco_lcnet.yml --slim_config _template_pact -o
fpgm_train:tools/train.py -c configs/picodet/picodet_l_640_coco_lcnet.yml --slim_config _template_fpgm -o
distill_train:null
null:null
null:null
##
===========================eval_params===========================
eval:tools/eval.py -c configs/picodet/picodet_l_640_coco_lcnet.yml -o
null:null
##
===========================infer_params===========================
--output_dir:./output_inference
weights:https://paddledet.bj.bcebos.com/models/picodet_l_640_coco_lcnet.pdparams
norm_export:tools/export_model.py -c configs/picodet/picodet_l_640_coco_lcnet.yml -o
pact_export:tools/export_model.py -c configs/picodet/picodet_l_640_coco_lcnet.yml --slim_config _template_pact -o
fpgm_export:tools/export_model.py -c configs/picodet/picodet_l_640_coco_lcnet.yml --slim_config _template_fpgm -o
distill_export:null
export1:null
export2:null
kl_quant_export:tools/post_quant.py -c configs/picodet/picodet_l_640_coco_lcnet.yml --slim_config _template_kl_quant -o
##
infer_mode:norm
infer_quant:False
inference:./deploy/python/infer.py
--device:gpu|cpu
--enable_mkldnn:False
--cpu_threads:4
--batch_size:1
--use_tensorrt:null
--run_mode:paddle
--model_dir:
--image_dir:./dataset/coco/test2017/
--save_log_path:null
--run_benchmark:False
null:null
===========================infer_benchmark_params===========================
numpy_infer_input:3x640x640_2.npy
\ No newline at end of file
===========================train_params===========================
model_name:picodet_l_640_coco_lcnet
python:python3.7
gpu_list:0|0,1
use_gpu:True
auto_cast:amp
epoch:lite_train_lite_infer=1|lite_train_whole_infer=1|whole_train_whole_infer=300
save_dir:null
TrainReader.batch_size:lite_train_lite_infer=2|lite_train_whole_infer=2|whole_train_whole_infer=32
pretrain_weights:https://paddledet.bj.bcebos.com/models/picodet_l_640_coco_lcnet.pdparams
trained_model_name:model_final.pdparams
train_infer_img_dir:./dataset/coco/test2017/
amp_level:O2
##
trainer:norm_train
norm_train:tools/train.py -c configs/picodet/picodet_l_640_coco_lcnet.yml -o
pact_train:tools/train.py -c configs/picodet/picodet_l_640_coco_lcnet.yml --slim_config _template_pact -o
fpgm_train:tools/train.py -c configs/picodet/picodet_l_640_coco_lcnet.yml --slim_config _template_fpgm -o
distill_train:null
null:null
null:null
##
===========================eval_params===========================
eval:tools/eval.py -c configs/picodet/picodet_l_640_coco_lcnet.yml -o
null:null
##
===========================infer_params===========================
--output_dir:./output_inference
weights:https://paddledet.bj.bcebos.com/models/picodet_l_640_coco_lcnet.pdparams
norm_export:tools/export_model.py -c configs/picodet/picodet_l_640_coco_lcnet.yml -o
pact_export:tools/export_model.py -c configs/picodet/picodet_l_640_coco_lcnet.yml --slim_config _template_pact -o
fpgm_export:tools/export_model.py -c configs/picodet/picodet_l_640_coco_lcnet.yml --slim_config _template_fpgm -o
distill_export:null
export1:null
export2:null
kl_quant_export:tools/post_quant.py -c configs/picodet/picodet_l_640_coco_lcnet.yml --slim_config _template_kl_quant -o
##
infer_mode:norm
infer_quant:False
inference:./deploy/python/infer.py
--device:gpu|cpu
--enable_mkldnn:False
--cpu_threads:4
--batch_size:1|2
--use_tensorrt:null
--run_mode:paddle
--model_dir:
--image_dir:./dataset/coco/test2017/
--save_log_path:null
--run_benchmark:False
--trt_max_shape:1600
\ No newline at end of file
===========================cpp_infer_params===========================
model_name:picodet_m_416_coco_lcnet
python:python3.7
filename:null
##
--output_dir:./output_inference
weights:https://paddledet.bj.bcebos.com/models/picodet_m_416_coco_lcnet.pdparams
norm_export:tools/export_model.py -c configs/picodet/picodet_m_416_coco_lcnet.yml -o
quant_export:tools/export_model.py -c configs/picodet/picodet_m_416_coco_lcnet.yml --slim_config _template_pact -o
fpgm_export:tools/export_model.py -c configs/picodet/picodet_m_416_coco_lcnet.yml --slim_config _template_fpgm -o
distill_export:null
export1:null
export2:null
kl_quant_export:tools/post_quant.py -c configs/picodet/picodet_m_416_coco_lcnet.yml --slim_config _template_kl_quant -o
##
opencv_dir:default
infer_mode:norm
infer_quant:False
inference:./deploy/cpp/build/main
--device:gpu|cpu
--use_mkldnn:False
--cpu_threads:4
--batch_size:1|2
--use_tensorrt:null
--run_mode:paddle
--model_dir:
--image_dir:./dataset/coco/test2017/
--run_benchmark:False
null:null
\ No newline at end of file
===========================serving_infer_python_params===========================
model_name:picodet_m_416_coco_lcnet
python:python3.7
filename:null
##
--output_dir:./output_inference
weights:https://paddledet.bj.bcebos.com/models/picodet_m_416_coco_lcnet.pdparams
norm_export:tools/export_model.py -c configs/picodet/picodet_m_416_coco_lcnet.yml --export_serving_model True -o
quant_export:tools/export_model.py -c configs/picodet/picodet_m_416_coco_lcnet.yml --slim_config _template_pact --export_serving_model True -o
fpgm_export:tools/export_model.py -c configs/picodet/picodet_m_416_coco_lcnet.yml --slim_config _template_fpgm --export_serving_model True -o
distill_export:null
export1:null
export2:null
kl_quant_export:tools/post_quant.py -c configs/picodet/picodet_m_416_coco_lcnet.yml --slim_config _template_kl_quant --export_serving_model True -o
##
infer_mode:norm
infer_quant:False
web_service:deploy/serving/python/web_service.py --config=deploy/serving/python/config.yml
--model_dir:null
--opt:cpu:op.ppdet.local_service_conf.device_type=0|gpu:op.ppdet.local_service_conf.device_type=1
null:null
http_client:deploy/serving/python/pipeline_http_client.py
--image_file:./demo/000000014439.jpg
null:null
\ No newline at end of file
===========================train_params===========================
model_name:picodet_m_416_coco_lcnet
python:python3.7
gpu_list:0|0,1
use_gpu:True
auto_cast:null
epoch:lite_train_lite_infer=1|lite_train_whole_infer=1|whole_train_whole_infer=300
save_dir:null
TrainReader.batch_size:lite_train_lite_infer=2|lite_train_whole_infer=2|whole_train_whole_infer=80
pretrain_weights:https://paddledet.bj.bcebos.com/models/picodet_m_416_coco_lcnet.pdparams
trained_model_name:model_final.pdparams
train_infer_img_dir:./dataset/coco/test2017/
filename:null
##
trainer:norm_train
norm_train:tools/train.py -c configs/picodet/picodet_m_416_coco_lcnet.yml -o
pact_train:tools/train.py -c configs/picodet/picodet_m_416_coco_lcnet.yml --slim_config _template_pact -o
fpgm_train:tools/train.py -c configs/picodet/picodet_m_416_coco_lcnet.yml --slim_config _template_fpgm -o
distill_train:null
null:null
null:null
##
===========================eval_params===========================
eval:tools/eval.py -c configs/picodet/picodet_m_416_coco_lcnet.yml -o
null:null
##
===========================infer_params===========================
--output_dir:./output_inference
weights:https://paddledet.bj.bcebos.com/models/picodet_m_416_coco_lcnet.pdparams
norm_export:tools/export_model.py -c configs/picodet/picodet_m_416_coco_lcnet.yml -o
pact_export:tools/export_model.py -c configs/picodet/picodet_m_416_coco_lcnet.yml --slim_config _template_pact -o
fpgm_export:tools/export_model.py -c configs/picodet/picodet_m_416_coco_lcnet.yml --slim_config _template_fpgm -o
distill_export:null
export1:null
export2:null
kl_quant_export:tools/post_quant.py -c configs/picodet/picodet_m_416_coco_lcnet.yml --slim_config _template_kl_quant -o
##
infer_mode:norm
infer_quant:False
inference:./deploy/python/infer.py
--device:gpu|cpu
--enable_mkldnn:False
--cpu_threads:4
--batch_size:1
--use_tensorrt:null
--run_mode:paddle
--model_dir:
--image_dir:./dataset/coco/test2017/
--save_log_path:null
--run_benchmark:False
null:null
===========================infer_benchmark_params===========================
numpy_infer_input:3x416x416_2.npy
\ No newline at end of file
===========================train_params===========================
model_name:picodet_m_416_coco_lcnet
python:python3.7
gpu_list:0|0,1
use_gpu:True
auto_cast:amp
epoch:lite_train_lite_infer=1|lite_train_whole_infer=1|whole_train_whole_infer=300
save_dir:null
TrainReader.batch_size:lite_train_lite_infer=2|lite_train_whole_infer=2|whole_train_whole_infer=80
pretrain_weights:https://paddledet.bj.bcebos.com/models/picodet_m_416_coco_lcnet.pdparams
trained_model_name:model_final.pdparams
train_infer_img_dir:./dataset/coco/test2017/
amp_level:O2
##
trainer:norm_train
norm_train:tools/train.py -c configs/picodet/picodet_m_416_coco_lcnet.yml -o
pact_train:tools/train.py -c configs/picodet/picodet_m_416_coco_lcnet.yml --slim_config _template_pact -o
fpgm_train:tools/train.py -c configs/picodet/picodet_m_416_coco_lcnet.yml --slim_config _template_fpgm -o
distill_train:null
null:null
null:null
##
===========================eval_params===========================
eval:tools/eval.py -c configs/picodet/picodet_m_416_coco_lcnet.yml -o
null:null
##
===========================infer_params===========================
--output_dir:./output_inference
weights:https://paddledet.bj.bcebos.com/models/picodet_m_416_coco_lcnet.pdparams
norm_export:tools/export_model.py -c configs/picodet/picodet_m_416_coco_lcnet.yml -o
pact_export:tools/export_model.py -c configs/picodet/picodet_m_416_coco_lcnet.yml --slim_config _template_pact -o
fpgm_export:tools/export_model.py -c configs/picodet/picodet_m_416_coco_lcnet.yml --slim_config _template_fpgm -o
distill_export:null
export1:null
export2:null
kl_quant_export:tools/post_quant.py -c configs/picodet/picodet_m_416_coco_lcnet.yml --slim_config _template_kl_quant -o
##
infer_mode:norm
infer_quant:False
inference:./deploy/python/infer.py
--device:gpu|cpu
--enable_mkldnn:False
--cpu_threads:4
--batch_size:1|2
--use_tensorrt:null
--run_mode:paddle
--model_dir:
--image_dir:./dataset/coco/test2017/
--save_log_path:null
--run_benchmark:False
--trt_max_shape:1600
\ No newline at end of file
===========================paddle2onnx_params===========================
model_name:picodet_s_320_coco_lcnet
python:python3.7
filename:null
##
--output_dir:./output_inference
weights:https://paddledet.bj.bcebos.com/models/picodet_s_320_coco_lcnet.pdparams
norm_export:tools/export_model.py -c configs/picodet/picodet_s_320_coco_lcnet.yml -o
quant_export:tools/export_model.py -c configs/picodet/picodet_s_320_coco_lcnet.yml --slim_config configs/picodet/picodet_s_320_coco_lcnet.yml -o
fpgm_export:tools/export_model.py -c configs/picodet/picodet_s_320_coco_lcnet.yml --slim_config configs/picodet/picodet_s_320_coco_lcnet.yml -o
distill_export:null
export1:null
export2:null
kl_quant_export:tools/post_quant.py -c configs/picodet/picodet_s_320_coco_lcnet.yml --slim_config configs/picodet/picodet_s_320_coco_lcnet.yml -o
##
2onnx: paddle2onnx
--model_dir:./output_inference/picodet_s_320_coco_lcnet/
--model_filename:model.pdmodel
--params_filename:model.pdiparams
--save_file:./deploy/third_engine/demo_onnxruntime/onnx_file/picodet_s_320_coco.onnx
--opset_version:11
##
inference:infer_demo.py
--modelpath:./onnx_file/picodet_s_320_coco.onnx
--img_fold:./imgs
--result_fold:results
infer_mode:norm
null:null
\ No newline at end of file
===========================cpp_infer_params===========================
model_name:picodet_s_320_coco_lcnet
python:python3.7
filename:null
##
--output_dir:./output_inference
weights:https://paddledet.bj.bcebos.com/models/picodet_s_320_coco_lcnet.pdparams
norm_export:tools/export_model.py -c configs/picodet/picodet_s_320_coco_lcnet.yml -o
quant_export:tools/export_model.py -c configs/picodet/picodet_s_320_coco_lcnet.yml --slim_config _template_pact -o
fpgm_export:tools/export_model.py -c configs/picodet/picodet_s_320_coco_lcnet.yml --slim_config _template_fpgm -o
distill_export:null
export1:null
export2:null
kl_quant_export:tools/post_quant.py -c configs/picodet/picodet_s_320_coco_lcnet.yml --slim_config _template_kl_quant -o
##
opencv_dir:default
infer_mode:norm
infer_quant:False
inference:./deploy/cpp/build/main
--device:gpu|cpu
--use_mkldnn:False
--cpu_threads:4
--batch_size:1|2
--use_tensorrt:null
--run_mode:paddle
--model_dir:
--image_dir:./dataset/coco/test2017/
--run_benchmark:False
null:null
\ No newline at end of file
===========================serving_infer_python_params===========================
model_name:picodet_s_320_coco_lcnet
python:python3.7
filename:null
##
--output_dir:./output_inference
weights:https://paddledet.bj.bcebos.com/models/picodet_s_320_coco_lcnet.pdparams
norm_export:tools/export_model.py -c configs/picodet/picodet_s_320_coco_lcnet.yml --export_serving_model True -o
quant_export:tools/export_model.py -c configs/picodet/picodet_s_320_coco_lcnet.yml --slim_config _template_pact --export_serving_model True -o
fpgm_export:tools/export_model.py -c configs/picodet/picodet_s_320_coco_lcnet.yml --slim_config _template_fpgm --export_serving_model True -o
distill_export:null
export1:null
export2:null
kl_quant_export:tools/post_quant.py -c configs/picodet/picodet_s_320_coco_lcnet.yml --slim_config _template_kl_quant --export_serving_model True -o
##
infer_mode:norm
infer_quant:False
web_service:deploy/serving/python/web_service.py --config=deploy/serving/python/config.yml
--model_dir:null
--opt:cpu:op.ppdet.local_service_conf.device_type=0|gpu:op.ppdet.local_service_conf.device_type=1
null:null
http_client:deploy/serving/python/pipeline_http_client.py
--image_file:./demo/000000014439.jpg
null:null
\ No newline at end of file
===========================train_params===========================
model_name:picodet_s_320_coco_lcnet
python:python3.7
gpu_list:0|0,1
use_gpu:True
auto_cast:null
epoch:lite_train_lite_infer=1|lite_train_whole_infer=1|whole_train_whole_infer=300
save_dir:null
TrainReader.batch_size:lite_train_lite_infer=2|lite_train_whole_infer=2|whole_train_whole_infer=128
pretrain_weights:https://paddledet.bj.bcebos.com/models/picodet_s_320_coco_lcnet.pdparams
trained_model_name:model_final.pdparams
train_infer_img_dir:./dataset/coco/test2017/
filename:null
##
trainer:norm_train
norm_train:tools/train.py -c configs/picodet/picodet_s_320_coco_lcnet.yml -o
pact_train:tools/train.py -c configs/picodet/picodet_s_320_coco_lcnet.yml --slim_config _template_pact -o
fpgm_train:tools/train.py -c configs/picodet/picodet_s_320_coco_lcnet.yml --slim_config _template_fpgm -o
distill_train:null
null:null
null:null
##
===========================eval_params===========================
eval:tools/eval.py -c configs/picodet/picodet_s_320_coco_lcnet.yml -o
null:null
##
===========================infer_params===========================
--output_dir:./output_inference
weights:https://paddledet.bj.bcebos.com/models/picodet_s_320_coco_lcnet.pdparams
norm_export:tools/export_model.py -c configs/picodet/picodet_s_320_coco_lcnet.yml -o
pact_export:tools/export_model.py -c configs/picodet/picodet_s_320_coco_lcnet.yml --slim_config _template_pact -o
fpgm_export:tools/export_model.py -c configs/picodet/picodet_s_320_coco_lcnet.yml --slim_config _template_fpgm -o
distill_export:null
export1:null
export2:null
kl_quant_export:tools/post_quant.py -c configs/picodet/picodet_s_320_coco_lcnet.yml --slim_config _template_kl_quant -o
##
infer_mode:norm
infer_quant:False
inference:./deploy/python/infer.py
--device:gpu|cpu
--enable_mkldnn:False
--cpu_threads:4
--batch_size:1
--use_tensorrt:null
--run_mode:paddle
--model_dir:
--image_dir:./dataset/coco/test2017/
--save_log_path:null
--run_benchmark:False
null:null
===========================infer_benchmark_params===========================
numpy_infer_input:3x320x320_2.npy
\ No newline at end of file
===========================train_params===========================
model_name:picodet_s_320_coco_lcnet
python:python3.7
gpu_list:0|0,1
use_gpu:True
auto_cast:amp
epoch:lite_train_lite_infer=1|lite_train_whole_infer=1|whole_train_whole_infer=300
save_dir:null
TrainReader.batch_size:lite_train_lite_infer=2|lite_train_whole_infer=2|whole_train_whole_infer=128
pretrain_weights:https://paddledet.bj.bcebos.com/models/picodet_s_320_coco_lcnet.pdparams
trained_model_name:model_final.pdparams
train_infer_img_dir:./dataset/coco/test2017/
amp_level:O2
##
trainer:norm_train
norm_train:tools/train.py -c configs/picodet/picodet_s_320_coco_lcnet.yml -o
pact_train:tools/train.py -c configs/picodet/picodet_s_320_coco_lcnet.yml --slim_config _template_pact -o
fpgm_train:tools/train.py -c configs/picodet/picodet_s_320_coco_lcnet.yml --slim_config _template_fpgm -o
distill_train:null
null:null
null:null
##
===========================eval_params===========================
eval:tools/eval.py -c configs/picodet/picodet_s_320_coco_lcnet.yml -o
null:null
##
===========================infer_params===========================
--output_dir:./output_inference
weights:https://paddledet.bj.bcebos.com/models/picodet_s_320_coco_lcnet.pdparams
norm_export:tools/export_model.py -c configs/picodet/picodet_s_320_coco_lcnet.yml -o
pact_export:tools/export_model.py -c configs/picodet/picodet_s_320_coco_lcnet.yml --slim_config _template_pact -o
fpgm_export:tools/export_model.py -c configs/picodet/picodet_s_320_coco_lcnet.yml --slim_config _template_fpgm -o
distill_export:null
export1:null
export2:null
kl_quant_export:tools/post_quant.py -c configs/picodet/picodet_s_320_coco_lcnet.yml --slim_config _template_kl_quant -o
##
infer_mode:norm
infer_quant:False
inference:./deploy/python/infer.py
--device:gpu|cpu
--enable_mkldnn:False
--cpu_threads:4
--batch_size:1|2
--use_tensorrt:null
--run_mode:paddle
--model_dir:
--image_dir:./dataset/coco/test2017/
--save_log_path:null
--run_benchmark:False
--trt_max_shape:1600
\ No newline at end of file
===========================cpp_infer_params===========================
model_name:picodet_xs_320_coco_lcnet
python:python3.7
filename:null
##
--output_dir:./output_inference
weights:https://paddledet.bj.bcebos.com/models/picodet_xs_320_coco_lcnet.pdparams
norm_export:tools/export_model.py -c configs/picodet/picodet_xs_320_coco_lcnet.yml -o
quant_export:tools/export_model.py -c configs/picodet/picodet_xs_320_coco_lcnet.yml --slim_config _template_pact -o
fpgm_export:tools/export_model.py -c configs/picodet/picodet_xs_320_coco_lcnet.yml --slim_config _template_fpgm -o
distill_export:null
export1:null
export2:null
kl_quant_export:tools/post_quant.py -c configs/picodet/picodet_xs_320_coco_lcnet.yml --slim_config _template_kl_quant -o
##
opencv_dir:default
infer_mode:norm
infer_quant:False
inference:./deploy/cpp/build/main
--device:gpu|cpu
--use_mkldnn:False
--cpu_threads:4
--batch_size:1|2
--use_tensorrt:null
--run_mode:paddle
--model_dir:
--image_dir:./dataset/coco/test2017/
--run_benchmark:False
null:null
\ No newline at end of file
===========================serving_infer_python_params===========================
model_name:picodet_xs_320_coco_lcnet
python:python3.7
filename:null
##
--output_dir:./output_inference
weights:https://paddledet.bj.bcebos.com/models/picodet_xs_320_coco_lcnet.pdparams
norm_export:tools/export_model.py -c configs/picodet/picodet_xs_320_coco_lcnet.yml --export_serving_model True -o
quant_export:tools/export_model.py -c configs/picodet/picodet_xs_320_coco_lcnet.yml --slim_config _template_pact --export_serving_model True -o
fpgm_export:tools/export_model.py -c configs/picodet/picodet_xs_320_coco_lcnet.yml --slim_config _template_fpgm --export_serving_model True -o
distill_export:null
export1:null
export2:null
kl_quant_export:tools/post_quant.py -c configs/picodet/picodet_xs_320_coco_lcnet.yml --slim_config _template_kl_quant --export_serving_model True -o
##
infer_mode:norm
infer_quant:False
web_service:deploy/serving/python/web_service.py --config=deploy/serving/python/config.yml
--model_dir:null
--opt:cpu:op.ppdet.local_service_conf.device_type=0|gpu:op.ppdet.local_service_conf.device_type=1
null:null
http_client:deploy/serving/python/pipeline_http_client.py
--image_file:./demo/000000014439.jpg
null:null
\ No newline at end of file
===========================train_params===========================
model_name:picodet_xs_320_coco_lcnet
python:python3.7
gpu_list:0|0,1
use_gpu:True
auto_cast:null
epoch:lite_train_lite_infer=1|lite_train_whole_infer=1|whole_train_whole_infer=300
save_dir:null
TrainReader.batch_size:lite_train_lite_infer=2|lite_train_whole_infer=2|whole_train_whole_infer=128
pretrain_weights:https://paddledet.bj.bcebos.com/models/picodet_xs_320_coco_lcnet.pdparams
trained_model_name:model_final.pdparams
train_infer_img_dir:./dataset/coco/test2017/
filename:null
##
trainer:norm_train
norm_train:tools/train.py -c configs/picodet/picodet_xs_320_coco_lcnet.yml -o
pact_train:tools/train.py -c configs/picodet/picodet_xs_320_coco_lcnet.yml --slim_config _template_pact -o
fpgm_train:tools/train.py -c configs/picodet/picodet_xs_320_coco_lcnet.yml --slim_config _template_fpgm -o
distill_train:null
null:null
null:null
##
===========================eval_params===========================
eval:tools/eval.py -c configs/picodet/picodet_xs_320_coco_lcnet.yml -o
null:null
##
===========================infer_params===========================
--output_dir:./output_inference
weights:https://paddledet.bj.bcebos.com/models/picodet_xs_320_coco_lcnet.pdparams
norm_export:tools/export_model.py -c configs/picodet/picodet_xs_320_coco_lcnet.yml -o
pact_export:tools/export_model.py -c configs/picodet/picodet_xs_320_coco_lcnet.yml --slim_config _template_pact -o
fpgm_export:tools/export_model.py -c configs/picodet/picodet_xs_320_coco_lcnet.yml --slim_config _template_fpgm -o
distill_export:null
export1:null
export2:null
kl_quant_export:tools/post_quant.py -c configs/picodet/picodet_xs_320_coco_lcnet.yml --slim_config _template_kl_quant -o
##
infer_mode:norm
infer_quant:False
inference:./deploy/python/infer.py
--device:gpu|cpu
--enable_mkldnn:False
--cpu_threads:4
--batch_size:1
--use_tensorrt:null
--run_mode:paddle
--model_dir:
--image_dir:./dataset/coco/test2017/
--save_log_path:null
--run_benchmark:False
null:null
===========================infer_benchmark_params===========================
numpy_infer_input:3x320x320_2.npy
\ No newline at end of file
===========================train_params===========================
model_name:picodet_xs_320_coco_lcnet
python:python3.7
gpu_list:0|0,1
use_gpu:True
auto_cast:amp
epoch:lite_train_lite_infer=1|lite_train_whole_infer=1|whole_train_whole_infer=300
save_dir:null
TrainReader.batch_size:lite_train_lite_infer=2|lite_train_whole_infer=2|whole_train_whole_infer=128
pretrain_weights:https://paddledet.bj.bcebos.com/models/picodet_xs_320_coco_lcnet.pdparams
trained_model_name:model_final.pdparams
train_infer_img_dir:./dataset/coco/test2017/
amp_level:O2
##
trainer:norm_train
norm_train:tools/train.py -c configs/picodet/picodet_xs_320_coco_lcnet.yml -o
pact_train:tools/train.py -c configs/picodet/picodet_xs_320_coco_lcnet.yml --slim_config _template_pact -o
fpgm_train:tools/train.py -c configs/picodet/picodet_xs_320_coco_lcnet.yml --slim_config _template_fpgm -o
distill_train:null
null:null
null:null
##
===========================eval_params===========================
eval:tools/eval.py -c configs/picodet/picodet_xs_320_coco_lcnet.yml -o
null:null
##
===========================infer_params===========================
--output_dir:./output_inference
weights:https://paddledet.bj.bcebos.com/models/picodet_xs_320_coco_lcnet.pdparams
norm_export:tools/export_model.py -c configs/picodet/picodet_xs_320_coco_lcnet.yml -o
pact_export:tools/export_model.py -c configs/picodet/picodet_xs_320_coco_lcnet.yml --slim_config _template_pact -o
fpgm_export:tools/export_model.py -c configs/picodet/picodet_xs_320_coco_lcnet.yml --slim_config _template_fpgm -o
distill_export:null
export1:null
export2:null
kl_quant_export:tools/post_quant.py -c configs/picodet/picodet_xs_320_coco_lcnet.yml --slim_config _template_kl_quant -o
##
infer_mode:norm
infer_quant:False
inference:./deploy/python/infer.py
--device:gpu|cpu
--enable_mkldnn:False
--cpu_threads:4
--batch_size:1|2
--use_tensorrt:null
--run_mode:paddle
--model_dir:
--image_dir:./dataset/coco/test2017/
--save_log_path:null
--run_benchmark:False
--trt_max_shape:1600
\ No newline at end of file
...@@ -77,6 +77,7 @@ function func_serving_inference(){ ...@@ -77,6 +77,7 @@ function func_serving_inference(){
status_check $last_status "${http_client_cmd}" "${status_log}" "${model_name}" status_check $last_status "${http_client_cmd}" "${status_log}" "${model_name}"
eval "cat ${_save_log_path}" eval "cat ${_save_log_path}"
ps ux | grep -E 'web_service' | awk '{print $2}' | xargs kill -s 9 ps ux | grep -E 'web_service' | awk '{print $2}' | xargs kill -s 9
sleep 2s
done done
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册