I was wondering if there was something similar to yolo for object detection but for Rust?
I am not after a rust wrapper for yolo or anything that might use yolo but something similar but not at all dependent on yolo?
I was wondering if there was something similar to yolo for object detection but for Rust?
I am not after a rust wrapper for yolo or anything that might use yolo but something similar but not at all dependent on yolo?
YOLO is an algorithm name. It is same as Binary Sort is an algorithm name
Where Ultralitics provides ready to use YOLO implementation in Python using Pytorch
So YOLO can be implemented in Rust
There are already some YOLO implementations in Rust, you can search with this keywoard "YOLO implementation from scratch in Rust github". The keyword "github" is to display github repository that implements YOLO in Rust
The first repo that really implements the YOLO architecture in Rust in my search result is
Some implementation may provide ready to use training pipeline (both in CPU and GPU) some does not. That implementation does not provide how to train the model. It provides the model architecture code, and inference code (how to run the model)
My advise is, training the model in Python because the training ecosystem for YOLO is more mature there, training in CPU or GPU. For example using Ultralitics that uses Pytorch under the hood, training it on your own machine or Google Colab free GPU. Then deploying the model in Rust
If you save the model in Pytorch format, you can deploy it using this binding library to C++ libtorch: GitHub - LaurentMazare/tch-rs: Rust bindings for the C++ api of PyTorch.
If you want to deploy using Candle (Rust Machine Learning framework). Candle uses format called Safetensors, so just convert the model from Pytorch format to Safetensors: https://github.com/huggingface/candle
If you want to deploy in ONNX runtime, just convert the Pytorch model to ONNX format, then you can use this library: GitHub - pykeio/ort: Fast ML inference & training for ONNX models in Rust
All that 3 libraries support deploying on CPU dan GPU. Because YOLO is really lag in CPU, I tried it on old laptop Intel I5 gen 10, 20 GB RAM
Alternatively, if you understand YOLO architecture, you can create it from scratch using that tch rs or candle library, and training it on CPU or GPU, both of them support it
If you are looking alternative object detection that is not YOLO, like RCNN, Faster RCNN, DETR, RT-DETR, you can use the same method: training the model in Python, running the model in Rust like I explained above. You can browse the new current top State of Art object detection model. Back then, there was Paperwithcode website that provide the list, but now it is combined in Huggingface and it seems that no ranking list again is provided, so it needs deep search and try to find the new top model
Hi mate,
I should have been a little more accurate, so I want to use python with ultralytics for training that I don't mind but for using my trained model I want to use something else due to ultralytics licencing.
This one seems interesting I will check it out but is it suitable for Raspberry Pi usage?
What about this one:
Which one I should use?
Yeah the Ort library support Raspberry Pi. It is binding to the official C++ ONNX runtime library from Microsoft here: GitHub - microsoft/onnxruntime: ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator
Tract is also good, it is pure Rust so should be easier to setup. But it doesn't support GPU, if you do not deploy on GPU you can use it
Another pure Rust one that I just found is this: GitHub - tracel-ai/burn: Burn is a next generation tensor library and Deep Learning Framework that doesn't compromise on flexibility, efficiency and portability.. It is more equivalent to Candle but can also run ONNX model (Candle also can run ONNX model). It uses WGPU backend so it supports GPU and can be used in Rasrberry Pi. You can find more info regarding its ONNX specs here: ONNX Model - The Burn Book 🔥 and here No-Std - The Burn Book 🔥
Which one to use I don't know. Maybe you can list what you need and see which library provides it. Or you may create simple prototypes to compare them
Which one would be better, candle or burn?
So can burn also train AI models?
I actually have a change of heart I want to avoid ultralytics if I can due to the fact that if I export from ultralytics then I sitll have to use their license which I don't want to.
Which one would be better, candle or burn?
The burn supports the candle as backend .
WHats the difference between using burn with candle and without it, sorry I am not understanding?