From 5ce0522869ea7eda60ee42e94eaf936d5e252c49 Mon Sep 17 00:00:00 2001 From: Juha Reunanen Date: Mon, 28 Oct 2019 17:34:08 +0200 Subject: [PATCH] Automatically skip images with no detections --- examples/dnn_instance_segmentation_ex.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/dnn_instance_segmentation_ex.cpp b/examples/dnn_instance_segmentation_ex.cpp index 8e0d78219..9b7d510d1 100644 --- a/examples/dnn_instance_segmentation_ex.cpp +++ b/examples/dnn_instance_segmentation_ex.cpp @@ -127,8 +127,11 @@ int main(int argc, char** argv) try // Show the input image on the left, and the predicted RGB labels on the right. win.set_image(join_rows(input_image, rgb_label_image)); - cout << file.name() << " - hit enter to process the next image"; - cin.get(); + if (!instances.empty()) + { + cout << file.name() << " - hit enter to process the next image"; + cin.get(); + } } } catch(std::exception& e)