XinzeLee / PolygonObjectDetection

This repository is based on Ultralytics/yolov5, with adjustments to enable polygon prediction boxes.
352 stars 95 forks source link

nms of gpu is different from cpu. #16

Open jiangfeizi opened 2 years ago

jiangfeizi commented 2 years ago

cpu gpu

jiangfeizi commented 2 years ago

top is cpu.

kuu22 commented 2 years ago

I have also encountered this issue, and it seems it's a problem with order_corners function. NVIDIA's IoU implementation expects corners to be ordered in a counter-clockwise direction, but it fails on some occasions, especially in thin objects where the two leftmost corners might be above the rightmost corners.

I tried modifying the function to order the corners using a center point and calculating the angle. It fixes the inference performance, giving a similar mAP to the CPU implementation, but the training in turn has very bad performance.

I'll edit this message if I find a better solution.

opencv-wt commented 2 years ago

I have also encountered this issue recently, have you fixed this issue? @jiangfeizi @kuu22

opencv-wt commented 2 years ago

@XinzeLee this issue may be a bug, I have also encountered this issue recently, how should this problem be solved? I would really appreciate you answering that question, thank you!