提交 102f303c 编写于 作者: Z Zeyu Chen

rename FaceResult score to confidence

上级 90816728
# 百度PaddlePaddle实现口罩检测应用 # PaddleHub实现口罩佩戴检测应用
## 0 项目介绍 ## 0 项目介绍
![image](https://note.youdao.com/yws/public/resource/b0a4695bc7d58aed3b1ff797409aee1e/BB6BC87A45D146CEBA7BF237B5383835?ynotemdtimestamp=1582271320612) ![image](https://note.youdao.com/yws/public/resource/b0a4695bc7d58aed3b1ff797409aee1e/BB6BC87A45D146CEBA7BF237B5383835?ynotemdtimestamp=1582271320612)
......
...@@ -68,7 +68,7 @@ int main(int argc, char* argv[]) { ...@@ -68,7 +68,7 @@ int main(int argc, char* argv[]) {
item.rect[2], item.rect[2],
item.rect[3], item.rect[3],
item.class_id, item.class_id,
item.score); item.confidence);
} }
// Visualization result // Visualization result
......
...@@ -77,7 +77,7 @@ void VisualizeResult(const cv::Mat& img, ...@@ -77,7 +77,7 @@ void VisualizeResult(const cv::Mat& img,
text = "NO MASK: "; text = "NO MASK: ";
roi_color = cv::Scalar(0, 0, 255); roi_color = cv::Scalar(0, 0, 255);
} }
text += std::to_string(static_cast<int>(results[i].score*100)) + "%"; text += std::to_string(static_cast<int>(results[i].confidence * 100)) + "%";
int font_face = cv::FONT_HERSHEY_TRIPLEX; int font_face = cv::FONT_HERSHEY_TRIPLEX;
double font_scale = 1.f; double font_scale = 1.f;
float thickness = 1; float thickness = 1;
...@@ -243,7 +243,7 @@ void MaskClassifier::Postprocess(std::vector<FaceResult>* faces) { ...@@ -243,7 +243,7 @@ void MaskClassifier::Postprocess(std::vector<FaceResult>* faces) {
} }
} }
(*faces)[i].class_id = best_class_id; (*faces)[i].class_id = best_class_id;
(*faces)[i].score = best_class_score; (*faces)[i].confidence = best_class_score;
} }
} }
......
...@@ -32,7 +32,7 @@ struct FaceResult { ...@@ -32,7 +32,7 @@ struct FaceResult {
// Detection result: cv::Mat of face rectange // Detection result: cv::Mat of face rectange
cv::Mat roi_rect; cv::Mat roi_rect;
// Classification result: confidence // Classification result: confidence
float score; float confidence;
// Classification result : class id // Classification result : class id
int class_id; int class_id;
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册