YOLOV3 测试图像添加置信度与训练bmp图像格式

不足之处希望大佬指正:项目根据官网

1、测试图像添加置信度:

     打开src/image.c文件draw_detections函数

   

    int i,j;
 
    for(i = 0; i < num; ++i){
        char labelstr[4096] = {0};
        int class = -1;
	char possible[10];//存放检测的置信值
        for(j = 0; j < classes; ++j){
	  sprintf(possible,"%.2f",dets[i].prob[j]);//置信值截取小数点后两位赋给possible
            if (dets[i].prob[j] > thresh){
                if (class < 0) {
                    strcat(labelstr, names[j]);
		    strcat(labelstr, possible);//标签中加入置信值
                    class = j;
                } else {
                    strcat(labelstr, ", ");
                    strcat(labelstr, names[j]);
		    strcat(labelstr, possible);//标签中加入置信值
                }
                printf("%s: %.0f%%\n", names[j], dets[i].prob[j]*100);
            }
        }

2、YOLOV3训练不同格式的图像:

  data.c里的fill_truth_detection函数中按照上面格式加了一行 

find_replace(labelpath, ".bmp",".txt",labelpath):
同理:

发布了33 篇原创文章 · 获赞 46 · 访问量 4万+

猜你喜欢

转载自blog.csdn.net/qq_34795071/article/details/86665620