ONNX
Ryan Lee commited on
Commit
58ff415
·
1 Parent(s): d3f7221

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 (2) hide show
  1. demo.cpp +2 -10
  2. demo.py +1 -1
demo.cpp CHANGED
@@ -61,14 +61,6 @@ public:
61
  this->generateAnchors();
62
  }
63
 
64
- void setBackendAndTarget(dnn::Backend bId, dnn::Target tId)
65
- {
66
- this->backendId = bId;
67
- this->targetId = tId;
68
- this->net.setPreferableBackend(this->backendId);
69
- this->net.setPreferableTarget(this->targetId);
70
- }
71
-
72
  Mat preprocess(Mat img)
73
  {
74
  Mat blob;
@@ -137,7 +129,7 @@ public:
137
  boxesXYXY[r].height = boxes_xyxy.at<float>(r, 3);
138
  }
139
 
140
- vector< int > keep;
141
  NMSBoxesBatched(boxesXYXY, maxScores, maxScoreIdx, this->confThreshold, this->nmsThreshold, keep);
142
  Mat candidates(int(keep.size()), 6, CV_32FC1);
143
  int row = 0;
@@ -282,7 +274,7 @@ int main(int argc, char** argv)
282
  else
283
  cap.open(0);
284
  if (!cap.isOpened())
285
- CV_Error(Error::StsError, "Cannot opend video or file");
286
  Mat frame, inputBlob;
287
  double letterboxScale;
288
 
 
61
  this->generateAnchors();
62
  }
63
 
 
 
 
 
 
 
 
 
64
  Mat preprocess(Mat img)
65
  {
66
  Mat blob;
 
129
  boxesXYXY[r].height = boxes_xyxy.at<float>(r, 3);
130
  }
131
 
132
+ vector<int> keep;
133
  NMSBoxesBatched(boxesXYXY, maxScores, maxScoreIdx, this->confThreshold, this->nmsThreshold, keep);
134
  Mat candidates(int(keep.size()), 6, CV_32FC1);
135
  int row = 0;
 
274
  else
275
  cap.open(0);
276
  if (!cap.isOpened())
277
+ CV_Error(Error::StsError, "Cannot open video or file");
278
  Mat frame, inputBlob;
279
  double letterboxScale;
280
 
demo.py CHANGED
@@ -120,7 +120,7 @@ if __name__=='__main__':
120
  img = vis(preds, image, letterbox_scale)
121
 
122
  if args.save:
123
- print('Resutls saved to result.jpg\n')
124
  cv.imwrite('result.jpg', img)
125
 
126
  if args.vis:
 
120
  img = vis(preds, image, letterbox_scale)
121
 
122
  if args.save:
123
+ print('Results saved to result.jpg\n')
124
  cv.imwrite('result.jpg', img)
125
 
126
  if args.vis: