Home

Awesome

YOLOX-ROS

YOLOX + ROS2 Foxy demo

yolox_s_result

<div align="center">πŸ”Ό Unity + YOLOX-ROS Demo</div>

Supported List

rclcpp is recommended due to its extended support.

BaseROS2 C++ROS2 Python
PyTorchβœ…
TensorRT (CUDA)βœ…
OpenVINOβœ…βœ…
ONNX Runtimeβœ…βœ…
TFLiteβœ…βœ…
<!-- ### Raspberry Pi4 πŸ“ + NCS2 + YOLOX-ROS Good news for studetsβ—πŸ“ Check [GitHub Wiki](https://github.com/Ar-Ray-code/YOLOX-ROS/wiki/YOLOX-ROS---Raspbian-(NCS2)) to try YOLOX-ROS. -->

Installation & Demo

<details> <summary>Python (PyTorch)</summary>

Requirements

Installation

Install the dependent packages based on all tutorials.

STEP 1 : Download from GitHub

mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src
git clone https://github.com/Ar-Ray-code/yolox_ros.git --recursive

STEP 2 : YOLOX Installation (yolox_ros_py)

For more information, see the YOLOX installation documentation.

pip3 install yolox

STEP 3 : Install YOLOX-ROS

source /opt/ros/foxy/setup.bash
sudo apt install ros-foxy-v4l2-camera
# source /opt/intel/openvino_2021/bin/setupvars.sh # <- Using OpenVINO
colcon build --symlink-install # weights (YOLOX-Nano) files will be installed automatically.

Automatic download weights

(Step 3) Using CUDA

If you have NVIDIA Graphics, you can run YOLOX-ROS on GPU.

Additional installing lists

source /opt/ros/foxy/setup.bash
sudo apt install ros-foxy-v4l2-camera
colcon build --symlink-install # weights (YOLOX-Nano) files will be installed automatically.

Step : Demo

Connect your web camera.

source /opt/ros/foxy/setup.bash
source ~/ros2_ws/install/local_setup.bash
ros2 launch yolox_ros_py yolox_nano_torch_cpu_camera.launch.py # <- CPU (PyTorch)
# ros2 launch yolox_ros_py yolox_nano_torch_gpu_camera.launch.py # <- GPU (PyTorch)
# ros2 launch yolox_ros_py yolox_nano_onnx_camera.launch.py # <- ONNXRuntime

# OpenVINO -------------------------------------
# source /opt/intel/openvino_2021/bin/setupvars.sh
# ros2 launch yolox_ros_py yolox_nano_openvino.launch.py
</details> <details> <summary>C++</summary>

Check this URL.

</details>

<br></br>

Topic

Subscribe

Publish

<!-- - yolox/image_raw : Resized image (`sensor_msgs/Image`) -->

yolox_topic

<br>

Parameters

<br>

Composition

<br>

YOLOX-ROS + ?

<details> <summary>Examples</summary>

Web Camera (v4l2-camera)

ros2 launch yolox_ros_py yolox_nano_onnx.launch.py video_device:=/dev/video0

Unity

yolox_s_result

Gazebo

ros2 launch yolox_ros_py yolox_nano_onnx_gazebo.launch.py

YouTube

# git clone https://github.com/Ar-Ray-code/YOLOX-ROS.git --recursive
vcs import . < YOLOX-ROS/youtube-publisher.repos
pip3 install -r YOLOX-ROS/requirements.txt
pip3 install -r YouTube-publisher-ROS2/requirements.txt
cd ..
colcon build --symlink-install --pacakges-select yolox_ros_py bboxes_ex_msgs youtube_publisher
source install/setup.bash

# run launch.py
ros2 launch yolox_ros_py yolox_nano_onnx_youtube.launch.py

</details> <br>

Reference

@article{yolox2021,
  title={YOLOX: Exceeding YOLO Series in 2021},
  author={Ge, Zheng and Liu, Songtao and Wang, Feng and Li, Zeming and Sun, Jian},
  journal={arXiv preprint arXiv:2107.08430},
  year={2021}
}
<br>

Contributors

<br>

About writer