- Install Python and PyTorch.
- Clone the offical git repository to a folder of your choice using the command git clone https://github.com/ultralytics/yolov5.git.
- Download any of the pre-trained checkpoints based on your preferences. I am using the smallest yolov5n.pt for this example.
- Write and execute a Python script with the following code:
- Pretrained networks from external platforms - https://www.mathworks.com/help/deeplearning/networks-from-external-platforms.html
- importNetworkFromONNX documentation - https://www.mathworks.com/help/deeplearning/ref/importnetworkfromonnx.html
- Exporting models to ONNX in PyTorch - https://pytorch.org/tutorials/beginner/onnx/export_simple_model_to_onnx_tutorial.html.
- trainYOLOXObjectDetector documentation - https://www.mathworks.com/help/vision/ref/trainyoloxobjectdetector.html