Only test on Jetson-NX 4GB
ENVS:
- Jetpack 4.6.3
- CUDA-10.2
- CUDNN-8.2.1
- TensorRT-8.2.1
- DeepStream-6.0.1
- OpenCV-4.1.1
- CMake-3.10.2
If you have other environment-related issues, please discuss in issue.
yolov8s.pt
is your trained pytorch model, or the official pre-trained model.
Do not use any model other than pytorch model.
Do not use build.py
to export engine if you don't know how to install pytorch and other environments on
jetson.
!!! Please use the PC to execute the following script !!!
# Export yolov8s.pt to yolov8s.onnx
python3 export-det.py --weights yolov8s.pt --sim
!!! Please use the Jetson to execute the following script !!!
# Using trtexec tools for export engine
/usr/src/tensorrt/bin/trtexec \
--onnx=yolov8s.onnx \
--saveEngine=yolov8s.engine
After executing the above command, you will get an engine named yolov8s.engine
.
It is highly recommended to use C++ inference on Jetson.
Here is a demo: csrc/jetson/detect
.
Please modify CLASS_NAMES
and COLORS
in main.cpp
for yourself.
And build:
export root=${PWD}
cd src/jetson/detect
mkdir build
cmake ..
make
mv yolov8 ${root}
cd ${root}
Usage:
# infer image
./yolov8 yolov8s.engine data/bus.jpg
# infer images
./yolov8 yolov8s.engine data
# infer video
./yolov8 yolov8s.engine data/test.mp4 # the video path
yolov8s-seg.pt
is your trained pytorch model, or the official pre-trained model.
Do not use any model other than pytorch model.
Do not use build.py
to export engine if you don't know how to install pytorch and other environments on
jetson.
!!! Please use the PC to execute the following script !!!
# Export yolov8s-seg.pt to yolov8s-seg.onnx
python3 export-seg.py --weights yolov8s-seg.pt --sim
!!! Please use the Jetson to execute the following script !!!
# Using trtexec tools for export engine
/usr/src/tensorrt/bin/trtexec \
--onnx=yolov8s-seg.onnx \
--saveEngine=yolov8s-seg.engine
After executing the above command, you will get an engine named yolov8s-seg.engine
.
It is highly recommended to use C++ inference on Jetson.
Here is a demo: csrc/jetson/segment
.
Please modify CLASS_NAMES
and COLORS
and postprocess parameters in main.cpp
for
yourself.
int topk = 100;
int seg_h = 160; // yolov8 model proto height
int seg_w = 160; // yolov8 model proto width
int seg_channels = 32; // yolov8 model proto channels
float score_thres = 0.25f;
float iou_thres = 0.65f;
And build:
export root=${PWD}
cd src/jetson/segment
mkdir build
cmake ..
make
mv yolov8-seg ${root}
cd ${root}
Usage:
# infer image
./yolov8-seg yolov8s-seg.engine data/bus.jpg
# infer images
./yolov8-seg yolov8s-seg.engine data
# infer video
./yolov8-seg yolov8s-seg.engine data/test.mp4 # the video path
yolov8s-pose.pt
is your trained pytorch model, or the official pre-trained model.
Do not use any model other than pytorch model.
Do not use build.py
to export engine if you don't know how to install pytorch and other environments on
jetson.
!!! Please use the PC to execute the following script !!!
# Export yolov8s-pose.pt to yolov8s-pose.onnx
yolo export model=yolov8s-pose.pt format=onnx simplify=True
!!! Please use the Jetson to execute the following script !!!
# Using trtexec tools for export engine
/usr/src/tensorrt/bin/trtexec \
--onnx=yolov8s-pose.onnx \
--saveEngine=yolov8s-pose.engine
After executing the above command, you will get an engine named yolov8s-pose.engine
.
It is highly recommended to use C++ inference on Jetson.
Here is a demo: csrc/jetson/pose
.
Please modify KPS_COLORS
and SKELETON
and LIMB_COLORS
and postprocess parameters
in main.cpp
for yourself.
int topk = 100;
float score_thres = 0.25f;
float iou_thres = 0.65f;
And build:
export root=${PWD}
cd src/jetson/pose
mkdir build
cmake ..
make
mv yolov8-pose ${root}
cd ${root}
Usage:
# infer image
./yolov8-pose yolov8s-pose.engine data/bus.jpg
# infer images
./yolov8-pose yolov8s-pose.engine data
# infer video
./yolov8-pose yolov8s-pose.engine data/test.mp4 # the video path