Yan Ming
Yan Ming

Reputation: 58

make the darknet detector only output the label of the bounding box without confidence

Because of the needs of the school project, I want to make the darknet detector only output the label of the bounding box without confidence. Because of this line of instructions: darknet.exe detector demo data/crosswalk.data cfg/yolov3-crosswalk.cfg_test backup/yolov3-crosswalk_last(better2).weights -i 0 -thresh 0.05 -ext_output data/1.mp4. So I think it should be to modify the part of demo.c, So I found a line of code for displaying thresh, the following is the code I found:

if (!benchmark && !dontdraw_bbox) draw_detections_cv_v3(show_img, local_dets, local_nboxes, demo_thresh, demo_names, demo_alphabet, demo_classes, demo_ext_output);

I deleted demo_thresh, but thresh is still displayed during the video test, please help me, thank you

Upvotes: 0

Views: 816

Answers (1)

Amir Karami
Amir Karami

Reputation: 191

it seems you are using alexyAB model in your project since you have "draw_detections_cv_v3" function go to the image_opencv.cpp file and find draw_detections_cv_v3 function after that find this line:

sprintf(buff, " (%2.0f%%)", dets[i].prob[j] * 100);

and change it into :

sprintf(buff, "");

this line will append confidence into buff variable and will print in this line :

cv::putText(*show_img, labelstr, pt_text, cv::FONT_HERSHEY_COMPLEX_SMALL, font_size, black_color, 2 * font_size, CV_AA);

after changes,you should re-make darknet

Upvotes: 1

Related Questions