mirror of
https://github.com/azaion/autopilot.git
synced 2026-04-23 02:46:33 +00:00
Use constant font size for OPI5 inference results.
This commit is contained in:
@@ -116,7 +116,7 @@ void AiEngineInferenceOpi5::drawObjects(cv::Mat& image, const object_detect_resu
|
||||
//continue;
|
||||
}
|
||||
|
||||
fprintf(stderr, "[%d] prop = %f\n", i, result.prop);
|
||||
fprintf(stderr, "Inference[%d] probability = %f\n", i, result.prop * 100);
|
||||
|
||||
int left = result.box.left;
|
||||
int top = result.box.top;
|
||||
@@ -130,7 +130,7 @@ void AiEngineInferenceOpi5::drawObjects(cv::Mat& image, const object_detect_resu
|
||||
//sprintf(c_text, "%s %d%%", coco_cls_to_name(result.cls_id), (int)(round(result.prop * 100)));
|
||||
sprintf(c_text, "%s %d%%", mClassNames[result.cls_id % mClassNames.size()].toStdString().c_str(), (int)(round(result.prop * 100)));
|
||||
cv::Point textOrg(left, top - 5);
|
||||
cv::putText(image, std::string(c_text), textOrg, cv::FONT_HERSHEY_COMPLEX, result.prop, cv::Scalar(0, 0, 255), 1, cv::LINE_AA);
|
||||
cv::putText(image, std::string(c_text), textOrg, cv::FONT_HERSHEY_COMPLEX, 0.70, cv::Scalar(0, 0, 255), 1, cv::LINE_AA);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user