YoloDotNet icon indicating copy to clipboard operation
YoloDotNet copied to clipboard

Add DirectML Onnx EP as alternative GPU setup

Open ev-dev opened this issue 1 year ago • 3 comments

Hey great project, I've been tweaking it to use DirectML as the onnx execution provider because I'm one of the poor suckers who doesn't have a Nvidia GPU and it works very well as an abstraction on most GPUs.

If you're interested, I'd be happy to submit my patch thru a PR, although I couldn't seem to come up with a reasonable way to avoid breaking changes to the main Yolo constructor's call signature since it's currently designed for simple disabling of GPU use but let me know if you have any suggestions/preferences in that regard.

Cheers

ev-dev avatar Apr 04 '24 19:04 ev-dev

i am also interested in this issue. deploying cuda, cudnn to each client is difficult, so i am aiming for a simpler solution. can you give me suggestions on modifications?

uno-studio avatar Apr 05 '25 13:04 uno-studio

@unofficialdev it's not too much effort, you can pull in the DirectML Onnx provider into the YoloCore class constructor and initialize it properly (see Onnx docs) and finally propagate any signature changes up to any of the inherited classes or invocations in the rest of the library here.

For reference, you can take a look at the open PR #38 which essentially does what I mentioned but for other Onnx execution providers.

ev-dev avatar Apr 07 '25 14:04 ev-dev

Would be nice to hear from @NickSwardh seeing as now there are a few more people interested in using other Onnx providers like this. Merging #38 would be a good first effort if the maintainer is willing. From there I could more easily integrate DirectML as another EP option and push to new PR

ev-dev avatar Apr 07 '25 14:04 ev-dev