AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.77k stars 7.96k forks source link

core dump #689

Open Caroline1994 opened 6 years ago

Caroline1994 commented 6 years ago

Hi, @AlexeyAB I want to get the coordinates of the detected object and save the data to a txt file I have add

FILE *fp=fopen("results/result.txt","a");
fprintf(fp,"%d %d %d %d\n",b_x_center, b_y_center, b_width, b_height);

into the draw_detections_cv_v3() function. I have got core dump problem when I run ./darknet detector demo 2018-04-24 15 39 39 But I can got correct result when I add those code into draw_detections_v3() function and run ./darknet detector test . could you help me

AlexeyAB commented 6 years ago

Instead of this line FILE *fp=fopen("results/result.txt","a"); use this line static FILE *fp=fopen("results/result.txt","a");

But better to use without any changes of source code: darknet.exe detector demo data/voc.data yolo-voc.cfg yolo-voc.weights test.mp4 > result.txt

Caroline1994 commented 6 years ago

@AlexeyAB Could you tell me how can I get mAP corresponding of FPS when I run ./darknet detector demo Thank you very much

AlexeyAB commented 6 years ago

Could you tell me how can I get mAP corresponding of FPS

So you will get mAP and FPS for the same model.

mAP can't be obtained for video, because to get mAP your Dataset-images should be labeled.

Caroline1994 commented 6 years ago

@AlexeyAB Thank you very much!

Caroline1994 commented 6 years ago

Hi,@AlexeyAB Could you tell me how to use the method in this picture?How should I modify the parameters in the darknet.exe detector calc_anchors data/obj.data -num_of_clusters 9 -width 416 -height 416 2018-04-28 10 29 00 Thank you very much!

AlexeyAB commented 6 years ago

@Caroline1994 Just do this command darknet.exe detector calc_anchors data/obj.data -num_of_clusters 9 -width 416 -height 416

You will get new anchors. Then set new anchors in these 3 places in your cfg-file:

  1. https://github.com/AlexeyAB/darknet/blob/0039fd26786ab5f71d5af725fc18b3f521e7acfd/cfg/yolov3.cfg#L609

  2. https://github.com/AlexeyAB/darknet/blob/0039fd26786ab5f71d5af725fc18b3f521e7acfd/cfg/yolov3.cfg#L695

  3. https://github.com/AlexeyAB/darknet/blob/0039fd26786ab5f71d5af725fc18b3f521e7acfd/cfg/yolov3.cfg#L782

Caroline1994 commented 6 years ago

Hi,@AlexeyAB Thans for your reply. I want to ask you, in the paper YOLO9000: Better, Faster, Stronger, I saw the section of the introduction of dimensional clustering mentioned that the recall rate of 5 kinds of anchor boxes is equivalent to 9 kinds of anchor boxes in the Faster R-CNN. Why does the code do not use 5 anchor boxes, but 9?

AlexeyAB commented 6 years ago

@Caroline1994

the section of the introduction of dimensional clustering mentioned that the recall rate of 5 kinds of anchor boxes is equivalent to 9 kinds of anchor boxes

This is about Yolo v2 where is only 1 detection-layer ([region]) in the network at one scale. Figure2 and Table 1 on page 3: https://arxiv.org/pdf/1612.08242v1.pdf

But in the Yolo v3 there are 3 detection layers ([yolo]) at the the different scales, so each 3 anchors are used only for correspond [yolo] layer. At the different scales should be used different anchors.

Caroline1994 commented 6 years ago

Thank you very much!@AlexeyAB If you don't mind,could you give me a brief introduction of the idea and the main formula about using k-means++ to find out the anchor boxes's width and height in the src/detector.c calc_anchors() function?