Skip to content

A set of python scripts implementing Yolor with TensorRT for object detection with ROS.

Notifications You must be signed in to change notification settings

petpetpeter/Yolor-ROS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yolor-ROS

A set of python scripts implementing Yolor with TensorRT for object detection in ROS workspace.

miniyellow

Preparation

  1. Clone this resipiratory to your catkin workspace
cd /catkin_ws/src
git clone https://github.com/petpetpeter/Yolor-ROS.git
  1. Build your workspace
cd /catkin_ws/
catkin build
source ~/.bashrc
  1. Install Python Dependencies

install pytorch according to your environment https://pytorch.org/

roscd yoloros/scripts/yolor
pip install -e .
  1. Download pretrain weight to /scripts/yolor

https://drive.google.com/file/d/1_vgbLEjV0TU5492MfNEkJduTdGtcdthN/view?usp=sharing

  1. Launch ROS Yolor example
roslaunch yoloros yolor_camera.launch

ezgif com-gif-maker

TensorRT 8.0.3.4: Follow installation guide here https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html

  1. Convert pytorch weight file to onnx file
roscd yoloros/scripts/yolor
python convert2Onnx.py --weight weights/yolor_p6.pt --out onnx/yolor_p6.onnx 
  1. Convert onnx to tensorRT Engine
/usr/src/tensorrt/bin/trtexec --explicitBatch \
                                --onnx=transformer_encoder.onnx \
                                --saveEngine=transformer_encoder.trt \
                                --minShapes=input:1x3x32x128 \
                                --optShapes=input:32x3x32x512 \
                                --maxShapes=input:32x3x32x768 \
                                --verbose \
                                --fp16
  1. Launch ROS Yolor TensorRT example
roslaunch yoloros trt_camera.launch

Acknowledgement

About

A set of python scripts implementing Yolor with TensorRT for object detection with ROS.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages