From 102f303c858f7cd1441f96c61d72ee276ad96be6 Mon Sep 17 00:00:00 2001 From: Zeyu Chen Date: Mon, 24 Feb 2020 23:14:50 +0800 Subject: [PATCH] rename FaceResult score to confidence --- demo/mask_detection/README.md | 2 +- demo/mask_detection/cpp/main.cc | 2 +- demo/mask_detection/cpp/mask_detector.cc | 4 ++-- demo/mask_detection/cpp/mask_detector.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/demo/mask_detection/README.md b/demo/mask_detection/README.md index e6c82452..ad8aa920 100644 --- a/demo/mask_detection/README.md +++ b/demo/mask_detection/README.md @@ -1,4 +1,4 @@ -# 百度PaddlePaddle实现口罩检测应用 +# PaddleHub实现口罩佩戴检测应用 ## 0 项目介绍 ![image](https://note.youdao.com/yws/public/resource/b0a4695bc7d58aed3b1ff797409aee1e/BB6BC87A45D146CEBA7BF237B5383835?ynotemdtimestamp=1582271320612) diff --git a/demo/mask_detection/cpp/main.cc b/demo/mask_detection/cpp/main.cc index d673001d..5a28b591 100644 --- a/demo/mask_detection/cpp/main.cc +++ b/demo/mask_detection/cpp/main.cc @@ -68,7 +68,7 @@ int main(int argc, char* argv[]) { item.rect[2], item.rect[3], item.class_id, - item.score); + item.confidence); } // Visualization result diff --git a/demo/mask_detection/cpp/mask_detector.cc b/demo/mask_detection/cpp/mask_detector.cc index f321dbd0..06e17eba 100644 --- a/demo/mask_detection/cpp/mask_detector.cc +++ b/demo/mask_detection/cpp/mask_detector.cc @@ -77,7 +77,7 @@ void VisualizeResult(const cv::Mat& img, text = "NO MASK: "; roi_color = cv::Scalar(0, 0, 255); } - text += std::to_string(static_cast(results[i].score*100)) + "%"; + text += std::to_string(static_cast(results[i].confidence * 100)) + "%"; int font_face = cv::FONT_HERSHEY_TRIPLEX; double font_scale = 1.f; float thickness = 1; @@ -243,7 +243,7 @@ void MaskClassifier::Postprocess(std::vector* faces) { } } (*faces)[i].class_id = best_class_id; - (*faces)[i].score = best_class_score; + (*faces)[i].confidence = best_class_score; } } diff --git a/demo/mask_detection/cpp/mask_detector.h b/demo/mask_detection/cpp/mask_detector.h index 0b10794f..1ca35106 100644 --- a/demo/mask_detection/cpp/mask_detector.h +++ b/demo/mask_detection/cpp/mask_detector.h @@ -32,7 +32,7 @@ struct FaceResult { // Detection result: cv::Mat of face rectange cv::Mat roi_rect; // Classification result: confidence - float score; + float confidence; // Classification result : class id int class_id; }; -- GitLab