Skip to content

Commit 8b04078

Browse files
ivikhrevWovchena
andauthored
Apply suggestions from code review
Co-authored-by: Zlobin Vladimir <[email protected]>
1 parent 587a203 commit 8b04078

File tree

2 files changed

+10
-16
lines changed

2 files changed

+10
-16
lines changed

demos/classification_benchmark_demo/cpp/grid_mat.hpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,14 @@ class GridMat {
101101
cv::Scalar textColor;
102102
switch (predictionResul) {
103103
case PredictionResult::Correct:
104-
textColor = cv::Scalar(75, 255, 75);
105-
break; // green
104+
textColor = cv::Scalar(75, 255, 75); // green
105+
break;
106106
case PredictionResult::Incorrect:
107-
textColor = cv::Scalar(50, 50, 255);
108-
break; // red
107+
textColor = cv::Scalar(50, 50, 255); // red
108+
break;
109109
case PredictionResult::Unknown:
110-
textColor = cv::Scalar(200, 10, 10);
111-
break; // blue
110+
textColor = cv::Scalar(200, 10, 10); // blue
111+
break;
112112
default:
113113
throw std::runtime_error("Undefined type of prediction result");
114114
}
@@ -150,6 +150,4 @@ class GridMat {
150150
cv::Size testMessageSize;
151151
};
152152

153-
// defenition of the static member needed to remove clang build error
154-
// https://stackoverflow.com/questions/8016780/undefined-reference-to-static-constexpr-char
155153
constexpr const char GridMat::testMessage[];

demos/common/cpp/models/src/detection_model_faceboxes.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -225,22 +225,18 @@ std::vector<ModelFaceBoxes::Anchor> filterBoxes(const ov::Tensor& boxesTensor,
225225
}
226226

227227
std::unique_ptr<ResultBase> ModelFaceBoxes::postprocess(InferenceResult& infResult) {
228-
// --------------------------- Filter scores and get valid indices for bounding
229-
// boxes----------------------------------
228+
// Filter scores and get valid indices for bounding boxes
230229
const auto scoresTensor = infResult.outputsData[outputsNames[1]];
231230
const auto scores = filterScores(scoresTensor, confidenceThreshold);
232231

233-
// --------------------------- Filter bounding boxes on indices
234-
// -------------------------------------------------------
232+
// Filter bounding boxes on indices
235233
auto boxesTensor = infResult.outputsData[outputsNames[0]];
236234
std::vector<Anchor> boxes = filterBoxes(boxesTensor, anchors, scores.first, variance);
237235

238-
// --------------------------- Apply Non-maximum Suppression
239-
// ----------------------------------------------------------
236+
// Apply Non-maximum Suppression
240237
const std::vector<int> keep = nms(boxes, scores.second, boxIOUThreshold);
241238

242-
// --------------------------- Create detection result objects
243-
// --------------------------------------------------------
239+
// Create detection result objects
244240
DetectionResult* result = new DetectionResult(infResult.frameId, infResult.metaData);
245241
const auto imgWidth = infResult.internalModelData->asRef<InternalImageModelData>().inputImgWidth;
246242
const auto imgHeight = infResult.internalModelData->asRef<InternalImageModelData>().inputImgHeight;

0 commit comments

Comments
 (0)