Skip to content

Commit 282c8e6

Browse files
committed
update readme
1 parent 7897707 commit 282c8e6

2 files changed

Lines changed: 60 additions & 127 deletions

File tree

README.md

Lines changed: 9 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# YOLOX-ROS
22

3-
[YOLOX](https://github.com/Megvii-BaseDetection/YOLOX) + ROS2 Foxy demo
3+
[YOLOX](https://github.com/Megvii-BaseDetection/YOLOX) + ROS2 Humble demo
44

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

@@ -10,13 +10,12 @@
1010

1111
> rclcpp is recommended due to its extended support.
1212
13-
| Base | ROS2 C++ | ROS2 Python |
14-
| --------------- | -------- | ----------- |
15-
| PyTorch | ||
16-
| TensorRT (CUDA) || |
17-
| OpenVINO |||
18-
| ONNX Runtime |||
19-
| TFLite |||
13+
| Base | ROS2 C++ |
14+
| --------------- | -------- |
15+
| TensorRT (CUDA) ||
16+
| OpenVINO ||
17+
| ONNX Runtime | |
18+
| TFLite | |
2019

2120
<!-- ### Raspberry Pi4 🍓 + NCS2 + YOLOX-ROS
2221
@@ -25,88 +24,6 @@ Good news for studets❗🍓
2524
Check [GitHub Wiki](https://github.com/Ar-Ray-code/YOLOX-ROS/wiki/YOLOX-ROS---Raspbian-(NCS2)) to try YOLOX-ROS. -->
2625

2726
## Installation & Demo
28-
<details>
29-
<summary>Python (PyTorch)</summary>
30-
31-
## Requirements
32-
33-
- ROS2 Foxy
34-
- OpenCV 4
35-
- Python 3.8 (Ubuntu 20.04 Default)
36-
- PyTorch >= v1.7
37-
- [YOLOX v0.3.0](https://github.com/Megvii-BaseDetection/YOLOX)
38-
- [bbox_ex_msgs](https://github.com/Ar-Ray-code/bbox_ex_msgs)
39-
40-
## Installation
41-
42-
Install the dependent packages based on all tutorials.
43-
44-
### STEP 1 : Download from GitHub
45-
46-
```bash
47-
mkdir -p ~/ros2_ws/src
48-
cd ~/ros2_ws/src
49-
git clone https://github.com/Ar-Ray-code/yolox_ros.git --recursive
50-
```
51-
52-
### STEP 2 : YOLOX Installation (yolox_ros_py)
53-
54-
For more information, see the [YOLOX](https://github.com/Megvii-BaseDetection/YOLOX#quick-start) installation documentation.
55-
56-
57-
```bash
58-
pip3 install yolox
59-
```
60-
61-
### STEP 3 : Install YOLOX-ROS
62-
63-
```bash
64-
source /opt/ros/foxy/setup.bash
65-
sudo apt install ros-foxy-v4l2-camera
66-
# source /opt/intel/openvino_2021/bin/setupvars.sh # <- Using OpenVINO
67-
colcon build --symlink-install # weights (YOLOX-Nano) files will be installed automatically.
68-
```
69-
70-
**Automatic download weights**
71-
72-
- yolox_nano.onnx by [Megvii-BaseDetection/YOLOX](https://github.com/Megvii-BaseDetection/YOLOX)
73-
- yolox_nano.pth by [Megvii-BaseDetection/YOLOX](https://github.com/Megvii-BaseDetection/YOLOX)
74-
- model.onnx by [Kazuhito00](https://github.com/Kazuhito00/Person-Detection-using-RaspberryPi-CPU)
75-
- model.tflite by [Kazuhito00](https://github.com/Kazuhito00/Person-Detection-using-RaspberryPi-CPU)
76-
77-
### (Step 3) Using CUDA
78-
79-
If you have NVIDIA Graphics, you can run YOLOX-ROS on GPU.
80-
81-
**Additional installing lists**
82-
83-
- NVIDIA Graphics Driver
84-
- CUDA toolkit (11.0)
85-
- torch+cuda
86-
87-
```bash
88-
source /opt/ros/foxy/setup.bash
89-
sudo apt install ros-foxy-v4l2-camera
90-
colcon build --symlink-install # weights (YOLOX-Nano) files will be installed automatically.
91-
```
92-
93-
### Step : Demo
94-
95-
Connect your web camera.
96-
97-
```bash
98-
source /opt/ros/foxy/setup.bash
99-
source ~/ros2_ws/install/local_setup.bash
100-
ros2 launch yolox_ros_py yolox_nano_torch_cpu_camera.launch.py # <- CPU (PyTorch)
101-
# ros2 launch yolox_ros_py yolox_nano_torch_gpu_camera.launch.py # <- GPU (PyTorch)
102-
# ros2 launch yolox_ros_py yolox_nano_onnx_camera.launch.py # <- ONNXRuntime
103-
104-
# OpenVINO -------------------------------------
105-
# source /opt/intel/openvino_2021/bin/setupvars.sh
106-
# ros2 launch yolox_ros_py yolox_nano_openvino.launch.py
107-
```
108-
109-
</details>
11027

11128
<details>
11229
<summary>C++</summary>
@@ -147,6 +64,7 @@ Check [this URL](./yolox_ros_cpp/README.md).
14764

14865
<br>
14966

67+
<!--
15068
## YOLOX-ROS + ?
15169
15270
<details>
@@ -198,7 +116,7 @@ ros2 launch yolox_ros_py yolox_nano_onnx_youtube.launch.py
198116
199117
![](./images_for_readme/yolox_ydl.png)
200118
201-
</details>
119+
</details> -->
202120

203121
<br>
204122

yolox_ros_cpp/README.md

Lines changed: 51 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
## Usage
44

55
### Requirements
6-
- ROS2 Foxy
6+
- ROS2 Humble
77
- OpenCV 4.x
88
- OpenVINO 2021.*
99
- TensorRT 8.x *
10-
- ONNXRuntime *
11-
- Tensorflow Lite *
10+
<!-- - ONNXRuntime * -->
11+
<!-- - Tensorflow Lite * -->
1212

1313
※ Either one of OpenVINO or TensorRT or ONNXRuntime or Tensorflow Lite is required.
1414

15-
※ ONNXRuntime support CPU or CUDA execute provider.
15+
<!-- ※ ONNXRuntime support CPU or CUDA execute provider.
1616
1717
※ Tensorflow Lite support XNNPACK Delegate only.
1818
19-
※ Tensorflow Lite support float model and does not support integer model.
19+
※ Tensorflow Lite support float model and does not support integer model. -->
2020

2121
※ Model convert script is not supported OpenVINO 2022.*
2222

@@ -25,7 +25,11 @@
2525
※ Jetson + TensorRT docker support (Jetpack 4.6 r32.6.1). Tested with Jetson Nano 4GB.
2626

2727

28-
### Execute with docker
28+
29+
30+
<details>
31+
<summary>Execute with docker</summary>
32+
2933

3034
#### OpenVINO
3135
```bash
@@ -115,20 +119,21 @@ docker run --rm -it \
115119
/bin/bash
116120
```
117121

122+
</details>
123+
118124
### Clone YOLOX-ROS
119125
```bash
120126
cd ~/ros2_ws/src
121-
git clone --recursive https://github.com/fateshelled/YOLOX-ROS -b dev_cpp
127+
git clone --recursive https://github.com/Ar-Ray-code/YOLOX-ROS -b humble
122128
```
123129

124-
125130
### Model Convert or Download
126131
#### OpenVINO
127132
```bash
128133
cd ~/ros2_ws
129134

130135
# Download onnx file and convert to IR format.
131-
./src/YOLOX-ROS/weights/openvino/install.bash yolox_nano
136+
./src/YOLOX-ROS/weights/openvino/install.bash yolox_tiny
132137
```
133138

134139
#### TensorRT
@@ -137,7 +142,7 @@ cd ~/ros2_ws
137142

138143
# Download onnx model and convert to TensorRT engine.
139144
# 1st arg is model name. 2nd is workspace size.
140-
./src/YOLOX-ROS/weights/tensorrt/convert.bash yolox_nano 16
145+
./src/YOLOX-ROS/weights/tensorrt/convert.bash yolox_tiny 16
141146
```
142147

143148
#### ONNXRuntime
@@ -146,10 +151,10 @@ cd ~/ros2_ws
146151
source /opt/ros/foxy/setup.bash
147152

148153
# Download onnx model
149-
./src/YOLOX-ROS/weights/onnx/download.bash yolox_nano
154+
./src/YOLOX-ROS/weights/onnx/download.bash yolox_tiny
150155
```
151156

152-
#### Tensorflow Lite
157+
<!-- #### Tensorflow Lite
153158
```bash
154159
cd ~/ros2_ws
155160
@@ -165,27 +170,18 @@ cd ~/ros2_ws
165170
- `curl -s https://raw.githubusercontent.com/PINTO0309/PINTO_model_zoo/main/132_YOLOX/download_nano.sh | bash`
166171
167172
- ONNX model copy to weight dir
168-
- `cp resouces_new/saved_model_yolox_nano_480x640/yolox_nano_480x640.onnx ./src/YOLOX-ROS/weights/onnx/`
173+
- `cp resouces_new/saved_model_yolox_tiny_480x640/yolox_tiny_480x640.onnx ./src/YOLOX-ROS/weights/onnx/`
169174
170175
- Convert to TensorRT engine
171-
- `./src/YOLOX-ROS/weights/tensorrt/convert.bash yolox_nano_480x640`
176+
- `./src/YOLOX-ROS/weights/tensorrt/convert.bash yolox_tiny_480x640`
172177
173178
- tflite model copy to weight dir
174-
- `cp resouces_new/saved_model_yolox_nano_480x640/model_float32.tflite ./src/YOLOX-ROS/weights/tflite/`
179+
- `cp resouces_new/saved_model_yolox_tiny_480x640/model_float32.tflite ./src/YOLOX-ROS/weights/tflite/` -->
175180

176-
### build packages
177-
```bash
178-
# # If use openvino
179-
# source /opt/intel/openvino_2021/bin/setupvars.sh
180181

181-
cd ~/ros2_ws
182-
source /opt/ros/foxy/setup.bash
183-
colcon build --symlink-install
184-
source ./install/setup.bash
185-
```
186182

187183

188-
#### build yolox_ros_cpp with tflite
184+
<!-- #### build yolox_ros_cpp with tflite
189185
190186
##### build tflite
191187
https://www.tensorflow.org/lite/guide/build_cmake
@@ -206,9 +202,28 @@ cmake ../tensorflow_src/tensorflow/lite \
206202
-DCMAKE_BUILD_TYPE=Release
207203
208204
make -j"$(nproc)"
205+
``` -->
206+
207+
### Build
208+
209+
#### OpenVINO
210+
211+
```bash
212+
# build with openvino
213+
source /opt/ros/humble/setup.bash
214+
source /opt/intel/openvino_2021/bin/setupvars.sh
215+
colcon build --cmake-args -DYOLOX_USE_OPENVINO=ON
216+
```
217+
218+
#### TensorRT
219+
220+
```bash
221+
# build with tensorrt
222+
source /opt/ros/humble/setup.bash
223+
colcon build --cmake-args -DYOLOX_USE_TENSORRT=ON
209224
```
210225

211-
##### build ros package with tflite
226+
<!-- ##### build ros package with tflite
212227
213228
This is build script when tflite built as above.
214229
@@ -222,13 +237,13 @@ colcon build --symlink-install \
222237
-DTFLITE_INCLUDE_DIR=${workspace}/tensorflow_src \
223238
-DABSEIL_CPP_ICLUDE_DIR=${workspace}/tflite_build/abseil-cpp \
224239
-DFLATBUFFERS_INCLUDE_DIR=${workspace}/tflite_build/flatbuffers/include
225-
```
240+
``` -->
226241

227242
### Run
228243

229244
#### OpenVINO
230245
```bash
231-
# run YOLOX_nano
246+
# run yolox_tiny
232247
ros2 launch yolox_ros_cpp yolox_openvino.launch.py
233248

234249
# run other model
@@ -238,7 +253,7 @@ ros2 launch yolox_ros_cpp yolox_openvino.launch.py \
238253
# run PINTO_model_zoo model
239254
# This model is converted from version 0.1.0.
240255
ros2 launch yolox_ros_cpp yolox_openvino.launch.py \
241-
model_path:=install/yolox_ros_cpp/share/yolox_ros_cpp/weights/onnx/yolox_nano_480x640.onnx \
256+
model_path:=install/yolox_ros_cpp/share/yolox_ros_cpp/weights/onnx/yolox_tiny_480x640.onnx \
242257
model_version:="0.1.0"
243258

244259
# run YOLOX-tiny with NCS2
@@ -248,13 +263,13 @@ ros2 launch yolox_ros_cpp yolox_openvino_ncs2.launch.py
248263

249264
#### TensorRT
250265
```bash
251-
# run YOLOX_nano
266+
# run yolox_tiny
252267
ros2 launch yolox_ros_cpp yolox_tensorrt.launch.py
253268

254269
# run PINTO_model_zoo model
255270
# This model is converted from version 0.1.0.
256271
ros2 launch yolox_ros_cpp yolox_tensorrt.launch.py \
257-
model_path:=install/yolox_ros_cpp/share/yolox_ros_cpp/weights/tensorrt/yolox_nano_480x640.trt \
272+
model_path:=install/yolox_ros_cpp/share/yolox_ros_cpp/weights/tensorrt/yolox_tiny_480x640.trt \
258273
model_version:="0.1.0"
259274

260275
```
@@ -264,13 +279,13 @@ Jetson docker container cannot display GUI.
264279
If you want to show image with bounding box drawn, subscribe from host jetson or other PC.
265280

266281
```bash
267-
# run YOLOX_nano
282+
# run yolox_tiny
268283
ros2 launch yolox_ros_cpp yolox_tensorrt_jetson.launch.py
269284
```
270285

271286
#### ONNXRuntime
272287
```bash
273-
# run YOLOX_nano
288+
# run yolox_tiny
274289
ros2 launch yolox_ros_cpp yolox_onnxruntime.launch.py
275290
```
276291

@@ -292,7 +307,7 @@ ros2 launch yolox_ros_cpp yolox_tflite.launch.py \
292307

293308
### Parameter
294309
#### OpenVINO example
295-
- `model_path`: ./install/yolox_ros_cpp/share/yolox_ros_cpp/weights/openvino/yolox_nano.xml
310+
- `model_path`: ./install/yolox_ros_cpp/share/yolox_ros_cpp/weights/openvino/yolox_tiny.xml
296311
- `p6`: false
297312
- `class_labels_path`: ""
298313
- if not set, use coco_names.
@@ -309,7 +324,7 @@ ros2 launch yolox_ros_cpp yolox_tflite.launch.py \
309324

310325

311326
#### TensorRT example.
312-
- `model_path`: ./install/yolox_ros_cpp/share/yolox_ros_cpp/weights/tensorrt/yolox_nano.trt
327+
- `model_path`: ./install/yolox_ros_cpp/share/yolox_ros_cpp/weights/tensorrt/yolox_tiny.trt
313328
- `p6`: false
314329
- `class_labels_path`: ""
315330
- `num_classes`: 80
@@ -324,7 +339,7 @@ ros2 launch yolox_ros_cpp yolox_tflite.launch.py \
324339

325340

326341
#### ONNXRuntime example.
327-
- `model_path`: ./install/yolox_ros_cpp/share/yolox_ros_cpp/weights/onnx/yolox_nano.onnx
342+
- `model_path`: ./install/yolox_ros_cpp/share/yolox_ros_cpp/weights/onnx/yolox_tiny.onnx
328343
- `p6`: false
329344
- `class_labels_path`: ""
330345
- `num_classes`: 80

0 commit comments

Comments
 (0)