Skip to content

Commit

Permalink
fix wrong input mat type (open-mmlab#362)
Browse files Browse the repository at this point in the history
* fix wrong input mat type

* fix lint
  • Loading branch information
irexyc authored Apr 15, 2022
1 parent ade8e02 commit fdbd3d1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions csrc/apis/c/classifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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}});
}

Expand Down
4 changes: 2 additions & 2 deletions csrc/apis/c/detector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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}});
}

Expand Down
4 changes: 2 additions & 2 deletions csrc/apis/c/pose_detector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions csrc/apis/c/segmentor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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}});
}

Expand Down
4 changes: 2 additions & 2 deletions csrc/apis/c/text_recognizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ int mmdeploy_text_recognizer_apply_bbox(mm_handle_t handle, const mm_mat_t *imag
}

result_index[i] = static_cast<int>(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}});
}

Expand Down

0 comments on commit fdbd3d1

Please sign in to comment.