tkDNN icon indicating copy to clipboard operation
tkDNN copied to clipboard

YOLO v7 Support

Open mkzein opened this issue 2 years ago • 7 comments

Hello @mive93

Any plans to support YOLOv7 :1st_place_medal: ?

mkzein avatar Jul 08 '22 14:07 mkzein

I'm going to add Yolov5 and YOLOX to the wish list. Yes, Yolov4 is technically the last official Yolo version, but those other networks are also used in practice.

seba-eng avatar Aug 12 '22 05:08 seba-eng

Hello Any updates on support for YOLOv7?

mkzein avatar Nov 07 '22 12:11 mkzein

I tested yolov7 with tkDNN a couple of weeks ago(i lost track of the code,if i get the time , I will rewrite the code and create a pull request over a weekend), it was pretty straightforward to adapt tkDNN for yolov7, the only new layer that you need is swish ,for the tensorrt part you can use a combination of IElementWiseLayer functions and for the cudnn part you can copy the swish kernel from alexyab's darknet repo. To export darknet weights to tkdnn bin files , copy over the lines of code that deal with converting weight files in the hipert darknet repo mentioned somewhere in the docs to latest commit on alexyab's darknet repo and to run it , use the command mentioned in the hipert repo.

Writing a test_yolov7 function should be more or less along the lines of test_yolov4 , the demo should run out of the box without any issues with yolov7 if you added the swish layer as mentioned above

perseusdg avatar Nov 10 '22 10:11 perseusdg

https://github.com/perseusdg/tkDNN/tree/swish-dev .. this is an untested version of swish for tkdnn , i also enabled it for the darknet parse so it should be relatively easy to use it with yolov7

perseusdg avatar Nov 17 '22 13:11 perseusdg

https://github.com/perseusdg/tkDNN/tree/swish-dev .. this is an untested version of swish for tkdnn , i also enabled it for the darknet parse so it should be relatively easy to use it with yolov7

Thanks for the code...which layers did you use for yolov7. And which would you recommend for yolov7-tiny

AGpix avatar Oct 30 '23 13:10 AGpix

@perseusdg you are tested on yolov7 with this instruction?

https://github.com/perseusdg/tkDNN/blob/swish-dev/docs/exporting_weights.md

Egorundel avatar May 13 '24 05:05 Egorundel

@ceccocats @seba-eng @perseusdg @mkzein @AGpix How can this be applied to YOLOv7-8 for a PyTorch implementation? They don't have the files model.cfg and model.weights, but there is only model.yaml and model.pt

Egorundel avatar May 13 '24 12:05 Egorundel