From 44a6e8cca59b5a38bbd5b61424da6850671dde8d Mon Sep 17 00:00:00 2001 From: Biparnak Roy <54219771+biparnakroy@users.noreply.github.com> Date: Sat, 18 Jul 2020 05:17:07 +0530 Subject: [PATCH] added save flag --- demo/demo/demo.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/demo/demo/demo.cpp b/demo/demo/demo.cpp index 84378e5..58c767b 100644 --- a/demo/demo/demo.cpp +++ b/demo/demo/demo.cpp @@ -42,15 +42,15 @@ int main(int argc, char *argv[]) bool show = true; if (argc > 6) show = atoi(argv[6]); - int port = 0; if (argc > 7) - port = atoi(argv[7]); + SAVE_RESULT = atoi(argv[7]); + int port = 0; + if (argc > 8) + port = atoi(argv[8]); if (n_batch < 1 || n_batch > 64) FatalError("Batch dim not supported"); - if (!show) - SAVE_RESULT = true; tk::dnn::Yolo3Detection yolo; tk::dnn::CenternetDetection cnet; @@ -129,7 +129,6 @@ int main(int argc, char *argv[]) for (int bi = 0; bi < n_batch; ++bi) { cv::imshow("detection", batch_frame[bi]); - } } if (cv::waitKey(1) == 27) @@ -138,7 +137,7 @@ int main(int argc, char *argv[]) } if (n_batch == 1 && SAVE_RESULT) resultVideo << frame; - + if (port > 0) { send_mjpeg(batch_frame[0], port, 400000, 40);