Browse Source

!7105 set num threads for opencv

Merge pull request !7105 from yanghaitao/yht_set_num_threads_for_opencv
tags/v1.1.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
41a0471288
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      mindspore/ccsrc/minddata/dataset/kernels/image/image_utils.cc

+ 2
- 0
mindspore/ccsrc/minddata/dataset/kernels/image/image_utils.cc View File

@@ -97,6 +97,8 @@ Status Resize(const std::shared_ptr<Tensor> &input, std::shared_ptr<Tensor> *out
if (input_cv->Rank() != 3 && input_cv->Rank() != 2) {
RETURN_STATUS_UNEXPECTED("Input Tensor is not in shape of <H,W,C> or <H,W>");
}
// OpenCv lanuch too many threads.
cv::setNumThreads(0);
cv::Mat in_image = input_cv->mat();
// resize image too large or too small
if (output_height == 0 || output_height > in_image.rows * 1000 || output_width == 0 ||


Loading…
Cancel
Save