YOLOv4 with TensorRT in ROS

Object detection for autonomous robots using state-of-the-art YOLOv4. To optimise models for deployment on Jetson devices, models were serialised into TensorRT engine files for inference. As ROS is one of the most popular middle-ware used for robots, this project performs inference on camera/video input and publishes detection in ROS-supported message formats. This allows anyone to easily modify and use this package in their own projects.

This project supports YOLOv3, tiny-YOLOv3, YOLOv4, tiny-YOLOv4. There are plans to include scaled YOLOv4 in the future.

Hope you like the project and feel free to contribute to it!

results

https://github.com/indra4837/yolov4_trt_ros

6 Likes

Hello,
I wish I could test your program but before I can not find how to do: “CATKIN_IGNORE”.
Can you explain to me how and where to put "CATKIN_IGNORE
Note: This package uses nodes similar to the ros_deep_learning package. Please place a CATKIN_IGNORE in this package to avoid a similar node name error catkin_make

Regards
Mr Owczarek

Hi,

You can simply place an empty file named ‘CATKIN_IGNORE’ inside ros_deep_learning. It is just an empty file which tells catkin not to build the ros_deep_learning package. See attached image for an example.

Do install the dependencies to ensure yolov4_trt_ros package builds successfully. Hopes this solve your issue!

2 Likes

Thanks for your help

Hello,
I have the command “cd ~ / catkin_ws && catkin_make” and below is the error message it cannot find “vision_msgsConfig.cmake” and “vision_msgs-config.cmake”. What to do or reinstall.
I will give you a screenshot

Regards
Mr Owczarekcmake probleme.txt (2.6 KB)

Hi,

You need to also install vision_opencv. Apologies that wasnt mentioned in the README

2 Likes

Hello,

I put th commande
./convert_yolo_trt.sh
YOLOv3 or YOLOv4. Input 3 or 4
4
Do you want to download the model? [Y/N]
y
What is the input shape? Input 288 or 416 or 608
416
Creating yolov4-416.cfg and yolov4-416.weights
How many categories are there?
An d i have this question What should be done ?
thank you for your help
Regards
Minion40

Hello,

$ cd ~/catkin_ws
$ source devel/setup.bash

I did what you wrote but I got the same message.
can you help me ?

Regards,
Minion40

Hi, i have replied to you in the issues tracking in Github

1 Like

Found OpenCV: /usr (found suitable version “3.2.0”, minimum required is “3.0”)
– Found CUDA: /usr/local/cuda (found version “10.2”)
– Could NOT find vision_msgs (missing: vision_msgs_DIR)
– Could not find the required component ‘vision_msgs’. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
CMake Error at /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by “vision_msgs” with
any of the following names:

vision_msgsConfig.cmake
vision_msgs-config.cmake

Add the installation prefix of “vision_msgs” to CMAKE_PREFIX_PATH or set
“vision_msgs_DIR” to a directory containing one of the above files. If
“vision_msgs” provides a separate development package or SDK, be sure it
has been installed.
Call Stack (most recent call first):
yolov4_trt_ros/CMakeLists.txt:13 (find_package)

– Configuring incomplete, errors occurred!
See also “/home/dreamvu/catkin_ws/build/CMakeFiles/CMakeOutput.log”.
See also “/home/dreamvu/catkin_ws/build/CMakeFiles/CMakeError.log”.
Makefile:3064: recipe for target ‘cmake_check_build_system’ failed
make: *** [cmake_check_build_system] Error 1
Invoking “make cmake_check_build_system” failed

can anyone help me fix this error? Jetson Xavier NX

Hi, I am currently facing the same error message as yours, can I ask if you have solved this problem?

Hi @qz312, I believe you need to install the vision_msgs package first, either from github or the ROS apt server if it’s available:

1 Like