Skip to content

INCREASING NMS SPEED #679

@glenn-jocher

Description

@glenn-jocher

Non Maximal Suppression (NMS) of bounding boxes is a significant speed constraint during testing. I am opening this issue to try to determine options for speeding up this operation. I am going to compare the default NMS method 'MERGE' with two newly available PyTorch methods. If anyone has any additional methods we could test, please post here.

def non_max_suppression(prediction, conf_thres=0.5, nms_thres=0.5):

The test code is below. Hardware is a 2080Ti.

python3 test.py --weights ultralytics68.pt --nms-thres 0.6 --img-size 512 --device 0

UPDATE: THESE ARE OLD RESULTS, SEE BOTTOM OF THREAD FOR IMPROVED RESULTS

Speed
mm:ss
COCO mAP
@0.5...0.95
COCO mAP
@0.5
ultralytics 'OR' 8:20 39.7 60.3
ultralytics 'AND' 7:38 39.6 60.1
ultralytics 'SOFT' 12:00 39.1 58.7
ultralytics 'MERGE' 11:25 40.2 60.4
torchvision.ops.boxes.nms() 5:08 39.7 60.3
torchvision.ops.boxes.batched_nms() 6:00 39.7 60.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaleStale and schedule for closing soonenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions