Skip to content

vanstrong12138/trt_yolo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TRT YOLO

Ubuntu 22.04 ROS2 Humble

Support List:

Model Name size task Real
Yolov8 n detection
Yolov8 n segmentation
Yolov8 n pose
Yolo11 n detection
Yolo11 n segmentation
Yolo11 n pose
Yolo11 n obb-detection

Important

Before running each model, you need to execute the serialization program to export the .engine file.

Preparation

FOR Jetson Orin Series

  1. install source
sudo bash -c 'echo "deb https://repo.download.nvidia.com/jetson/common r36.4 main" >> /etc/apt/sources.list.d/nvidia-l4t-apt-source.list'
sudo bash -c 'echo "deb https://repo.download.nvidia.com/jetson/t234 r36.4 main" >> /etc/apt/sources.list.d/nvidia-l4t-apt-source.list'
  1. install dependencies
sudo apt update
sudo apt install tensorrt cudnn 
  1. clone package
cd your_workspace/src/
git clone https://github.com/vanstrong12138/trt_yolo.git
cd ..
colcon build

FOR Desktop PC/Laptop

TODO: setup method

Run

  1. source workspace
source your_workspace/install/setup.bash
  1. run yolov8n detection example
  • first, for first run, you need to run the model serialization program to export the .engine file
ros2 run trt_yolo yolov8n_det.launch.py mode:=serialize wts_path:=/path/to/yolov8n_det.wts
# this step will generate the yolov8n_det.engine file in the install directory
# it will take about 10 minutes
  • second, when engine file is generated, run the detection node
ros2 run trt_yolo yolov8n_det.launch.py labels_file:=/path/to/coco.txt image_topic:=/your/color/image/topic
  1. run yolo11n segmentation example
  • first, for first run, you need to run the model serialization program to export the .engine file
ros2 run trt_yolo yolo11n_seg.launch.py mode:=serialize wts_path:=/path/to/yolo11n_seg.wts
# this step will generate the yolo11n_seg.engine file in the install directory
# it will take about 10 minutes
  • second, when engine file is generated, run the detection node
ros2 run trt_yolo yolo11n_seg.launch.py labels_file:=/path/to/coco.txt image_topic:=/your/color/image/topic
  1. for advance usage, you can run the following command to see more options
# --show-args for detail options
ros2 run trt_yolo yolo11n_seg.launch.py --show-args

Acknowledgements

About

TensorRT Yolo for ROS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published