mmyolo icon indicating copy to clipboard operation
mmyolo copied to clipboard

[Feature] Support yolov9 inference

Open gy-7 opened this issue 10 months ago • 3 comments

Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily get feedback. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.

Motivation

Support YOLOv9 inference.(In the organizing code,comming soon)

Modification

  • [x] Add a checkpoint convert script(yolov9_to_mmyolo). (only yolov9-c is supported now)
  • [x] Add Type Hints.
  • [x] Add YOLOv9-c conifg.
  • [x] Add YOLOv9-c backbone/neck/head.
  • [x] Aligning YOLOv9-c metrics.
  • [x] Add YOLOv9-e conifg.
  • [x] Add YOLOv9-e backbone/neck/head.
  • [x] Aligning YOLOv9-e metrics.

BC-breaking (Optional)

Use cases (Optional)

Metric (coco val)

  • yolov9-c (official)
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.530
 Average Precision  (AP) @[ IoU=0.50      | area=   all | maxDets=100 ] = 0.702
 Average Precision  (AP) @[ IoU=0.75      | area=   all | maxDets=100 ] = 0.578
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.362
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.585
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.693
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=  1 ] = 0.392
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets= 10 ] = 0.652
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.702
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.541
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.760
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.844
  • yolov9-c (mmyolo)
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.531
 Average Precision  (AP) @[ IoU=0.50      | area=   all | maxDets=100 ] = 0.703
 Average Precision  (AP) @[ IoU=0.75      | area=   all | maxDets=100 ] = 0.579
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.366
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.587
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.690
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=  1 ] = 0.393
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets= 10 ] = 0.653
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.702
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.542
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.760
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.848
  • yolov9-e (mmyolo)
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.557
 Average Precision  (AP) @[ IoU=0.50      | area=   all | maxDets=100 ] = 0.729
 Average Precision  (AP) @[ IoU=0.75      | area=   all | maxDets=100 ] = 0.607
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.398
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.611
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.715
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=  1 ] = 0.405
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets= 10 ] = 0.670
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.718
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.564
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.770
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.862

Checklist

  1. Pre-commit or other linting tools are used to fix potential lint issues.
  2. The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness.
  3. If the modification has a potential influence on downstream projects, this PR should be tested with downstream projects, like MMDetection or MMClassification.
  4. The documentation has been modified accordingly, like docstring or example tutorials.

gy-7 avatar Apr 28 '24 12:04 gy-7

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Apr 28 '24 12:04 CLAassistant

Loving to see this feature being implemented! Keep up the amazing work! =)

Are you planning on adding yolov9 for training aswell?

thiagoribeirodamotta avatar May 14 '24 12:05 thiagoribeirodamotta

Loving to see this feature being implemented! Keep up the amazing work! =)

Are you planning on adding yolov9 for training aswell?

Thank you for your attention. An oversized PR may not be an appropriate choice. So after this PR is merged, I will consider creating a new PR to add the yolov9 training function.

gy-7 avatar May 14 '24 12:05 gy-7

@gy-7

Can you open a PR for training function? or can you make a branch on your repo for that?

twmht avatar Jun 06 '24 08:06 twmht

@gy-7 Hi there. Thank you for this PR! This could be a valuable addition to the MMYOLO repository, but it seems like the repository has been dead since the last few months now. Do you have the training script and trained weights for YOLOv9s as well? If yes, it would be super helpful if you could release them too in your own forked version please. Looking forward to your kind response!

ZeeRizvee avatar Jun 17 '24 22:06 ZeeRizvee

@gy-7 Hi there. Thank you for this PR! This could be a valuable addition to the MMYOLO repository, but it seems like the repository has been dead since the last few months now. Do you have the training script and trained weights for YOLOv9s as well? If yes, it would be super helpful if you could release them too in your own forked version please. Looking forward to your kind response!

Thanks for following this PR, recently I didn't continue to develop the yolov9 training feature because of work, I will implement this feature recently.

gy-7 avatar Jun 18 '24 02:06 gy-7

@gy-7 Hi there. Thank you for this PR! This could be a valuable addition to the MMYOLO repository, but it seems like the repository has been dead since the last few months now. Do you have the training script and trained weights for YOLOv9s as well? If yes, it would be super helpful if you could release them too in your own forked version please. Looking forward to your kind response!

Thanks for following this pr, recently I didn't continue to develop the yolov9 training feature because of work, I will implement this feature recently.

Thank you! In the model converter script, it would be nice to have converters for other variations of YOLOv9 as well, specifically YOLOv9s. Shall be keeping an eye out for your update! :)

ZeeRizvee avatar Jun 18 '24 03:06 ZeeRizvee

Hi everyone, I recently finished implementing YOLOv9 with mmyolo. https://github.com/gy-7/mmyolo/tree/gy77/support_yolov9 The code is still in the process of being updated, so feel free to join me in improving it.

Currently the supported features are as follows:

  1. weight convert, official-yolov9 to mmyolo-yolov9 weight convert, support yolov9-s/m/c/e & yolov9-t/s-converted model. (The converted weights are in the release)
  2. inference/validation: support yolov9-t/s/m/c/e model. (accuracy verified)
  3. training: support yolov9-t/s/m/c/e model (training accuracy is not verified, as I don't have enough GPUs. 😭)
  4. Intuitive model architecture diagram: support yolov9-t/s/m/c/e model (coming soon)

gy-7 avatar Jul 08 '24 06:07 gy-7