YOLOX + ROS2 object detection package

Overview

YOLOX-ROS

YOLOX+ROS2 Foxy

yolox_s_result

Supported List

Base ROS1 C++ ROS1 Python ROS2 C++ ROS2 Python
CPU
CUDA
CUDA (FP16)
TensorRT (CUDA)
OpenVINO
MegEngine
ncnn

Installation & Demo

Python (PyTorch)

Requirements

Installation

Install the dependent packages based on all tutorials.

STEP 1 : YOLOX Quick-start

YOLOX Quick-start (Python)

git clone https://github.com/Megvii-BaseDetection/YOLOX
cd YOLOX
pip3 install -U pip && pip3 install -r requirements.txt
pip3 install -v -e .  # or  python3 setup.py develop
pip3 install cython; pip3 install 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'

STEP 2 : Install YOLOX-ROS

source /opt/ros/foxy/setup.bash
sudo apt install ros-foxy-v4l2-camera
git clone --recursive https://github.com/Ar-Ray-code/yolox_ros.git ~/ros2_ws/src/yolox_ros/
cd ~/ros2_ws
colcon build --symlink-install # weights files will be installed automatically.

(Step 2) Using CUDA

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

Additional installing lists

  • NVIDIA Graphics Driver
  • CUDA toolkit (11.0)
  • torch+cuda

Step3 : Demo

Connect your web camera.

source /opt/ros/foxy/setup.bash
source ~/ros2_ws/install/local_setup.bash
ros2 launch yolox_ros_py yolox_s_cpu.launch.py
# ros2 launch yolox_ros_py yolox_s.launch.py # <- GPU
C++ (OpenVINO)

Requirements

Step1 : Installation

source /opt/ros/foxy/setup.bash
sudo apt install ros-foxy-v4l2-camera

source /opt/intel/openvino_2021/bin/setupvars.sh
cd ~/ros2_ws/src
git clone --recursive https://github.com/Ar-Ray-code/YOLOX-ROS.git
# Download onnx file and Convert to IR format.
./YOLOX-ROS/weights/openvino/install.bash yolox_nano

Step2 : Demo

Connect your web camera.

source /opt/ros/foxy/setup.bash
source ~/ros2_ws/install/local_setup.bash
ros2 launch yolox_ros_cpp yolox_openvino.launch.py
C++ (TensorRT)

Docker Images is Released.

Topic

Subscribe

  • image_raw (sensor_msgs/Image)

Publish

  • yolox/image_raw : Resized image (sensor_msgs/Image)

  • yololx/bounding_boxes : Output BoundingBoxes like darknet_ros_msgs (bboxes_ex_msgs/BoundingBoxes)

    ※ If you want to use darknet_ros_msgs , replace bboxes_ex_msgs with darknet_ros_msgs.

yolox_topic

Parameters

  • Check launch files.

Composition

  • Supports C++ only.

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}
}

Contributors

About writer

Issues
  • Run in melodic

    Run in melodic

    Sorry, I want to ask how this project works on melodic. I reported an error directly to catkin make. Before catkin make, I executed the following two commands to use Python 3 catkin config -DPYTHON_EXECUTABLE=/usr/bin/python3 -DPYTHON_INCLUDE_DIR=/usr/include/python3.6m -DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.6m.so

    catkin config --instal Screenshot from 2022-03-08 19-35-00 l

    opened by hongSS0919 15
  • update docs about YOLOX_ROS_CPP

    update docs about YOLOX_ROS_CPP

    Thanks to this repository, I tried to this node easily! But, I need extra procedures to run this node completely. Specifically,When I tried to run yolox_ros(w/docker, tensorRT) following this instruction( yolox_ros_cpp/README.md), I need to install extra dependency not specified in its instruction.

    pip install empy
    pip install catkin_pkg
    pip install lark
    apt install ros-foxy-cv-bridge
    

    So I suggest to use my new dockerimage(swiftfile/tensorrt_yolox_ros).

    Thank you for all contributors of this repository! And, I'm glad to create PR for this repo.

    opened by swiftfile 6
  • Update node parameter

    Update node parameter

    Change

    • Delete parameter image_size/width and image_size/height.
      • Changed to automatically get the parameter .
    • Add parameter model_version.
      • Inference preprocess is different between 0.1.0 and 0.1.1rc.
      • Changed to switch preprocessing depending on model_version.
    enhancement 
    opened by fateshelled 4
  • Add TensorRT C++ Support

    Add TensorRT C++ Support

    Add TensorRT C++ support

    Changes

    • Renamed yolox_openvino package to yolox_cpp, and added code for TensorRT.
    • Changed yolox_ros_cpp node parameter to switch between OpenVINO and TensorRT.
    • Add docker support.

    Test

    I tested following condition.

    • Intel Core i5-11400F
    • Geforce RTX3060
    • docker container ( on WSL2 Ubuntu20.04, Windows 11 Pro Insider preview. )
      • fateshelled/tensorrt_yolox_ros:latest
        • Ubuntu 20.04
        • TensorRT 8.0.3
        • NVIDIA CUDA 11.4.2
        • NVIDIA cuDNN 8.2.4.15
        • ROS foxy (installed via Debian Packages)

    I tested TensorRT on docker container only.

    enhancement 
    opened by fateshelled 4
  • How to use this in Ros Melodic?

    How to use this in Ros Melodic?

    Hi!Thanks for your awsome contribution. if i want to compile and use this code in ubuntu 18.04&Ros Melodic,should i change something? hoping your reply! こんにちは!あなたの素晴らしい貢献に感謝します。 このコードをubuntu18.04Ros Melodicでコンパイルして使用したい場合、何かを変更する必要がありますか? お返事をお待ちしております!

    opened by feelinggxj 4
  • Add Jetson Docker Support

    Add Jetson Docker Support

    Add Jetson Docker Support

    Change

    • Jetson docker support.
      • Add dockerfile.
      • docker image: fateshelled/jetson_yolox_ros:foxy-ros-base-l4t-r32.6.1
    • Change launch.py parameter.
      • delete parameter yaml file and add launch arguments.
    • Add yolox_openvino_ncs2.launch.py for NCS2
      • please edit Wiki.
    • Change onnx model file version 0.1.1rc to 0.1.0.
      • 0.1.1rc model was converted to tensorrt engine, but no objects were detected in my environments. 0.1.0model successfully converted and objects were detected.

    Test

    I tested following condition.

    • Jetson Nano 4GB
    • Jetpack 4.6
    enhancement 
    opened by fateshelled 3
  • Add yolox_ros_cpp for ROS2 Foxy

    Add yolox_ros_cpp for ROS2 Foxy

    Add yolox_ros_cpp for ROS2 Foxy

    add 2 packages.

    yolox_openvino

    • YOLOX ( OpenVINO ) C++ shared library.
    • This library was created based on the code in following URL.
      • https://github.com/Megvii-BaseDetection/YOLOX/blob/5183a6716404bae497deb142d2c340a45ffdb175/demo/OpenVINO/cpp/yolox_openvino.cpp

    yolox_ros_cpp

    • YOLOX C++ Components Node.
    • This node uses yolox_openvino library.

    Test

    I tested following condition.

    • Intel Core i7-8550U
    • Ubuntu 20.04
    • OpenVINO 2021.4.582
    • ROS Foxy (installed via Debian Packages)
    enhancement 
    opened by fateshelled 3
  • Some trouble in running

    Some trouble in running

    Hi,when i running the program , i got some trouble

    Could not import "pyqt" bindings of qt_gui_cpp library - so C++ plugins will not be available: Traceback (most recent call last): File "/opt/ros/melodic/lib/python2.7/dist-packages/qt_gui_cpp/cpp_binding_helper.py", line 43, in from . import libqt_gui_cpp_sip ImportError: dynamic module does not define module export function (PyInit_libqt_gui_cpp_sip)

    libgcc_s.so.1 must be installed for pthread_cancel to work

    i had already installed the pyqt , how can i solve it ? Thanks!

    opened by geekfuns 3
  • bugs in bbox

    bugs in bbox

    -- ~~  - bboxes_ex_msgs (plain cmake)
    -- ~~  - yolox_ros_py
    -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    CMake Error at /opt/ros/noetic/share/catkin/cmake/catkin_workspace.cmake:100 (message):
      This workspace contains non-catkin packages in it, and catkin cannot build
      a non-homogeneous workspace without isolation.  Try the
      'catkin_make_isolated' command instead.
    Call Stack (most recent call first):
      CMakeLists.txt:69 (catkin_workspace)
    
    opened by cuge1995 3
  • error: variable ‘std::ifstream file’ has initializer but incomplete type

    error: variable ‘std::ifstream file’ has initializer but incomplete type

    Report bug on Jetson(Ubuntu18)

    yolox_tensorrt.cpp:16:28: error: variable ‘std::ifstream file’ has initializer but incomplete type
             std::ifstream file(path_to_engine, std::ios::binary);
    
    bug 
    opened by Ar-Ray-code 2
  • No module named 'bboxes_ex_msgs'

    No module named 'bboxes_ex_msgs'

    Hi, I try to run the demo of python version and want to check the result by typing "ros2 topic echo /yolox/bounding_boxes", but it shows "No module named 'bboxes_ex_msgs". I don't know why, please have a look , thank you very much! 1

    opened by guo1104b 2
Releases(v0.3.1)
  • v0.3.1(May 9, 2022)

    Japanese

    作成後、多くのスターおよびフォークを頂けてうれしい限りです。ありがとうございます。

    GitHub Sponsorsで支援して頂ければ開発とメンテナンスの励みになります!

    ---更新---

    • yolox_ros_py_utils/utils.pyを作成し、モジュール分割を行いました。共通部分のソースコードをまとめてわかりやすくすることが目的です。
    • Gazeboのデモプログラムを追加しました。yolox_nano_onnx_gazebo.launch.py
    • yolox_ros_pyのLaunchファイルの命名を変更しました。yolox_"モデルの種類"_"計算機のタイプ"_"接続元".launch.pyとなっています。
    • yolox_ros_pyのboundingboxのトピック名がyolox/boundingboxesからboundingboxesに変更されました。
    • RaspberryPi4のCPU推論をターゲットにしたyoloxのPerson検出用TFLiteモデルPerson-Detection-using-RaspberryPi-CPUのデモプログラムを追加しました。yolox_lite_tflite_camera.launch.py
    • ReadmeにYOLOX-ROS + ?を追加しました。

    English

    We are very happy to receive many stars and forks since its creation. Thank you very much.

    Please support us on GitHub Sponsors to encourage development and maintenance!

    ---Update ----



    Contributors

    Source code(tar.gz)
    Source code(zip)
  • v0.3.0(Apr 26, 2022)

    Japanese

    作成後、多くのスターおよびフォークを頂けてうれしい限りです。ありがとうございます。

    GitHub Sponsorsで支援して頂ければ開発とメンテナンスの励みになります!

    全てのバージョンにおいて、挙動はyolox_ros.pyを標準としています。すべてのソースコード(スクリプト)のメンテナンスは行っていないため、気になるところがあればissueなどで教えてください。

    ---更新---

    • yolo_ros_pyのデモプログラムをyolox_sからyolox_nanoに変更
    • ダウンロードされる重みの変更。以下は自動でダウンロードされる重み
      • yolox_nano.pth
      • yolox_nano.onnx
    • ONNX Runtimeのサポート
    • yolox_ros_cppにおいてパラメータ image_size/widthimage_size/height の削除
      • この変更以降、trtexecによる量子化が推奨され、torch2trtの使用は非推奨となりました。
    • yoloxのpipインストール対応

    English

    I'm glad to get so many stars and forks after creating it. Thank you for your support.

    If you can help me with GitHub Sponsors, it will encourage me to develop and maintain it!

    In all versions, the standard behavior is yolox_ros.py The behavior is standard in all versions. I do not maintain all the source code (scripts), so if you have any concerns, please let me know via issues.

    ---Update---

    • Changed yolo_ros_py demo program from yolox_s to yolox_nano.
    • Change of downloaded weights. The following are the weights that are downloaded automatically
      • yolox_nano.pth
      • yolox_nano.onnx
    • Support for ONNX Runtime
    • Removal of parameters image_size/width and image_size/height in yolox_ros_cpp.
      • After this change, quantization with trtexec is recommended and use of torch2trt is deprecated.
    • Support for pip installation of yolox

    Supported YOLOX version

    Contributors

    Source code(tar.gz)
    Source code(zip)
  • v0.2.1(Mar 26, 2022)

    Japanese

    作成後、多くのスターおよびフォークを頂けてうれしい限りです。ありがとうございます。

    GitHub Sponsorsで支援して頂ければ開発とメンテナンスの励みになります!

    全てのバージョンにおいて、挙動はyolox_ros.pyを標準としています。すべてのソースコード(スクリプト)のメンテナンスは行っていないため、気になるところがあればissueなどで教えてください。

    ---更新---

    • yolox_ros_py/yolox_ros.pyのパラメータの変更

      • 削除:yolo_type(default: yolox-s

      • 追加:yolox_exp_py (default: '')

      • 実行のためには exps/default/yolox_s.py のようなファイルパスを引数で指定する必要があります。インストール手順が正しければ、share/以下にインストールされます。これは、カスタムトレーニングモデルの使用を想定しています。

            yolox_ros_share_dir = get_package_share_directory('yolox_ros_py')
        
            yolox_ros = launch_ros.actions.Node(
                package="yolox_ros_py", executable="yolox_ros",
                parameters=[
                    {"image_size/width": 640},
                    {"image_size/height": 480},
                    {"yolox_exp_py" : yolox_ros_share_dir+'/yolox_s.py'},
                    {"device" : 'cpu'},
                    {"fp16" : True},
                    {"fuse" : False},
                    {"legacy" : False},
                    {"trt" : False},
                    {"ckpt" : yolox_ros_share_dir+"/yolox_s.pth"},
                    {"conf" : 0.3},
                    {"threshold" : 0.65},
                    {"resize" : 640},
                ],
            )
        
    • Python + OpenVINO がv0.2.0上でも動作するように修正を行いました。

    • YOLOXの自動インストールスクリプトの追加をしました。

      • bash YOLOX-ROS/yolox_ros_py/install_yolox_py.bashを実行することでダウンロードできます。
    • launch.pyやparamの追加・削除を行いました。

    • yolox_ros_cpp の Jetson Nano対応を行いました。(貢献:fateshelled

    English

    I'm glad to get so many stars and forks after creating it. Thank you for your support.

    If you can help me with GitHub Sponsors, it will encourage me to develop and maintain it!

    In all versions, the standard behavior is yolox_ros.py The behavior is standard in all versions. I do not maintain all the source code (scripts), so if you have any concerns, please let me know via issues.

    ---Update---

    • Change parameters in yolox_ros_py/yolox_ros.py

      • Remove: yolo_type (default: yolox-s)

      • Add: yolox_exp_py (default: '')

      • For execution, specify a file path like exps/default/yolox_s.py as an argument The following is a list of the most common problems with the system. If the installation procedure is correct, it will be installed under share/. This assumes using a custom training model.

           yolox_ros_share_dir = get_package_share_directory('yolox_ros_py')
        
            yolox_ros = launch_ros.actions.Node(
                package="yolox_ros_py", executable="yolox_ros",
                parameters=[
                    {"image_size/width": 640},
                    {"image_size/height": 480},
                    {"yolox_exp_py" : yolox_ros_share_dir+'/yolox_s.py'},
                    {"device" : 'cpu'},
                    {"fp16" : True},
                    {"fuse" : False},
                    {"legacy" : False},
                    {"trt" : False},
                    {"ckpt" : yolox_ros_share_dir+"/yolox_s.pth"},
                    {"conf" : 0.3},
                    {"threshold" : 0.65},
                    {"resize" : 640},
                ],
            )
        
    • Python + OpenVINO has been modified to work on v0.2.0.

    • Added an automatic installation script for YOLOX.

      • You can download it by running bash YOLOX-ROS/yolox_ros_py/install_yolox_py.bash.
    • Added/removed launch.py and param.

    • Added Jetson Nano support for yolox_ros_cpp. (Contributed by fateshelled)

    Supported YOLOX version

    Contributors

    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Jan 31, 2022)

    Japanese

    作成後、多くのスターおよびフォークを頂けてうれしい限りです。ありがとうございます。

    GitHub Sponsorsで支援して頂ければ開発とメンテナンスの励みになります!

    全てのバージョンにおいて、挙動はyolox_ros.pyを標準としています。すべてのソースコード(スクリプト)のメンテナンスは行っていないため、気になるところがあればissueなどで教えてください。

    ---更新---

    • YOLOX-v0.2.0への更新に合わせてドキュメントを更新しました。
    • yolox-ros.pyのパラメータを大きく更新しました。
    • yolox-ros.pyの細かな不具合を修正しました。

    English

    I'm glad to get so many stars and forks after creating it. Thank you for your support.

    If you can help me with GitHub Sponsors, it will encourage me to develop and maintain it!

    In all versions, the standard behavior is yolox_ros.py The behavior is standard in all versions. I do not maintain all the source code (scripts), so if you have any concerns, please let me know via issues.

    ---Update---

    Translated with www.DeepL.com/Translator (free version)

    Contributors

    Source code(tar.gz)
    Source code(zip)
    yolox_tiny.bin(9.62 MB)
    yolox_tiny.xml(250.11 KB)
  • v0.1.0(Oct 19, 2021)

    ⚠️ There is a LICENSE problme in this release, but this LICENSE will not be changed. (This LICENSE is in accordance with YOLOX.) Check #4 .

    Source code(tar.gz)
    Source code(zip)
Owner
Ar-Ray
1st grade of National Institute of Technology(=Kosen) student. Associate degree
Ar-Ray
Training and fine-tuning YOLOv4 Tiny on custom object detection dataset for Taiwanese traffic

Object Detection on Taiwanese Traffic using YOLOv4 Tiny Exploration of YOLOv4 Tiny on custom Taiwanese traffic dataset Trained and tested AlexeyAB's D

Andrew Chen 3 Mar 7, 2022
Official PyTorch Code of GrooMeD-NMS: Grouped Mathematically Differentiable NMS for Monocular 3D Object Detection (CVPR 2021)

GrooMeD-NMS: Grouped Mathematically Differentiable NMS for Monocular 3D Object Detection GrooMeD-NMS: Grouped Mathematically Differentiable NMS for Mo

Abhinav Kumar 73 Jun 22, 2022
UAV images dataset for moving object detection

PESMOD PESMOD (PExels Small Moving Object Detection) dataset consists of high resolution aerial images in which moving objects are labelled manually.

İbrahim Delibaşoğlu 30 May 9, 2022
Object Based Generic Perception Object Model

This model is a highly parameterizable generic perception sensor and tracking model. It can be parameterized as a Lidar or a Radar. The model is based on object lists and all modeling is performed on object level.

TU Darmstadt - FZD 5 Jun 11, 2022
A project demonstration on how to use the GigE camera to do the DeepStream Yolo3 object detection

A project demonstration on how to use the GigE camera to do the DeepStream Yolo3 object detection, how to set up the GigE camera, and deployment for the DeepStream apps.

NVIDIA AI IOT 7 May 27, 2022
Real-time object detection with YOLOv5 and TensorRT

YOLOv5-TensorRT The goal of this library is to provide an accessible and robust method for performing efficient, real-time inference with YOLOv5 using

Noah van der Meer 19 Jun 26, 2022
Port of the 2020 support library to Raspberry Pi for the VL53L3CX Time-of-Flight ranging sensor with advanced multi-object detection

Port of ST VL53L3CX (2020) driver library to Raspberry Pi This is a port of the support library to Raspberry Pi for the VL53L3CX Time-of-Flight rangin

Niall Douglas 3 May 18, 2022
deploy yolox algorithm use deepstream

YOLOX(Megvii-BaseDetection) Deploy DeepStream ?? ?? This project base on https://github.com/Megvii-BaseDetection/YOLOX and https://zhuanlan.zhihu.com/

null 74 Jun 13, 2022
Lite.AI 🚀🚀🌟 is a user-friendly C++ lib for awesome🔥🔥🔥 AI models based on onnxruntime, ncnn or mnn. YOLOX, YoloV5, YoloV4, DeepLabV3, ArcFace, CosFace, Colorization, SSD

Lite.AI ?????? is a user-friendly C++ lib for awesome?????? AI models based on onnxruntime, ncnn or mnn. YOLOX??, YoloV5??, YoloV4??, DeepLabV3??, ArcFace??, CosFace??, Colorization??, SSD??, etc.

Def++ 1.7k Jun 27, 2022
Lite.AI 🚀🚀🌟 is a user friendly C++ lib of 60+ awesome AI models. YOLOX🔥, YoloV5🔥, YoloV4🔥, DeepLabV3🔥, ArcFace🔥, CosFace🔥, RetinaFace🔥, SSD🔥, etc.

Lite.AI ?? ?? ?? Introduction. Lite.AI ?? ?? ?? is a simple and user-friendly C++ library of awesome ?? ?? ?? AI models. It's a collection of personal

Def++ 1.7k Jul 2, 2022
Android yolox hand detect by ncnn

The yolox hand detection This is a sample ncnn android project, it depends on ncnn library and opencv https://github.com/Tencent/ncnn https://github.c

FeiGeChuanShu 11 Apr 1, 2022
Lite.AI.ToolKit 🚀🚀🌟: A lite C++ toolkit of awesome AI models such as RobustVideoMatting🔥, YOLOX🔥, YOLOP🔥 etc.

Lite.AI.ToolKit ?? ?? ?? : A lite C++ toolkit of awesome AI models which contains 70+ models now. It's a collection of personal interests. Such as RVM, YOLOX, YOLOP, YOLOR, YoloV5, DeepLabV3, ArcFace, etc.

DefTruth 1.7k Jun 27, 2022
YoloX for a Jetson Nano 4 using ncnn.

YoloX Jetson Nano YoloX with the ncnn framework. Paper: https://arxiv.org/pdf/2107.08430.pdf Special made for a Jetson Nano, see Q-engineering deep le

Q-engineering 7 May 25, 2022
YoloX for a bare Raspberry Pi 4 using ncnn.

YoloX Raspberry Pi 4 YoloX with the ncnn framework. Paper: https://arxiv.org/pdf/2107.08430.pdf Special made for a bare Raspberry Pi 4, see Q-engineer

Q-engineering 5 Jun 24, 2022
ROS2 packages based on NVIDIA libArgus library for hardware-accelerated CSI camera support.

Isaac ROS Argus Camera This repository provides monocular and stereo nodes that enable ROS developers to use cameras connected to Jetson platforms ove

NVIDIA Isaac ROS 26 Jul 1, 2022
Hardware-accelerated DNN model inference ROS2 packages using NVIDIA Triton/TensorRT for both Jetson and x86_64 with CUDA-capable GPU.

Isaac ROS DNN Inference Overview This repository provides two NVIDIA GPU-accelerated ROS2 nodes that perform deep learning inference using custom mode

NVIDIA Isaac ROS 36 Jun 20, 2022
ROS2 / Ignition Gazebo Gym Environment for Reproducible Reinforcement Learning

ROS2/Ignition Gazebo Environment for Reinforcement Learning

Nicholas José Palomo 3 Dec 11, 2021
YOLOV4 tiny + lane detection on Android with 8 FPS!

YOLOV4 Tiny + Ultra fast lane detection on Android with 8 FPS! Tested with HONOR 20PRO Kirin 980

yq-pan 12 May 11, 2022