From fdbd3d1a52c32b59e5593ad61d5bda265d6f9eae Mon Sep 17 00:00:00 2001 From: Chen Xin Date: Fri, 15 Apr 2022 12:30:55 +0800 Subject: [PATCH] fix wrong input mat type (#362) * fix wrong input mat type * fix lint --- csrc/apis/c/classifier.cpp | 4 ++-- csrc/apis/c/detector.cpp | 4 ++-- csrc/apis/c/pose_detector.cpp | 4 ++-- csrc/apis/c/segmentor.cpp | 4 ++-- csrc/apis/c/text_recognizer.cpp | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/csrc/apis/c/classifier.cpp b/csrc/apis/c/classifier.cpp index ecdfaafc87..10b8708df1 100644 --- a/csrc/apis/c/classifier.cpp +++ b/csrc/apis/c/classifier.cpp @@ -86,8 +86,8 @@ int mmdeploy_classifier_apply(mm_handle_t handle, const mm_mat_t* mats, int mat_ Value input{Value::kArray}; for (int i = 0; i < mat_count; ++i) { - mmdeploy::Mat _mat{mats[i].height, mats[i].width, PixelFormat(mats[i].format), - DataType(mats->type), mats[i].data, Device{"cpu"}}; + mmdeploy::Mat _mat{mats[i].height, mats[i].width, PixelFormat(mats[i].format), + DataType(mats[i].type), mats[i].data, Device{"cpu"}}; input.front().push_back({{"ori_img", _mat}}); } diff --git a/csrc/apis/c/detector.cpp b/csrc/apis/c/detector.cpp index 4dbb573f96..375c6e07a2 100644 --- a/csrc/apis/c/detector.cpp +++ b/csrc/apis/c/detector.cpp @@ -85,8 +85,8 @@ int mmdeploy_detector_apply(mm_handle_t handle, const mm_mat_t* mats, int mat_co Value input{Value::kArray}; for (int i = 0; i < mat_count; ++i) { - mmdeploy::Mat _mat{mats[i].height, mats[i].width, PixelFormat(mats[i].format), - DataType(mats->type), mats[i].data, Device{"cpu"}}; + mmdeploy::Mat _mat{mats[i].height, mats[i].width, PixelFormat(mats[i].format), + DataType(mats[i].type), mats[i].data, Device{"cpu"}}; input.front().push_back({{"ori_img", _mat}}); } diff --git a/csrc/apis/c/pose_detector.cpp b/csrc/apis/c/pose_detector.cpp index 6c5ef426ef..acc148ee1b 100644 --- a/csrc/apis/c/pose_detector.cpp +++ b/csrc/apis/c/pose_detector.cpp @@ -104,8 +104,8 @@ int mmdeploy_pose_detector_apply_bbox(mm_handle_t handle, const mm_mat_t* mats, Value input{Value::kArray}; auto result_count = 0; for (int i = 0; i < mat_count; ++i) { - mmdeploy::Mat _mat{mats[i].height, mats[i].width, PixelFormat(mats[i].format), - DataType(mats->type), mats[i].data, Device{"cpu"}}; + mmdeploy::Mat _mat{mats[i].height, mats[i].width, PixelFormat(mats[i].format), + DataType(mats[i].type), mats[i].data, Device{"cpu"}}; Value img_with_boxes; if (bboxes && bbox_count) { diff --git a/csrc/apis/c/segmentor.cpp b/csrc/apis/c/segmentor.cpp index bcdca722a7..1f6ba9750c 100644 --- a/csrc/apis/c/segmentor.cpp +++ b/csrc/apis/c/segmentor.cpp @@ -84,8 +84,8 @@ int mmdeploy_segmentor_apply(mm_handle_t handle, const mm_mat_t* mats, int mat_c Value input{Value::kArray}; for (int i = 0; i < mat_count; ++i) { - mmdeploy::Mat _mat{mats[i].height, mats[i].width, PixelFormat(mats[i].format), - DataType(mats->type), mats[i].data, Device{"cpu"}}; + mmdeploy::Mat _mat{mats[i].height, mats[i].width, PixelFormat(mats[i].format), + DataType(mats[i].type), mats[i].data, Device{"cpu"}}; input.front().push_back({{"ori_img", _mat}}); } diff --git a/csrc/apis/c/text_recognizer.cpp b/csrc/apis/c/text_recognizer.cpp index 975a34b2e5..441a7c9423 100644 --- a/csrc/apis/c/text_recognizer.cpp +++ b/csrc/apis/c/text_recognizer.cpp @@ -142,8 +142,8 @@ int mmdeploy_text_recognizer_apply_bbox(mm_handle_t handle, const mm_mat_t *imag } result_index[i] = static_cast(input_images.size()); - mmdeploy::Mat _mat{images[i].height, images[i].width, PixelFormat(images[i].format), - DataType(images->type), images[i].data, Device{"cpu"}}; + mmdeploy::Mat _mat{images[i].height, images[i].width, PixelFormat(images[i].format), + DataType(images[i].type), images[i].data, Device{"cpu"}}; input_images.push_back({{"ori_img", _mat}}); }