diff --git a/docs/docs/configuration/object_detectors.md b/docs/docs/configuration/object_detectors.md index 2906a7829..370fdb00a 100644 --- a/docs/docs/configuration/object_detectors.md +++ b/docs/docs/configuration/object_detectors.md @@ -980,6 +980,16 @@ YOLOv9 models can be exported using the below code or they [can be downloaded fr ```sh git clone https://github.com/WongKinYiu/yolov9 cd yolov9 -wget -O yolov9-t.pt "https://github.com/WongKinYiu/yolov9/releases/download/v0.1/yolov9-t-converted.pt" -python3 export.py --weights ./yolov9-t-converted.pt --imgsz 320 --simplify + +# setup the virtual environment so installation doesn't affect main system +python3 -m venv ./ +bin/pip install -r requirements.txt +bin/pip install onnx onnxruntime onnx-simplifier>=0.4.1 + +# download the weights +wget -O yolov9-t.pt "https://github.com/WongKinYiu/yolov9/releases/download/v0.1/yolov9-t-converted.pt" # download the weights + +# prepare and run export script +sed -i "s/ckpt = torch.load(attempt_download(w), map_location='cpu')/ckpt = torch.load(attempt_download(w), map_location='cpu', weights_only=False)/g" ./models/experimental.py +python3 export.py --weights ./yolov9-t.pt --imgsz 320 --simplify --include onnx ```