Merge pull request #20155 from dbudniko:dbudniko/G-API_mtcnn_demo_queue_option

Add streaming queue capacity option choice to MTCNN G-API sample

* Add streaming queue capacity option

* trying to fix mac build

* rename face detection sample
This commit is contained in:
Dmitry Budnikov 2021-05-27 18:50:13 +03:00 committed by GitHub
parent 76e81dfbb0
commit cf96a9fd27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,6 +33,7 @@ const std::string keys =
"{ thrr | 0.7 | MTCNN R confidence threshold}"
"{ thro | 0.7 | MTCNN O confidence threshold}"
"{ half_scale | false | MTCNN P use half scale pyramid}"
"{ queue_capacity | 1 | Streaming executor queue capacity. Calculated automaticaly if 0}"
;
namespace {
@ -588,6 +589,7 @@ int main(int argc, char* argv[]) {
const auto target_dev_o = cmd.get<std::string>("mtcnnod");
const auto conf_thresh_o = cmd.get<float>("thro");
const auto use_half_scale = cmd.get<bool>("half_scale");
const auto streaming_queue_capacity = cmd.get<unsigned int>("queue_capacity");
std::vector<cv::Size> level_size;
std::vector<double> scales;
@ -708,7 +710,10 @@ int main(int argc, char* argv[]) {
, custom::OCVSwapFaces
, custom::OCVTranspose
>();
auto pipeline_mtcnn = graph_mtcnn.compileStreaming(cv::compile_args(networks_mtcnn, kernels_mtcnn));
auto mtcnn_args = cv::compile_args(networks_mtcnn, kernels_mtcnn);
if (streaming_queue_capacity != 0)
mtcnn_args += cv::compile_args(cv::gapi::streaming::queue_capacity{ streaming_queue_capacity });
auto pipeline_mtcnn = graph_mtcnn.compileStreaming(std::move(mtcnn_args));
std::cout << "Reading " << input_file_name << std::endl;
// Input stream