Ryan Lee commited on
Commit
afb2ec4
·
1 Parent(s): 9a634ac

Fix spelling, spacing, and unused variables (#236)

Browse files

* Fix spelling, spacing, and unused variables

* Fixed typo in 3 more models

* Added open back

* Remove setBackendAndTarget functions from C++ demos, which are unused functionality.

Files changed (1) hide show
  1. demo.cpp +2 -18
demo.cpp CHANGED
@@ -45,14 +45,6 @@ public:
45
  this->anchors = getMediapipeAnchor();
46
  }
47
 
48
- void setBackendAndTarget(dnn::Backend bId, dnn::Target tId)
49
- {
50
- this->backendId = bId;
51
- this->targetId = tId;
52
- this->net.setPreferableBackend(this->backendId);
53
- this->net.setPreferableTarget(this->targetId);
54
- }
55
-
56
  pair<Mat, Size> preprocess(Mat img)
57
  {
58
  Mat blob;
@@ -124,7 +116,7 @@ public:
124
  {
125
  rotBoxes[i] = Rect2d(Point2d(boxes.at<float>(i, 0), boxes.at<float>(i, 1)), Point2d(boxes.at<float>(i, 2), boxes.at<float>(i, 3)));
126
  }
127
- vector< int > keep;
128
  NMSBoxes(rotBoxes, score, this->scoreThreshold, this->nmsThreshold, keep, 1.0f, this->topK);
129
  if (keep.size() == 0)
130
  return Mat();
@@ -179,14 +171,6 @@ public:
179
  this->personBoxEnlargeFactor = 1.25;
180
  }
181
 
182
- void setBackendAndTarget(dnn::Backend bId, dnn::Target tId)
183
- {
184
- this->backendId = bId;
185
- this->targetId = tId;
186
- this->net.setPreferableBackend(this->backendId);
187
- this->net.setPreferableTarget(this->targetId);
188
- }
189
-
190
  tuple<Mat, Mat, float, Mat, Size> preprocess(Mat image, Mat person)
191
  {
192
  /***
@@ -567,7 +551,7 @@ int main(int argc, char** argv)
567
  MPPose poseEstimator(model, confThreshold, backendTargetPairs[backendTargetid].first, backendTargetPairs[backendTargetid].second);
568
  //! [Open a video file or an image file or a camera stream]
569
  if (!cap.isOpened())
570
- CV_Error(Error::StsError, "Cannot opend video or file");
571
 
572
  static const std::string kWinName = "MPPose Demo";
573
  while (waitKey(1) < 0)
 
45
  this->anchors = getMediapipeAnchor();
46
  }
47
 
 
 
 
 
 
 
 
 
48
  pair<Mat, Size> preprocess(Mat img)
49
  {
50
  Mat blob;
 
116
  {
117
  rotBoxes[i] = Rect2d(Point2d(boxes.at<float>(i, 0), boxes.at<float>(i, 1)), Point2d(boxes.at<float>(i, 2), boxes.at<float>(i, 3)));
118
  }
119
+ vector<int> keep;
120
  NMSBoxes(rotBoxes, score, this->scoreThreshold, this->nmsThreshold, keep, 1.0f, this->topK);
121
  if (keep.size() == 0)
122
  return Mat();
 
171
  this->personBoxEnlargeFactor = 1.25;
172
  }
173
 
 
 
 
 
 
 
 
 
174
  tuple<Mat, Mat, float, Mat, Size> preprocess(Mat image, Mat person)
175
  {
176
  /***
 
551
  MPPose poseEstimator(model, confThreshold, backendTargetPairs[backendTargetid].first, backendTargetPairs[backendTargetid].second);
552
  //! [Open a video file or an image file or a camera stream]
553
  if (!cap.isOpened())
554
+ CV_Error(Error::StsError, "Cannot open video or file");
555
 
556
  static const std::string kWinName = "MPPose Demo";
557
  while (waitKey(1) < 0)