Commit aa4079d8 authored by Your Name's avatar Your Name
Browse files

修改C++版本结果可视化

parent 5ea34244
......@@ -71,7 +71,7 @@ source ~/.bashrc
程序运行结束会在build目录生成YoloV3检测结果图像。
<img src="./Resource/Images/Result.jpg" alt="Result" style="zoom:50%;" />
<img src="./Resource/Images/Result_1.jpg" alt="Result" style="zoom:50%;" />
### python版本推理
......@@ -95,7 +95,7 @@ python YoloV3_infer_migraphx.py \
程序运行结束会在当前目录生成YoloV3检测结果图像。
<img src="./Resource/Images/Result.jpg" alt="Result_2" style="zoom: 50%;" />
<img src="./Resource/Images/Result_1.jpg" alt="Result_2" style="zoom: 50%;" />
## 历史版本
......
......@@ -47,6 +47,15 @@ void Sample_DetectorYOLOV3()
ResultOfDetection result=predictions[i];
cv::rectangle(srcImage,result.boundingBox,Scalar(0,255,255),2);
string label = format("%.2f", result.confidence);
label = result.className + " " + label;
int left = predictions[i].boundingBox.x;
int top = predictions[i].boundingBox.y;
int baseLine;
Size labelSize = getTextSize(label, FONT_HERSHEY_SIMPLEX, 0.5, 1, &baseLine);
top = max(top, labelSize.height);
putText(srcImage, label, Point(left, top-10), FONT_HERSHEY_SIMPLEX, 1, Scalar(0, 255, 255), 2);
LOG_INFO(stdout,"box:%d %d %d %d,label:%d,confidence:%f\n",predictions[i].boundingBox.x,
predictions[i].boundingBox.y,predictions[i].boundingBox.width,predictions[i].boundingBox.height,predictions[i].classID,predictions[i].confidence);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment