NOTE: The yaml file is not required.
git clone https://github.com/ultralytics/ultralytics.git
cd ultralytics
pip3 install -r requirements.txt
python3 setup.py install
pip3 install onnx onnxsim onnxruntime
NOTE: It is recommended to use Python virtualenv.
Copy the export_yoloV8_pose.py
file from DeepStream-Yolo-Pose/utils
directory to the ultralytics
folder.
Download the pt
file from YOLOv8 releases (example for YOLOv8s-Pose)
wget https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8s-pose.pt
NOTE: You can use your custom model.
Generate the ONNX model file (example for YOLOv8s-Pose)
python3 export_yoloV8_pose.py -w yolov8s-pose.pt --dynamic
NOTE: To change the inference size (defaut: 640)
-s SIZE
--size SIZE
-s HEIGHT WIDTH
--size HEIGHT WIDTH
Example for 1280
-s 1280
or
-s 1280 1280
NOTE: To simplify the ONNX model (DeepStream >= 6.0)
--simplify
NOTE: To use dynamic batch-size (DeepStream >= 6.1)
--dynamic
NOTE: To use static batch-size (example for batch-size = 4)
--batch 4
Copy the generated ONNX model file to the DeepStream-Yolo-Pose
folder.
Edit the config_infer_primary_yoloV8_pose.txt
file according to your model (example for YOLOv8s-Pose)
[property]
...
onnx-file=yolov8s-pose.onnx
...
parse-bbox-func-name=NvDsInferParseYoloPose
...