Skip to content

Commit 2a36cf8

Browse files
Apply suggestions
Co-authored-by: Zlobin Vladimir <[email protected]>
1 parent de7db0d commit 2a36cf8

File tree

5 files changed

+7
-14
lines changed

5 files changed

+7
-14
lines changed

demos/common/cpp/models/include/models/detection_model_yolov3_onnx.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include <openvino/openvino.hpp>
2323

2424
#include "models/detection_model.h"
25-
#include "utils/image_utils.h"
2625

2726
class ModelYoloV3ONNX: public DetectionModel {
2827
public:

demos/common/cpp/models/include/models/detection_model_yolox.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,13 @@
1515
*/
1616

1717
#pragma once
18-
#include <stddef.h>
19-
#include <stdint.h>
20-
21-
#include <map>
2218
#include <memory>
2319
#include <string>
20+
#include <vector>
2421

25-
#include <openvino/op/region_yolo.hpp>
2622
#include <openvino/openvino.hpp>
2723

2824
#include "models/detection_model.h"
29-
#include "utils/image_utils.h"
30-
#include "utils/nms.hpp"
3125

3226
class ModelYoloX: public DetectionModel {
3327
public:

demos/common/cpp/models/src/detection_model_yolov3_onnx.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ void ModelYoloV3ONNX::prepareInputsOutputs(std::shared_ptr<ov::Model>& model) {
7676
const ov::Layout& infoLayout = getInputLayout(inputs.at(1));
7777

7878
if (infoShape.size() != 2 && infoShape[ov::layout::channels_idx(infoLayout)] != 2) {
79-
throw std::logic_error("Expected 2D image info input with 2 channels");
80-
}
79+
throw std::logic_error("Expected 2D image info input with 2 channels");
80+
}
8181

8282
ppp.input(infoInputName).tensor().set_element_type(ov::element::i32);
8383

@@ -96,7 +96,7 @@ void ModelYoloV3ONNX::prepareInputsOutputs(std::shared_ptr<ov::Model>& model) {
9696
for (auto& output : outputs) {
9797
const ov::Shape& currentShape = output.get_partial_shape().get_max_shape();
9898
std::string currentName = output.get_any_name();
99-
if (currentShape[currentShape.size() - 1] == 3) {
99+
if (currentShape.back() == 3) {
100100
indicesOutputName = currentName;
101101
ppp.output(currentName).tensor().set_element_type(ov::element::i32);
102102
} else if (currentShape[2] == 4) {
@@ -106,7 +106,8 @@ void ModelYoloV3ONNX::prepareInputsOutputs(std::shared_ptr<ov::Model>& model) {
106106
scoresOutputName = currentName;
107107
ppp.output(currentName).tensor().set_element_type(ov::element::f32);
108108
} else {
109-
throw std::logic_error("Expected shapes [:,:,4], [:,numClasses,:] and [:,3] for outputs");
109+
throw std::logic_error("Expected shapes [:,:,4], [:,"
110+
+ std::to_string(numberOfClasses) + ",:] and [:,3] for outputs");
110111
}
111112
outputsNames.push_back(currentName);
112113
}

demos/common/cpp/models/src/detection_model_yolox.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ void ModelYoloX::prepareGridsAndStrides() {
102102
for (size_t size_index = 0; size_index < hsizes.size(); ++size_index) {
103103
for (size_t h_index = 0; h_index < hsizes[size_index]; ++h_index) {
104104
for (size_t w_index = 0; w_index < wsizes[size_index]; ++w_index) {
105-
grids.push_back({w_index, h_index});
105+
grids.emplace_back(w_index, h_index);
106106
expandedStrides.push_back(strides[size_index]);
107107
}
108108
}

demos/common/cpp/models/src/image_model.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ std::shared_ptr<InternalModelData> ImageModel::preprocess(const InputData& input
5252
}
5353
img = resizeImageExt(img, width, height, resizeMode, interpolationMode);
5454
}
55-
5655
request.set_tensor(inputsNames[0], wrapMat2Tensor(img));
5756
return std::make_shared<InternalImageModelData>(origImg.cols, origImg.rows);
5857
}

0 commit comments

Comments
 (0)