ONNX
Ryan Lee commited on
Commit
d3f7221
·
1 Parent(s): 9af8d5d

Add YOLOX C++ demo save functionality (#235)

Browse files

* Add saving functionality to C++ demo

* Updated saving to image inputs only

* Removed unnecessary bool

Files changed (1) hide show
  1. demo.cpp +4 -0
demo.cpp CHANGED
@@ -306,6 +306,10 @@ int main(int argc, char** argv)
306
  tm.stop();
307
  cout << "Inference time: " << tm.getTimeMilli() << " ms\n";
308
  Mat img = visualize(predictions, frame, letterboxScale, tm.getFPS());
 
 
 
 
309
  if (vis)
310
  {
311
  imshow(kWinName, img);
 
306
  tm.stop();
307
  cout << "Inference time: " << tm.getTimeMilli() << " ms\n";
308
  Mat img = visualize(predictions, frame, letterboxScale, tm.getFPS());
309
+ if (save && parser.has("input"))
310
+ {
311
+ imwrite("result.jpg", img);
312
+ }
313
  if (vis)
314
  {
315
  imshow(kWinName, img);