Skip to content

Commit

Permalink
fix(tensorrt yolo): update model path (autowarefoundation#5158)
Browse files Browse the repository at this point in the history
* fix(tensorrt_yolo): add arg data_path, update onnx_file

Signed-off-by: Alexey Panferov <[email protected]>

* fix(tensorrt_yolo): update model downloading in README, add data_path

Signed-off-by: Alexey Panferov <[email protected]>

---------

Signed-off-by: Alexey Panferov <[email protected]>
  • Loading branch information
lexavtanke authored and miursh committed Sep 28, 2023
1 parent 55de0b4 commit 3f48f10
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion perception/tensorrt_yolo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Jocher, G., et al. (2021). ultralytics/yolov5: v6.0 - YOLOv5n 'Nano' models, Rob

| Name | Type | Default Value | Description |
| ----------------------- | ------ | ------------- | ------------------------------------------------------------------ |
| `data_path` | string | "" | Packages data and artifacts directory path |
| `onnx_file` | string | "" | The onnx file name for yolo model |
| `engine_file` | string | "" | The tensorrt engine file name for yolo model |
| `label_file` | string | "" | The label file with label names for detected objects written on it |
Expand All @@ -71,7 +72,7 @@ This package includes multiple licenses.

All YOLO ONNX models are converted from the officially trained model. If you need information about training datasets and conditions, please refer to the official repositories.

All models are downloaded automatically when building. When launching the node with a model for the first time, the model is automatically converted to TensorRT, although this may take some time.
All models are downloaded during env preparation by ansible (as mention in [installation](https://autowarefoundation.github.io/autoware-documentation/main/installation/autoware/source-installation/)). It is also possible to download them manually, see [Manual downloading of artifacts](https://github.com/autowarefoundation/autoware/tree/main/ansible/roles/artifacts) . When launching the node with a model for the first time, the model is automatically converted to TensorRT, although this may take some time.

### YOLOv3

Expand Down
9 changes: 5 additions & 4 deletions perception/tensorrt_yolo/launch/tensorrt_yolo.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@
<arg name="label_file" default="coco.names"/>
<arg name="input_topic" default="/image_raw"/>
<arg name="output_topic" default="rois"/>
<arg name="engine_file" default="$(find-pkg-share tensorrt_yolo)/data/$(var yolo_type).engine"/>
<arg name="data_path" default="$(env HOME)/autoware_data" description="packages data and artifacts directory path"/>
<arg name="engine_file" default="$(var data_path)/tensorrt_yolo/$(var yolo_type).engine"/>
<arg name="calib_image_directory" default="$(find-pkg-share tensorrt_yolo)/calib_image/"/>
<arg name="mode" default="FP32"/>
<arg name="gpu_id" default="0"/>
<node pkg="tensorrt_yolo" exec="tensorrt_yolo_node" name="$(anon tensorrt_yolo)" output="screen">
<remap from="in/image" to="$(var input_topic)"/>
<remap from="out/objects" to="$(var output_topic)"/>
<remap from="out/image" to="$(var output_topic)/debug/image"/>
<param name="onnx_file" type="str" value="$(find-pkg-share tensorrt_yolo)/data/$(var yolo_type).onnx"/>
<param name="onnx_file" type="str" value="$(var data_path)/tensorrt_yolo/$(var yolo_type).onnx"/>
<param name="engine_file" type="str" value="$(var engine_file)"/>
<param name="label_file" type="str" value="$(find-pkg-share tensorrt_yolo)/data/$(var label_file)"/>
<param name="label_file" type="str" value="$(var data_path)/tensorrt_yolo/$(var label_file)"/>
<param name="calib_image_directory" type="str" value="$(var calib_image_directory)"/>
<param name="calib_cache_file" type="str" value="$(find-pkg-share tensorrt_yolo)/data/$(var yolo_type).cache"/>
<param name="calib_cache_file" type="str" value="$(var data_path)/tensorrt_yolo/$(var yolo_type).cache"/>
<param name="mode" type="str" value="$(var mode)"/>
<param name="gpu_id" type="int" value="$(var gpu_id)"/>
<param from="$(find-pkg-share tensorrt_yolo)/config/$(var yolo_type).param.yaml"/>
Expand Down

0 comments on commit 3f48f10

Please sign in to comment.