XinzeLee / RotateObjectDetection

This repository is based on Ultralytics/yolov5, with adjustments to enable rotate prediction boxes.
113 stars 22 forks source link

polygon_nms_kernel use exclusive nested for loop? #1

Closed muhammedakyuzlu closed 3 years ago

muhammedakyuzlu commented 3 years ago

Hello, First I want to say Thank you for the effort. I have my own dataset and I labeled it as you mentioned, I trained it on a CPU I haven't tried using GPU yet. In the training set it finished the first epoch without any issue but when it started to calculate the mAP it got lost in the polygon_nmskernel in general.py specific on the while loop at the 934. line In some way I ended up having x.shape like (16939,10) and inside the loop, there is a polygon_box_iou that contains polygon_inter_union_cpu which is itself a 16939 lens. So my dummy question is, Is it normal to have that much of an exclusive computation 16939*16939 = 286M iteration. just to calculate the mAP and do nms?

XinzeLee commented 3 years ago

Thanks for your interests! In the beginning of training, the network makes a huge amount of invalid predictions, leading to the infeasible computation time for CPU implementation (as you mentioned, 286M iterations). As the training process goes further, the network will gradually make more sensible predictions, so you can expect that the exclusive computation for polygon_box_iou (cpu version) will decrease significantly. If you are still using CPU for training, I recommend you to specify "--notest" as an argument to prevent normal testing. If you still want to test in CPU, and also want the test to be faster, you can modify the "conf_thres" in rotate_test.py to a higher value (maybe 0.01 or 0.1). But I still recommend you to use GPU implementation, which is much faster than CPU one!

muhammedakyuzlu commented 3 years ago

Thank you, I'll try to implement the GPU