WongKinYiu / yolov7

Implementation of paper - YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors
GNU General Public License v3.0
13.31k stars 4.2k forks source link

register_nms does not take any augments for NMS #863

Open rance1108 opened 2 years ago

rance1108 commented 2 years ago

it seems like in the export.py L198

mo.register_nms() does not take any augments for NMS setting in add_nms.py it only uses

def register_nms(
    self,
    *,
    score_thresh: float = 0.25,
    nms_thresh: float = 0.45,
    detections_per_img: int = 100,
):

the given one? Or does it apply on other stage that I don't recognize? Thanks!

rance1108 commented 2 years ago

when I use: python export.py --weights ./yolov7.pt --grid --simplify --include-nms --img-size 480 480 --batch-size 32 --iou-thres 0.65 --conf-thres 0.35 --topk-all 100 it gives: Created NMS plugin 'EfficientNMS_TRT' with attributes: {'plugin_version': '1', 'background_class': -1, 'max_output_boxes': 100, 'score_threshold': 0.25, 'iou_threshold': 0.45, 'score_activation': False, 'box_coding': 0}

when I modify mo.register_nms() into:

            mo.register_nms(score_thresh = opt.conf_thres,
                            nms_thresh= opt.iou_thres,
                            detections_per_img= opt.topk_all)

it gives: Created NMS plugin 'EfficientNMS_TRT' with attributes: {'plugin_version': '1', 'background_class': -1, 'max_output_boxes': 100, 'score_threshold': 0.35, 'iou_threshold': 0.65, 'score_activation': False, 'box_coding': 0}