Skip to content

Commit 65e0270

Browse files
committed
Merge branch 'jazzy' into feat/hailort
2 parents cc9cb28 + 0e2b5cd commit 65e0270

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+827
-2505
lines changed

.github/workflows/ci_iron.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: ci_iron
2+
3+
on:
4+
push:
5+
branches:
6+
- "iron"
7+
pull_request:
8+
types: [opened, synchronize, labeled]
9+
10+
jobs:
11+
ci:
12+
runs-on: ${{ matrix.os }}
13+
container:
14+
image: osrf/ros:${{ matrix.ros_distribution }}-desktop
15+
timeout-minutes: 20
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: [ubuntu-22.04]
20+
ros_distribution: [iron]
21+
steps:
22+
- name: Install OpenVINO
23+
run: |
24+
sudo apt-get update
25+
sudo apt-get install -y wget
26+
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
27+
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
28+
echo "deb https://apt.repos.intel.com/openvino/2024 ubuntu22 main" | sudo tee /etc/apt/sources.list.d/intel-openvino-2024.list
29+
sudo apt-get update
30+
sudo apt install -y openvino-2024.3.0
31+
- uses: actions/checkout@v4
32+
- uses: ros-tooling/setup-ros@v0.7
33+
with:
34+
required-ros-distributions: ${{ matrix.ros_distribution }}
35+
- name: Build and Test
36+
uses: ros-tooling/action-ros-ci@v0.3
37+
with:
38+
target-ros2-distro: ${{ matrix.ros_distribution }}
39+
skip-tests: true
40+
extra-cmake-args: "-DYOLOX_USE_OPENVINO=True"

.github/workflows/ci_jazzy.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: ci_jazzy
2+
3+
on:
4+
push:
5+
branches:
6+
- "jazzy"
7+
pull_request:
8+
types: [opened, synchronize, labeled]
9+
10+
jobs:
11+
ci:
12+
runs-on: ${{ matrix.os }}
13+
container:
14+
image: osrf/ros:${{ matrix.ros_distribution }}-desktop
15+
timeout-minutes: 20
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: [ubuntu-24.04]
20+
ros_distribution: [jazzy]
21+
steps:
22+
- name: Install OpenVINO
23+
run: |
24+
sudo apt-get update
25+
sudo apt-get install -y wget
26+
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
27+
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
28+
echo "deb https://apt.repos.intel.com/openvino/2024 ubuntu24 main" | sudo tee /etc/apt/sources.list.d/intel-openvino-2024.list
29+
sudo apt-get update
30+
sudo apt install -y openvino-2024.3.0
31+
- uses: actions/checkout@v4
32+
- uses: ros-tooling/setup-ros@v0.7
33+
with:
34+
required-ros-distributions: ${{ matrix.ros_distribution }}
35+
- name: Build and Test
36+
uses: ros-tooling/action-ros-ci@v0.3
37+
with:
38+
target-ros2-distro: ${{ matrix.ros_distribution }}
39+
skip-tests: true
40+
extra-cmake-args: "-DYOLOX_USE_OPENVINO=True"

.github/workflows/ci_rolling.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: ci_rolling
2+
3+
on:
4+
push:
5+
branches:
6+
- "rolling"
7+
pull_request:
8+
types: [opened, synchronize, labeled]
9+
10+
jobs:
11+
ci:
12+
runs-on: ${{ matrix.os }}
13+
container:
14+
image: osrf/ros:${{ matrix.ros_distribution }}-desktop
15+
timeout-minutes: 20
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: [ubuntu-24.04]
20+
ros_distribution: [rolling]
21+
steps:
22+
- name: Install OpenVINO
23+
run: |
24+
sudo apt-get update
25+
sudo apt-get install -y wget
26+
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
27+
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
28+
echo "deb https://apt.repos.intel.com/openvino/2024 ubuntu24 main" | sudo tee /etc/apt/sources.list.d/intel-openvino-2024.list
29+
sudo apt-get update
30+
sudo apt install -y openvino-2024.3.0
31+
- uses: actions/checkout@v4
32+
- uses: ros-tooling/setup-ros@v0.7
33+
with:
34+
required-ros-distributions: ${{ matrix.ros_distribution }}
35+
- name: Build and Test
36+
uses: ros-tooling/action-ros-ci@v0.3
37+
with:
38+
target-ros2-distro: ${{ matrix.ros_distribution }}
39+
skip-tests: true
40+
extra-cmake-args: "-DYOLOX_USE_OPENVINO=True"

README.md

Lines changed: 15 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
11
# YOLOX-ROS
22

3-
[YOLOX](https://github.com/Megvii-BaseDetection/YOLOX) + ROS2 Humble demo
3+
![](https://img.shields.io/github/stars/Ar-Ray-code/YOLOX-ROS)
4+
5+
[![iron](https://github.com/Ar-Ray-code/YOLOX-ROS/actions/workflows/ci_iron.yml/badge.svg?branch=iron)](https://github.com/Ar-Ray-code/YOLOX-ROS/actions/workflows/ci_iron.yml)
6+
7+
8+
[YOLOX](https://github.com/Megvii-BaseDetection/YOLOX) + ROS2 Iron demo
49

510
![yolox_s_result](https://github.com/Ar-Ray-code/RenderTexture2ROS2Image/blob/main/images_for_readme/unity-demo.gif?raw=true)
611

712
<div align="center">🔼 Unity + YOLOX-ROS Demo</div>
813

914
## Supported List
1015

11-
> rclcpp is recommended due to its extended support.
12-
1316
| Base | ROS2 C++ |
1417
| --------------- | -------- |
1518
| TensorRT (CUDA) ||
1619
| OpenVINO ||
1720
| ONNX Runtime ||
1821
| TFLite ||
1922

20-
<!-- ### Raspberry Pi4 🍓 + NCS2 + YOLOX-ROS
21-
22-
Good news for studets❗🍓
23-
24-
Check [GitHub Wiki](https://github.com/Ar-Ray-code/YOLOX-ROS/wiki/YOLOX-ROS---Raspbian-(NCS2)) to try YOLOX-ROS. -->
2523

2624
## Installation & Demo (C++)
2725

@@ -39,81 +37,15 @@ Check [this URL](./yolox_ros_cpp/README.md).
3937

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

42-
- bounding_boxes: Output BoundingBoxes like darknet_ros_msgs (`bboxes_ex_msgs/BoundingBoxes`)
43-
44-
※ If you want to use `darknet_ros_msgs` , replace `bboxes_ex_msgs` with `darknet_ros_msgs`.
45-
46-
![yolox_topic](images_for_readme/yolox_topic.png)
47-
48-
<br>
49-
50-
## Parameters
40+
- bounding_boxes (`bboxes_ex_msgs/BoundingBoxes` or `vision_msgs/Detection2DArray`)
41+
- `bboxes_ex_msgs/BoundingBoxes`: Output BoundingBoxes like darknet_ros_msgs
42+
- ※ If you want to use `darknet_ros_msgs` , replace `bboxes_ex_msgs` with `darknet_ros_msgs`.
5143

52-
- Check launch files.
44+
<!-- ![yolox_topic](images_for_readme/yolox_topic.png) -->
5345

5446
<br>
5547

56-
## Composition
57-
58-
- Supports C++ only.
59-
60-
<br>
61-
62-
<!--
63-
## YOLOX-ROS + ?
64-
65-
<details>
66-
<summary>Examples</summary>
67-
68-
### Web Camera (v4l2-camera)
69-
70-
- [yolox_nano_onnx.launch.py](./yolox_ros_py/launch/yolox_nano_onnx_camera.launch.py)
71-
72-
```bash
73-
ros2 launch yolox_ros_py yolox_nano_onnx.launch.py video_device:=/dev/video0
74-
```
75-
76-
![](./images_for_readme/yolox_webcam.png)
77-
78-
### Unity
79-
80-
- [Ar-Ray-code/RenderTexture2ROS2Image](https://github.com/Ar-Ray-code/RenderTexture2ROS2Image)
81-
82-
![yolox_s_result](https://github.com/Ar-Ray-code/RenderTexture2ROS2Image/blob/main/images_for_readme/unity-demo.gif?raw=true)
83-
84-
### Gazebo
85-
86-
- [yolox_nano_onnx_gazebo.launch.py](./yolox_ros_py/launch/yolox_nano_onnx_gazebo.launch.py)
87-
88-
```bash
89-
ros2 launch yolox_ros_py yolox_nano_onnx_gazebo.launch.py
90-
```
91-
92-
![](./images_for_readme/gazebo.png)
93-
94-
### YouTube
95-
96-
- [yolox_nano_onnx_youtube.launch.py](./yolox_ros_py/launch/yolox_nano_onnx_youtube.launch.py)
97-
- [Ar-Ray-code/YouTube-publisher-ROS2](https://github.com/Ar-Ray-code/YouTube-publisher-ROS2)
98-
99-
```bash
100-
# git clone https://github.com/Ar-Ray-code/YOLOX-ROS.git --recursive
101-
vcs import . < YOLOX-ROS/youtube-publisher.repos
102-
pip3 install -r YOLOX-ROS/requirements.txt
103-
pip3 install -r YouTube-publisher-ROS2/requirements.txt
104-
cd ..
105-
colcon build --symlink-install --pacakges-select yolox_ros_py bboxes_ex_msgs youtube_publisher
106-
source install/setup.bash
107-
108-
# run launch.py
109-
ros2 launch yolox_ros_py yolox_nano_onnx_youtube.launch.py
110-
```
111-
112-
![](./images_for_readme/yolox_ydl.png)
113-
114-
</details> -->
115-
116-
<br>
48+
##
11749

11850
## Reference
11951

@@ -133,15 +65,9 @@ ros2 launch yolox_ros_py yolox_nano_onnx_youtube.launch.py
13365
<br>
13466

13567
## Contributors
136-
- [Ar-Ray](https://github.com/Ar-Ray-code)
137-
- [fateshelled](https://github.com/fateshelled)
138-
- [Kazuhito00](https://github.com/Kazuhito00)
139-
- [swiftfile](https://github.com/swiftfile)
14068

141-
<br>
69+
<a href="https://github.com/Ar-Ray-code/YOLOX-ROS/graphs/contributors">
70+
<img src="https://contrib.rocks/image?repo=Ar-Ray-code/YOLOX-ROS" />
71+
</a>
14272

143-
## About writer
144-
145-
- Ar-Ray : Japanese student.
146-
- Blog (Japanese) : https://ar-ray.hatenablog.com/
147-
- Twitter : https://twitter.com/Ray255Ar
73+
<br>

requirements.txt

Lines changed: 0 additions & 14 deletions
This file was deleted.

weights/onnx/download.bash

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
#!/bin/bash
22

3-
# if $1 is empty
4-
if [ -z "$1" ]; then
5-
echo "Usage: $0 <target-model>"
6-
echo "Target-Models :"
7-
echo "yolox_tiny, yolox_nano, yolox_s, yolox_m, yolox_l, all"
8-
exit 1
9-
fi
10-
MODEL=$1
11-
MODEL_VERSION=0.1.1rc0
12-
SCRIPT_DIR=$(cd $(dirname $0); pwd)
3+
function download {
4+
# if $1 is empty
5+
if [ -z "$1" ]; then
6+
echo "Usage: $0 <target-model>"
7+
echo "Target-Models :"
8+
echo "yolox_tiny, yolox_nano, yolox_s, yolox_m, yolox_l, all"
9+
return
10+
fi
11+
MODEL=$1
12+
MODEL_VERSION=0.1.1rc0
13+
SCRIPT_DIR=$(cd $(dirname ${BASH_SOURCE:-$0}); pwd)
1314

14-
echo $MODEL
15-
if [ "$MODEL" = "all" ]; then
16-
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/yolox_tiny.onnx -P $SCRIPT_DIR
17-
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/yolox_nano.onnx -P $SCRIPT_DIR
18-
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/yolox_s.onnx -P $SCRIPT_DIR
19-
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/yolox_m.onnx -P $SCRIPT_DIR
20-
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/yolox_l.onnx -P $SCRIPT_DIR
21-
else
22-
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/$MODEL.onnx -P $SCRIPT_DIR
23-
fi
15+
echo $MODEL
16+
if [ "$MODEL" = "all" ]; then
17+
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/yolox_tiny.onnx -P $SCRIPT_DIR
18+
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/yolox_nano.onnx -P $SCRIPT_DIR
19+
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/yolox_s.onnx -P $SCRIPT_DIR
20+
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/yolox_m.onnx -P $SCRIPT_DIR
21+
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/yolox_l.onnx -P $SCRIPT_DIR
22+
else
23+
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/$MODEL.onnx -P $SCRIPT_DIR
24+
fi
25+
}
26+
27+
download $1

weights/tensorrt/convert.bash

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,34 @@
11
#!/bin/bash
22

3-
# if $1 is empty
4-
if [ -z "$1" ]; then
5-
echo "Usage: $0 <target-model> <workspace>"
6-
echo "Target-Models : yolox_tiny, yolox_nano, yolox_s, yolox_m, yolox_l"
7-
echo "WORKSPACE : GPU memory workspace. Default 16."
8-
exit 1
9-
fi
3+
function convert {
4+
# if $1 is empty
5+
if [ -z "$1" ]; then
6+
echo "Usage: $0 <target-model>"
7+
echo "Target-Models : yolox_tiny, yolox_nano, yolox_s, yolox_m, yolox_l"
8+
return
9+
fi
1010

11-
MODEL=$1
12-
TRT_WORKSPACE=$2
13-
if [ -z "$2" ]; then
14-
TRT_WORKSPACE=16
15-
fi
11+
MODEL=$1
12+
SCRIPT_DIR=$(cd $(dirname ${BASH_SOURCE:-$0}); pwd)
1613

17-
SCRIPT_DIR=$(cd $(dirname $0); pwd)
14+
echo "Model Name: ${MODEL}"
15+
echo ""
1816

19-
echo "Model Name: ${MODEL}"
20-
echo "Workspace size: ${TRT_WORKSPACE}"
21-
echo ""
17+
ONNX_MODEL_PATH=$SCRIPT_DIR/../onnx/$MODEL.onnx
18+
if [ ! -e $ONNX_MODEL_PATH ]; then
19+
$SCRIPT_DIR/../onnx/download.bash $MODEL
20+
fi
2221

23-
ONNX_MODEL_PATH=$SCRIPT_DIR/../onnx/$MODEL.onnx
24-
if [ ! -e $ONNX_MODEL_PATH ]; then
25-
$SCRIPT_DIR/../onnx/download.bash $MODEL
26-
fi
22+
if [ ! -e $ONNX_MODEL_PATH ]; then
23+
echo "[ERROR] Not Found ${ONNX_MODEL_PATH}"
24+
echo "[ERROR] Please check target model name."
25+
return
26+
fi
2727

28-
if [ ! -e $ONNX_MODEL_PATH ]; then
29-
echo "[ERROR] Not Found ${ONNX_MODEL_PATH}"
30-
echo "[ERROR] Please check target model name."
31-
exit 1
32-
fi
28+
/usr/src/tensorrt/bin/trtexec \
29+
--onnx=$SCRIPT_DIR/../onnx/$MODEL.onnx \
30+
--saveEngine=$SCRIPT_DIR/$MODEL.trt \
31+
--fp16 --verbose
32+
}
3333

34-
/usr/src/tensorrt/bin/trtexec \
35-
--onnx=$SCRIPT_DIR/../onnx/$MODEL.onnx \
36-
--saveEngine=$SCRIPT_DIR/$MODEL.trt \
37-
--fp16 --verbose --workspace=$((1<<$TRT_WORKSPACE))
34+
convert $1

0 commit comments

Comments
 (0)