修改src/image.c的draw_detections函数
对应位置修改即可(主要是两个位置)
for(i = 0; i < num; ++i){
char labelstr[4096] = {0};
int class = -1;
for(j = 0; j < classes; ++j){
char res[20]={0}; //添加位置(1)
if (dets[i].prob[j] > thresh){
if (class < 0) {
strcat(labelstr, names[j]);
class = j;
} else {
strcat(labelstr, “, “);
strcat(labelstr, names[j]);
}
sprintf(res,”%.2f”,dets[i].prob[j]*100);//添加位置2
strcat(labelstr,"😊;
strcat(labelstr,res);
strcat(labelstr,"%");
printf("%s: %.0f%%\n", names[j], dets[i].prob[j]*100);
}
}
然后重新编译