Skip to content

Commit 4ad6d5e

Browse files
authored
Merge pull request #17 from fateshelled/dev_cpp
Update node parameter
2 parents 4094c5d + 22e6110 commit 4ad6d5e

File tree

16 files changed

+411
-629
lines changed

16 files changed

+411
-629
lines changed

weights/onnx/download.bash

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@ if [ -z "$1" ]; then
88
exit 1
99
fi
1010
MODEL=$1
11+
MODEL_VERSION=0.1.1rc0
1112
SCRIPT_DIR=$(cd $(dirname $0); pwd)
1213

1314
echo $MODEL
1415
if [ "$MODEL" = "all" ]; then
15-
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/0.1.0/yolox_tiny.onnx -P $SCRIPT_DIR
16-
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/0.1.0/yolox_nano.onnx -P $SCRIPT_DIR
17-
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/0.1.0/yolox_s.onnx -P $SCRIPT_DIR
18-
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/0.1.0/yolox_m.onnx -P $SCRIPT_DIR
19-
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/0.1.0/yolox_l.onnx -P $SCRIPT_DIR
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
2021
else
21-
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/0.1.0/$MODEL.onnx -P $SCRIPT_DIR
22+
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/$MODEL.onnx -P $SCRIPT_DIR
2223
fi

weights/pytorch/download.bash

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

weights/tensorrt/convert.bash

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
if [ -z "$1" ]; then
55
echo "Usage: $0 <target-model> <workspace>"
66
echo "Target-Models : yolox_tiny, yolox_nano, yolox_s, yolox_m, yolox_l"
7-
echo "WORKSPACE : GPU memory workspace. Default 32."
7+
echo "WORKSPACE : GPU memory workspace. Default 16."
88
exit 1
99
fi
1010

1111
MODEL=$1
1212
TRT_WORKSPACE=$2
1313
if [ -z "$2" ]; then
14-
TRT_WORKSPACE=32
14+
TRT_WORKSPACE=16
1515
fi
1616

1717
SCRIPT_DIR=$(cd $(dirname $0); pwd)
@@ -31,7 +31,7 @@ if [ ! -e $ONNX_MODEL_PATH ]; then
3131
exit 1
3232
fi
3333

34-
trtexec \
34+
/usr/src/tensorrt/bin/trtexec \
3535
--onnx=$SCRIPT_DIR/../onnx/$MODEL.onnx \
3636
--saveEngine=$SCRIPT_DIR/$MODEL.trt \
3737
--fp16 --verbose --workspace=$((1<<$TRT_WORKSPACE))

yolox_ros_cpp/README.md

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
### Requirements
66
- ROS2 Foxy
77
- OpenCV 4.x
8-
- OpenVINO *
8+
- OpenVINO 2021.*
99
- TensorRT 8.x *
1010

1111
※ Either one of OpenVINO or TensorRT is required.
1212

13+
※ Model convert script is not supported OpenVINO 2022.*
14+
1315
※ YOLOX is not required.
1416

1517
※ Jetson + TensorRT docker support (Jetpack 4.6 r32.6.1). Tested with Jetson Nano 4GB.
@@ -112,6 +114,16 @@ cd ~/ros2_ws
112114
./src/YOLOX-ROS/weights/tensorrt/convert.bash yolox_nano 16
113115
```
114116

117+
#### PINTO_model_zoo
118+
- Support PINTO_model_zoo model
119+
- Download model using the following script.
120+
- https://github.com/PINTO0309/PINTO_model_zoo/blob/main/132_YOLOX/download_nano.sh
121+
- ONNX model copy to weight dir
122+
- `cp saved_model_yolox_nano_480x640/yolox_nano_480x640.onnx src/YOLOX-ROS/weight/onnx/`
123+
- Convert to TensorRT engine
124+
- `./src/YOLOX-ROS/weights/tensorrt/convert.bash yolox_nano_480x640`
125+
126+
115127
### build packages
116128
```bash
117129
# # If use openvino
@@ -131,8 +143,13 @@ ros2 launch yolox_ros_cpp yolox_openvino.launch.py
131143

132144
# run other model
133145
ros2 launch yolox_ros_cpp yolox_openvino.launch.py \
134-
model_path:=install/yolox_ros_cpp/share/yolox_ros_cpp/weights/tensorrt/yolox_s.trt \
135-
image_size/height:=640 image_size/width:=640
146+
model_path:=install/yolox_ros_cpp/share/yolox_ros_cpp/weights/openvino/yolox_s.xml
147+
148+
# run PINTO_model_zoo model
149+
# This model is converted from version 0.1.0.
150+
ros2 launch yolox_ros_cpp yolox_openvino.launch.py \
151+
model_path:=install/yolox_ros_cpp/share/yolox_ros_cpp/weights/onnx/yolox_nano_480x640.onnx \
152+
model_version:="0.1.0"
136153

137154
# run YOLOX-tiny with NCS2
138155
ros2 launch yolox_ros_cpp yolox_openvino_ncs2.launch.py
@@ -143,6 +160,13 @@ ros2 launch yolox_ros_cpp yolox_openvino_ncs2.launch.py
143160
```bash
144161
# run YOLOX_nano
145162
ros2 launch yolox_ros_cpp yolox_tensorrt.launch.py
163+
164+
# run PINTO_model_zoo model
165+
# This model is converted from version 0.1.0.
166+
ros2 launch yolox_ros_cpp yolox_tensorrt.launch.py \
167+
model_path:=install/yolox_ros_cpp/share/yolox_ros_cpp/weights/tensorrt/yolox_nano_480x640.trt \
168+
model_version:="0.1.0"
169+
146170
```
147171

148172
#### Jetson + TensorRT
@@ -157,9 +181,8 @@ ros2 launch yolox_ros_cpp yolox_tensorrt_jetson.launch.py
157181
### Parameter
158182
#### OpenVINO example
159183
- `model_path`: ./install/yolox_ros_cpp/share/yolox_ros_cpp/weights/openvino/yolox_nano.xml
184+
- `model_version`: 0.1.1rc0
160185
- `device`: CPU
161-
- `image_size/width`: 416
162-
- `image_size/height`: 416
163186
- `conf`: 0.3
164187
- `nms`: 0.45
165188
- `imshow_isshow`: true
@@ -170,9 +193,8 @@ ros2 launch yolox_ros_cpp yolox_tensorrt_jetson.launch.py
170193

171194
#### TensorRT example.
172195
- `model_path`: ./install/yolox_ros_cpp/share/yolox_ros_cpp/weights/tensorrt/yolox_nano.trt
196+
- `model_version`: 0.1.1rc0
173197
- `device`: "0"
174-
- `image_size/width`: 416
175-
- `image_size/height`: 416
176198
- `conf`: 0.3
177199
- `nms`: 0.45
178200
- `imshow_isshow`: true

0 commit comments

Comments
 (0)