WongKinYiu / ScaledYOLOv4

Scaled-YOLOv4: Scaling Cross Stage Partial Network
GNU General Public License v3.0
2.02k stars 575 forks source link

Batch mode Cluster-NMS when turning on TTA #6

Open Zzh-tju opened 3 years ago

Zzh-tju commented 3 years ago

Hi, what an excellent work. It is indeed amazing to get such AP and FPS.

I notice that you incorporate batch mode Weighted Cluster-NMS from https://github.com/Zzh-tju/yolov5

And I see there is an improvement when turning on TTA.

I wanna know is it helpful to switch NMS function to batch mode Weighted Cluster-NMS? Can it keep high efficiency when using TTA?

WongKinYiu commented 3 years ago

Thank you for your great work. I examined all kind of NMS provided in Cluster-NMS. For pytorch version, the default NMS gets the best performance for both AP and speed. For darknet version, almost all of methods in Cluster-NMS can give better AP, and take about 3~10 times NMS time However, NMS can be put into different thread from model inference, so it just increases latency and almost has no effect for throughput.

Zzh-tju commented 3 years ago

yes, I also found that the default torchvision nms could get similar AP and the fastest speed when turning off TTA. So I want to make sure does batch mode Cluster-NMS have a speed advantage when using TTA? Because TTA will predict much more boxes, right?