We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 834ccd0 commit 19f7338Copy full SHA for 19f7338
model.cpp
@@ -105,7 +105,17 @@ bool SmartModel::run(const QString &image_file, QVector<box_t> &boxes) {
105
cv::resize(img, img, {(int)round(img.cols * scale), (int)round(img.rows * scale)});
106
cv::Mat input(640, 640, CV_8UC3, 127);
107
img.copyTo(input({0, 0, img.cols, img.rows}));
108
- auto x = cv::dnn::blobFromImage(input);
+
109
+ // TODO: 为了兼容int8模型和fp32模型的不同输入格式而加的临时操作
110
+ // 后续会统一两个模型的输入格式
111
+ cv::Mat x;
112
+ if(mode == "openvino-int8-cpu") {
113
+ x = cv::dnn::blobFromImage(input);
114
+ } else {
115
+ cv::cvtColor(input, input, cv::COLOR_BGR2RGB);
116
+ x = cv::dnn::blobFromImage(input) / 255;
117
+ }
118
119
net.setInput(x);
120
auto y = net.forward();
121
QVector<box_t> before_nms;
0 commit comments