Welcome to DOFBOT-Ultra repository
1. YOLO Environment Setup
YOLO Environment Setup
Please ensure that the web control program backend process is not running in the background. To close it, refer to the [Get Started Quickly - 2. Access the Terminal] section in [Disable the Auto-Start Web Control Backend Process]. After closing, please restart DofbotUltra!!!
This chapter is for setting up from scratch on the official Raspberry Pi 5B image. If using the YAHBOOM image, this tutorial can be ignored.
The Yolo function for the DofbotUltra Raspberry Pi version should be run in docker.
1. Preparation
sudo apt updatesudo apt install python3-pip -ysudo pip install -U pip
2. Install PyTorch
Official download URL: https://download.pytorch.org/whl/torch_stable.html

If downloading manually, you need to find the corresponding torch and torchvision versions.
This experiment downloads torch-2.1.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl and torchvision-0.16.2-cp311-cp311-linux_aarch64.whl
The above two files can be obtained from the attachment and transferred to the Raspberry Pi via WinSCP
Installation commands:
xpip3 install torch-2.1.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whlpip3 install torchvision-0.16.2-cp311-cp311-linux_aarch64.whl
3. Install Ultralytics
xxxxxxxxxxsudo pip3 install ultralytics[export]

You also need to update Ultralytics to the latest version, otherwise you will encounter the error AttributeError: Can't get attribute 'C3k2' on <module 'ultralytics.nn.modules.block' from '/home/pi/.local/lib/python3.11/site-packages/ultralytics/nn/modules/block.py'>
xxxxxxxxxxpip install --upgrade ultralytics

Install onnxruntime
xxxxxxxxxxpip3 install onnxruntime
Note: Using onnxruntime requires a specific version of numpy. If it is not 1.23.5, you can run the following command to install the specified version.
xxxxxxxxxxsudo pip3 install numpy==1.23.5
Then reboot
xxxxxxxxxxsudo reboot
4. Verify Installation
Verify Ultralytics
xxxxxxxxxxpython3 -c "import ultralytics; print(ultralytics.__version__)"
Verify Torch
xxxxxxxxxxpython3 -c "import torch; print(torch.__version__); print(torch.cuda.is_available())"
Verify Torchvision
xxxxxxxxxxpython3 -c "import torchvision; print(torchvision.__version__)"
Verify Numpy
xxxxxxxxxxpython3 -c "import numpy; print(numpy.__version__)"
Note: The ultralytics version will be updated later. Please refer to the version information queried in the system.