AlexeyAB / darknet

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

Code to dump Training object sizes distribution #2223

Open NEELMCW opened 5 years ago

NEELMCW commented 5 years ago

Hello @AlexeyAB

Is there any snippet that dumps the object size distributions for a given train set annotations in yolo txt format ?

AlexeyAB commented 5 years ago

@NEELMCW Hi,

You can visualize relative sizes of objects as cloud of points (each point(x,y) = each object size(w,h)) after that each image is resized to the 416x416: ./darknet detector calc_anchors obj.data -num_of_clusters 9 -width 416 -height 416 -show

51061972-34070180-1606-11e9-99dd-0b95c84878b5

You can change this code: https://github.com/AlexeyAB/darknet/blob/5343aa423563c107e0071b1427ad5defc27b56d2/src/detector.c#L1028-L1216 More: https://github.com/AlexeyAB/darknet/issues/2186#issuecomment-453672469

NEELMCW commented 5 years ago

Thanks @AlexeyAB