Show the percentage on the image of YOLO

 Show the percentage on the image

method 1:https://groups.google.com/forum/?nomobile=true#!searchin/darknet/alphabet|sort:date/darknet/NS8opXDaZ60/4XeMYLuhCQAJ

method 2:

image.c 

edit below function

void draw_detections_v3(image im, detection *dets, int num, float thresh, char **names, image **alphabet, int classes, int ext_output)

if (alphabet) {
    char labelstr[4096] = { 0 };
    strcat(labelstr, names[selected_detections[i].best_class]);
    int j;
    for (j = 0; j < classes; ++j) {
        if (selected_detections[i].det.prob[j] > thresh && j != selected_detections[i].best_class) {
            strcat(labelstr, ", ");
            strcat(labelstr, names[j]);

        }
    }
    // add prob onto img
    char str[16];
    snprintf(str, sizeof(str), "%.3f", selected_detections[i].det.prob[selected_detections[i].best_class]);
    strcat(labelstr," ");
    strcat(labelstr, str);
    image label = get_label_v3(alphabet, labelstr, (im.h*.03));
    draw_label(im, top + width, left, label, rgb);
    free_image(label);
}

猜你喜欢

转载自blog.csdn.net/honk2012/article/details/80869071