1010
1111※ Either one of OpenVINO or TensorRT or ONNXRuntime or Tensorflow Lite is required.
1212
13- <!-- ※ ONNXRuntime support CPU or CUDA execute provider.
13+ <!-- ※ ONNXRuntime support CPU or CUDA execute provider. -->
1414
1515※ Tensorflow Lite support XNNPACK Delegate only.
1616
17- ※ Tensorflow Lite support float model and does not support integer model. -->
17+ ※ Tensorflow Lite support float model and does not support integer model.
1818
1919※ Model convert script is not supported OpenVINO 2022.*
2020
@@ -144,12 +144,11 @@ cd ~/ros2_ws
144144./src/YOLOX-ROS/weights/tensorrt/convert.bash yolox_tiny 16
145145```
146146
147- <!-- #### Tensorflow Lite
147+ #### Tensorflow Lite
148148``` bash
149149cd ~ /ros2_ws
150150
151- # Download tflite Person Detection model
152- # https://github.com/Kazuhito00/Person-Detection-using-RaspberryPi-CPU/
151+ # Download tflite Person Detection model: https://github.com/Kazuhito00/Person-Detection-using-RaspberryPi-CPU/
153152./src/YOLOX-ROS/weights/tflite/download_model.bash
154153```
155154
@@ -166,20 +165,42 @@ cd ~/ros2_ws
166165 - ` ./src/YOLOX-ROS/weights/tensorrt/convert.bash yolox_tiny_480x640 `
167166
168167- tflite model copy to weight dir
169- - `cp resouces_new/saved_model_yolox_tiny_480x640/model_float32.tflite ./src/YOLOX-ROS/weights/tflite/` -->
168+ - ` cp resouces_new/saved_model_yolox_tiny_480x640/model_float32.tflite ./src/YOLOX-ROS/weights/tflite/ `
170169
171170
171+ <br >
172172
173+ ## Build
174+
175+ ### OpenVINO
176+
177+ ``` bash
178+ # build with openvino
179+ source /opt/ros/humble/setup.bash
180+ source /opt/intel/openvino_2021/bin/setupvars.sh
181+ colcon build --cmake-args -DYOLOX_USE_OPENVINO=ON
182+ ```
173183
174- <!-- #### build yolox_ros_cpp with tflite
184+ ### TensorRT
185+
186+ ``` bash
187+ # build with tensorrt
188+ source /opt/ros/humble/setup.bash
189+ colcon build --cmake-args -DYOLOX_USE_TENSORRT=ON
190+ ```
191+
192+ ### TFLite
193+
194+ ** TFLite build**
175195
176- ##### build tflite
177196https://www.tensorflow.org/lite/guide/build_cmake
178197
179198Below is an example build script.
180- Please change `${workspace }` as appropriate for your environment.
199+ Please change ` ${WORKSPACE } ` as appropriate for your environment.
181200``` bash
182- cd ${workspace}
201+ export WORKSPACE=${HOME} /ws_tflite
202+ mkdir -p ${WORKSPACE}
203+ cd ${WORKSPACE}
183204git clone https://github.com/tensorflow/tensorflow.git tensorflow_src
184205mkdir tflite_build
185206cd tflite_build
@@ -192,42 +213,18 @@ cmake ../tensorflow_src/tensorflow/lite \
192213 -DCMAKE_BUILD_TYPE=Release
193214
194215make -j" $( nproc) "
195- ``` -->
196-
197- ## Build
198-
199- ### OpenVINO
200-
201- ``` bash
202- # build with openvino
203- source /opt/ros/humble/setup.bash
204- source /opt/intel/openvino_2021/bin/setupvars.sh
205- colcon build --cmake-args -DYOLOX_USE_OPENVINO=ON
206216```
207217
208- ### TensorRT
209-
210218``` bash
211- # build with tensorrt
212- source /opt/ros/humble/setup.bash
213- colcon build --cmake-args -DYOLOX_USE_TENSORRT=ON
219+ colcon build --cmake-args \
220+ -DYOLOX_USE_TFLITE=ON \
221+ -DTFLITE_LIB_PATH=${WORKSPACE} /tflite_build \
222+ -DTFLITE_INCLUDE_DIR=${WORKSPACE} /tensorflow_src/ \
223+ -DABSEIL_CPP_ICLUDE_DIR=${WORKSPACE} /tflite_build/abseil-cpp \
224+ -DFLATBUFFERS_INCLUDE_DIR=${WORKSPACE} /tflite_build/flatbuffers/include
214225```
215226
216- <!-- ##### build ros package with tflite
217-
218- This is build script when tflite built as above.
219-
220- ```bash
221- # build with tflite
222- colcon build --symlink-install \
223- --packages-up-to yolox_ros_cpp \
224- --cmake-args \
225- -DYOLOX_USE_TFLITE=ON \
226- -DTFLITE_LIB_PATH=${workspace}/tflite_build/libtensorflow-lite.so \
227- -DTFLITE_INCLUDE_DIR=${workspace}/tensorflow_src \
228- -DABSEIL_CPP_ICLUDE_DIR=${workspace}/tflite_build/abseil-cpp \
229- -DFLATBUFFERS_INCLUDE_DIR=${workspace}/tflite_build/flatbuffers/include
230- ``` -->
227+ <br >
231228
232229## Run
233230
@@ -272,28 +269,24 @@ If you want to show image with bounding box drawn, subscribe from host jetson or
272269# run yolox_tiny
273270ros2 launch yolox_ros_cpp yolox_tensorrt_jetson.launch.py
274271```
275- <!--
276- ### ONNXRuntime
272+
273+ <!-- ### ONNXRuntime
277274```bash
278275# run yolox_tiny
279276ros2 launch yolox_ros_cpp yolox_onnxruntime.launch.py
280- ```
277+ ``` -->
281278
282279### Tensorflow Lite
283280``` bash
284- # add libtensorflow-lite.so directory path to `LD_LIBRARY_PATH`
285- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${workspace}/tflite_build
286-
287- # run Person Detection Model
288281ros2 launch yolox_ros_cpp yolox_tflite.launch.py
289282
290- # run PINTO_model_zoo model
291- ros2 launch yolox_ros_cpp yolox_tflite.launch.py \
292- model_path:=install/yolox_ros_cpp/share/yolox_ros_cpp/weights/tflite/model_float32.tflite \
293- model_version:=0.1.0 \
294- num_classes:=80 \
295- is_nchw:=false
296- ``` -->
283+ # # run PINTO_model_zoo model
284+ # ros2 launch yolox_ros_cpp yolox_tflite.launch.py \
285+ # model_path:=install/yolox_ros_cpp/share/yolox_ros_cpp/weights/tflite/model_float32.tflite \
286+ # model_version:=0.1.0 \
287+ # num_classes:=80 \
288+ # is_nchw:=false
289+ ```
297290
298291### Parameter
299292
0 commit comments