Menu

#84 Experiments on NMS-Free Yolov9 (tiny version)

open
nobody
None
2026-04-04
2026-04-02
Anonymous
No

Originally created by: testdummyvt

Here is a more readable and professional version of your update.


Hello everyone! I’ve been experimenting with the YOLOv9 Tiny model and wanted to share my latest progress.

You can find the implementation of the YOLOv9-NMS-Free version here: https://github.com/testdummyvt/libreyolo

Training Methodology

Due to limited computational resources, I chose not to train the entire model from scratch. Instead, I used the following approach:

  • Weights Migration: I copied the pre-trained YOLOv9 weights for the Backbone, Neck, and One-to-Many head.
  • Targeted Training: I only trained the One-to-One head, as this is the only new component in the NMS-free architecture.

Image

Training logs are available here: hf-co/testdummyvt/yolov9_nmsfree_exp

Validation Results

I performed a validation run on 5,000 images using the following environment:

Initializing COCO evaluator...
Warning: Failed to initialize COCO evaluator: Images directory not found: /home/testdummy/datasets/coco/coco/images/val
Falling back to legacy DetMetrics
Warming up model (3 iterations)...
Validating on 5000 images...
Device: cuda
Batch size: 16
Validating:  100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 313/313 [00:26<00:00, 11.95it/s]

==================================================
Validation Results
==================================================
  metrics/precision: 0.6357
  metrics/recall: 0.4153
  metrics/mAP50: 0.5449
  metrics/mAP50-95: 0.4173
--------------------------------------------------
  Images processed: 5000
  Total time: 26.18s
  Speed: 5.2ms/image
==================================================
Results for Yolov9-NMS-Free: {'metrics/precision': 0.6357262341447409, 'metrics/recall': 0.41528902822833136, 'metrics/mAP50': 0.5448938380897804, 'metrics/mAP50-95': 0.4173021161704325, 'speed/preprocess_ms': 0.251129674911499, 'speed/inference_ms': 1.773804712295532, 'speed/postprocess_ms': 2.016630506515503, 'speed/total_ms': 5.236816024780273, 'speed/total_s': 26.184080123901367, 'speed/images_seen': 5000}

Peer Review Requested

To be honest, these results look almost too good to be true 😅. I would appreciate it if someone could help verify whether these metrics are accurate.

I used the following script to generate the validation results:

from libreyolo import LibreYOLO9NMSFree
if __name__ == "__main__":

    model_weights = "/home/testdummy/projects/code/libreyolo/runs/train/v9_nms_free_exp_07/weights/best.pt"

    model = LibreYOLO9NMSFree(model_weights, size="t")

    results = model.val(
        data="/home/testdummy/datasets/coco/data.yaml",
        batch=16,
        imgsz=640,
        conf=0.25,
        iou=0.6,
        split="val",
        save_json=True,
        verbose=True,
    )
    print(f"Results for Yolov9-NMS-Free: {results}")

weight file I use: best.pt (huggingface.co)

Discussion

  • Anonymous

    Anonymous - 2026-04-02

    Originally posted by: testdummyvt

    Tried Roboflow model leaderboard benchmark code: code

    Yolov9t - NMS - Free

    Average Precision (AP) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.273
    Average Precision (AP) @[ IoU=0.50      | area=   all | maxDets=100 ] = 0.382
    Average Precision (AP) @[ IoU=0.75      | area=   all | maxDets=100 ] = 0.296
    Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.130
    Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.309
    Average Precision (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.350
    
    :::json
    {
        "metadata": {
            "architecture": "yolov9_nms_free",
            "model": "LibreYOLO9NMSFree-t",
            "license": "",
            "github_url": "",
            "paper_url": "",
            "run_parameters": {
                "imgsz": 640,
                "iou": 0.7,
                "max_det": 100,
                "conf": 0,
                "verbose": false
            },
            "param_count": 2634688,
            "run_date": "2026-04-02T06:40:02.506668+00:00",
            "pretrain_datasets": [
                "coco"
            ]
        },
        "map50_95": 0.2728917482116596,
        "map50": 0.3816495766740779,
        "map75": 0.29584695939559724,
        "small_objects": {
            "map50_95": 0.1299135696944542,
            "map50": 0.21008266971800696,
            "map75": 0.1409759839958892
        },
        "medium_objects": {
            "map50_95": 0.3090896469989991,
            "map50": 0.4372088467636194,
            "map75": 0.3386231155424907
        },
        "large_objects": {
            "map50_95": 0.35006922504173976,
            "map50": 0.44854952199072967,
            "map75": 0.3791461229728792
        },
        "iou_thresholds": [
            0.5,
            0.55,
            0.6,
            0.65,
            0.7,
            0.75,
            0.8,
            0.85,
            0.8999999999999999,
            0.95
        ],
        "f1_50": 0.11403359843111445,
        "f1_75": 0.08717851332309046,
        "f1_small_objects": {
            "f1_50": 0.10237654149249138,
            "f1_75": 0.05660358345902377
        },
        "f1_medium_objects": {
            "f1_50": 0.15930349524142315,
            "f1_75": 0.12481780626304256
        },
        "f1_large_objects": {
            "f1_50": 0.15153197661734544,
            "f1_75": 0.13458899043152653
        },
        "f1_iou_thresholds": [
            0.5,
            0.55,
            0.6,
            0.65,
            0.7,
            0.75,
            0.8,
            0.85,
            0.8999999999999999,
            0.95
        ]
    }
    

    Yolov9t

    Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.304
    Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=100 ] = 0.420
    Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = 0.328
    Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.136
    Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.333
    Average Precision (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.427

    It got a lower score than what is reported in orginal yolov9 repo:

    Image

     
  • Anonymous

    Anonymous - 2026-04-02

    Originally posted by: testdummyvt

    Update:

    Ok, once I made COCOEval work, now I get the following results, which make more sense:

    Yolov9t-NMS-Free model results:

    Saved predictions to runs/val/yolo9_nms_free_t_20260402_151316_768793/predictions.json
    Running per image evaluation...
    Evaluate annotation type *bbox*
    DONE (t=28.63s).
    Accumulating evaluation results...
    DONE (t=6.42s).
     Average Precision  (AP) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.340
     Average Precision  (AP) @[ IoU=0.50      | area=   all | maxDets=100 ] = 0.481
     Average Precision  (AP) @[ IoU=0.75      | area=   all | maxDets=100 ] = 0.366
     Average Precision  (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.115
     Average Precision  (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.312
     Average Precision  (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.478
     Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=  1 ] = 0.311
     Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets= 10 ] = 0.534
     Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.596
     Average Recall     (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.331
     Average Recall     (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.597
     Average Recall     (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.745
    
    ==================================================
    Validation Results
    ==================================================
      metrics/mAP50-95: 0.3403
      metrics/mAP50: 0.4812
      metrics/mAP75: 0.3661
      metrics/mAP_small: 0.1155
      metrics/mAP_medium: 0.3123
      metrics/mAP_large: 0.4782
      metrics/AR1: 0.3114
      metrics/AR10: 0.5345
      metrics/AR100: 0.5958
      metrics/AR_small: 0.3314
      metrics/AR_medium: 0.5967
      metrics/AR_large: 0.7453
    --------------------------------------------------
      Images processed: 5000
      Total time: 26.68s
      Speed: 5.3ms/image
    ==================================================
    

    Yolov9t model results for comparision:

    Computing COCO metrics...
    Saved predictions to runs/val/yolo9_t_20260402_151038_698077/predictions.json
    Running per image evaluation...
    Evaluate annotation type *bbox*
    DONE (t=23.56s).
    Accumulating evaluation results...
    DONE (t=4.76s).
     Average Precision  (AP) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.372
     Average Precision  (AP) @[ IoU=0.50      | area=   all | maxDets=100 ] = 0.524
     Average Precision  (AP) @[ IoU=0.75      | area=   all | maxDets=100 ] = 0.395
     Average Precision  (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.119
     Average Precision  (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.338
     Average Precision  (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.533
     Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=  1 ] = 0.313
     Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets= 10 ] = 0.510
     Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.551
     Average Recall     (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.255
     Average Recall     (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.560
     Average Recall     (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.701
    
    ==================================================
    Validation Results
    ==================================================
      metrics/mAP50-95: 0.3716
      metrics/mAP50: 0.5235
      metrics/mAP75: 0.3951
      metrics/mAP_small: 0.1187
      metrics/mAP_medium: 0.3376
      metrics/mAP_large: 0.5325
      metrics/AR1: 0.3132
      metrics/AR10: 0.5099
      metrics/AR100: 0.5506
      metrics/AR_small: 0.2550
      metrics/AR_medium: 0.5600
      metrics/AR_large: 0.7007
    --------------------------------------------------
      Images processed: 5000
      Total time: 43.54s
      Speed: 8.7ms/image
    =================================================
    
     
  • Anonymous

    Anonymous - 2026-04-02

    Originally posted by: EHxuban11

    Hello, super interesting work!!!!!

    I'm going to try it out. I can also train a model with your code with the A100 or rtx5080. What are your gpu ressources?

    Btw, it looks like https://huggingface.co/testdummyvt/yolov9_nmsfree_exp/blob/v1_0_exps/weights/best.pt is a private repo. I was thinking about training your model further, unfrozen, to push it further.

     
  • Anonymous

    Anonymous - 2026-04-02

    Originally posted by: testdummyvt

    @EHxuban11 I made the repo public now.

    I have an RTX 3090, and it runs at 70% of the original clock speed (I got it like that), so it takes a lot of time to train each epoch.

    Would be nice to see how it will perform with a larger GPU.

     
  • Anonymous

    Anonymous - 2026-04-02

    Originally posted by: EHxuban11

    Hello @testdummyvt, I ran the training in the rtx5080 with your exact same parameters (30 epochs, etc) except for Batch size 48 instead of 32. I got :

    0.352 mAP50-95 for yolo9t nms free
    0.372 mAP50-95 when running yolo9t with nms

    Very promising, especially because we can run it for longer, unfrozen, etc.

    I'm now proceeding with a smaller unfrozen run, without augmenetations. Let's see if the 2 mAP50-95 gap closes. I'll report back!

     
  • Anonymous

    Anonymous - 2026-04-04

    Originally posted by: EHxuban11

    Hello @testdummyvt comming back with not so great results from the unfrozen run. As you can see in the image, the val peaked at the similar level as the frozen run I did yesterday at 0.3526, but from there it went down. The model has been overfitting. I think that we can just use your freezing approach and train 4 sizes, t,s,m,c in preparation for putting them in HF.

    Regarding fine-tuning, do you know if this can be easily fine-tuned? I can run some tests with RF100 datasets. I think that now that performance has been demonstrated in terms of map, the main thing missing is to demostrate it can be fine tuned easily by people.

    Image

     

Log in to post a comment.

Auth0 Logo