| @@ -51,7 +51,11 @@ uint8_t DataType::AsCVType() const { | |||||
| } | } | ||||
| if (res == kCVInvalidType) { | if (res == kCVInvalidType) { | ||||
| std::string err_msg = "Cannot convert [" + std::string(kTypeInfo[type_].name_) + "] to OpenCV type."; | |||||
| std::string type_name = "unknown"; | |||||
| if (type_ < DataType::NUM_OF_TYPES) { | |||||
| type_name = std::string(kTypeInfo[type_].name_); | |||||
| } | |||||
| std::string err_msg = "Cannot convert [" + type_name + "] to OpenCV type."; | |||||
| err_msg += " Currently unsupported data type: [uint32, int64, uint64, string]"; | err_msg += " Currently unsupported data type: [uint32, int64, uint64, string]"; | ||||
| MS_LOG(ERROR) << err_msg; | MS_LOG(ERROR) << err_msg; | ||||
| } | } | ||||
| @@ -18,6 +18,7 @@ | |||||
| #include <vector> | #include <vector> | ||||
| #include <utility> | #include <utility> | ||||
| #include <set> | #include <set> | ||||
| #include <string> | |||||
| #include "minddata/dataset/engine/datasetops/map_op/cpu_map_job.h" | #include "minddata/dataset/engine/datasetops/map_op/cpu_map_job.h" | ||||
| namespace mindspore { | namespace mindspore { | ||||
| @@ -24,7 +24,7 @@ namespace mindspore { | |||||
| namespace dataset { | namespace dataset { | ||||
| class MDChannelInfo { | class MDChannelInfo { | ||||
| public: | public: | ||||
| explicit MDChannelInfo(std::string channel_name) : channel_name_(channel_name) {} | |||||
| explicit MDChannelInfo(std::string channel_name) : channel_name_(channel_name), preprocess_batch_(0) {} | |||||
| ~MDChannelInfo() = default; | ~MDChannelInfo() = default; | ||||
| @@ -20,12 +20,12 @@ import os | |||||
| import numpy as np | import numpy as np | ||||
| from numpy import random | from numpy import random | ||||
| import cv2 | |||||
| import mmcv | import mmcv | ||||
| import mindspore.dataset as de | import mindspore.dataset as de | ||||
| import mindspore.dataset.vision.c_transforms as C | import mindspore.dataset.vision.c_transforms as C | ||||
| from mindspore.mindrecord import FileWriter | from mindspore.mindrecord import FileWriter | ||||
| from src.config import config | from src.config import config | ||||
| import cv2 | |||||
| def bbox_overlaps(bboxes1, bboxes2, mode='iou'): | def bbox_overlaps(bboxes1, bboxes2, mode='iou'): | ||||