From afb315a3829e1e58827341f93b6a39dc621ed47e Mon Sep 17 00:00:00 2001 From: cc <52520497+juncaipeng@users.noreply.github.com> Date: Mon, 16 Mar 2020 09:45:43 +0800 Subject: [PATCH] Update mask_demo for the classification only has one output, test=develop (#3179) --- lite/demo/cxx/mask_detection/mask_detection.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lite/demo/cxx/mask_detection/mask_detection.cc b/lite/demo/cxx/mask_detection/mask_detection.cc index b2c8a68c63..67014aef9d 100644 --- a/lite/demo/cxx/mask_detection/mask_detection.cc +++ b/lite/demo/cxx/mask_detection/mask_detection.cc @@ -143,6 +143,7 @@ void RunModel(std::string det_model_file, // Create Predictor For Detction Model std::shared_ptr predictor = CreatePaddlePredictor(config); + std::cout << "Load detecion model succeed." << std::endl; // Get Input Tensor std::unique_ptr input_tensor0(std::move(predictor->GetInput(0))); @@ -163,6 +164,7 @@ void RunModel(std::string det_model_file, auto* outptr = output_tensor0->data(); auto shape_out = output_tensor0->shape(); int64_t out_len = ShapeProduction(shape_out); + std::cout << "Detecting face succeed." << std::endl; // Filter Out Detection Box float detect_threshold = 0.7; @@ -189,6 +191,7 @@ void RunModel(std::string det_model_file, // Create Predictor For Classification Model predictor = CreatePaddlePredictor(config); + std::cout << "Load classification model succeed." << std::endl; // Get Input Tensor std::unique_ptr input_tensor1(std::move(predictor->GetInput(0))); @@ -221,7 +224,7 @@ void RunModel(std::string det_model_file, // Get Output Tensor std::unique_ptr output_tensor1( - std::move(predictor->GetOutput(1))); + std::move(predictor->GetOutput(0))); auto* outptr = output_tensor1->data(); float prob = outptr[1]; -- GitLab