Skip to content

Commit 6ce0bc7

Browse files
committed
Adding the yolov8n-seg for github action CI
Signed-off-by: huangjiafengx <[email protected]>
1 parent 900b968 commit 6ce0bc7

File tree

5 files changed

+90
-1
lines changed

5 files changed

+90
-1
lines changed

.ci_local_test/ros2_openvino_toolkit_test/test_cases/unittest/run_all.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ def main():
1515
Test_Cases('test_6_pipeline_person_attributes_ci'),
1616
Test_Cases('test_7_pipeline_segmentation_image_ci'),
1717
Test_Cases('test_8_pipeline_object_yolov5_ci'),
18-
Test_Cases('test_9_pipeline_object_yolov8_ci')]
18+
Test_Cases('test_9_pipeline_object_yolov8_ci'),
19+
Test_Cases('test_10_pipeline_segmentation_instance_ci')]
1920
suite.addTests(all_cases)
2021

2122
with (open('./result.html', 'wb')) as fp:

.ci_local_test/ros2_openvino_toolkit_test/test_cases/unittest/test_cases.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ def test_9_pipeline_object_yolov8_ci(self):
9797
log_file = f"/root/test_cases/log/pipeline_object_yolov8_test_ci.log"
9898
self.test_pipeline(launch_file, log_file, topic_list=topic_ls)
9999

100+
def test_10_pipeline_segmentation_instance_ci(self):
101+
topic_ls = ["/ros2_openvino_toolkit/detected_objects"]
102+
launch_file = f"pipeline_segmentation_instance_ci_test.py"
103+
log_file = f"/root/test_cases/log/pipeline_segmentation_instance.log"
104+
self.test_pipeline(launch_file, log_file, topic_list=topic_ls)
105+
100106

101107
@unittest.skip("skip case")
102108
def test_9_pipeline_segmentation_maskrcnn_ci(self):

.ci_local_test/ros2_openvino_toolkit_test/test_cases/yolov8_model_download.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@ source openvino_env/bin/activate
1212
#Export a YOLOv8n model to a different format like ONNX, CoreML, etc.
1313
# export official model
1414
yolo export model=yolov8n.pt format=openvino
15+
yolo export model=yolov8n-seg.pt format=openvino
1516

1617

1718
# Move to the Recommended Model Path
1819
mkdir -p /opt/openvino_toolkit/models/convert/public/FP32/yolov8n
20+
mkdir -p /opt/openvino_toolkit/models/convert/public/FP32/yolov8n-seg
1921

2022
cp yolov8n_openvino_model/* /opt/openvino_toolkit/models/convert/public/FP32/yolov8n
23+
cp yolov8n-seg_openvino_model/* /opt/openvino_toolkit/models/convert/public/FP32/yolov8n-seg
2124

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Copyright 2018 Open Source Robotics Foundation, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
"""Launch face detection and rviz."""
16+
17+
import os
18+
19+
from ament_index_python.packages import get_package_share_directory
20+
from launch import LaunchDescription
21+
import launch_ros.actions
22+
23+
from launch.substitutions import LaunchConfiguration, PythonExpression
24+
import launch
25+
26+
def generate_launch_description():
27+
#default_yaml = os.path.join(get_package_share_directory('openvino_node'), 'param',
28+
#'pipeline_segmentation.yaml')
29+
default_rviz = os.path.join(get_package_share_directory('openvino_node'), 'launch',
30+
'rviz/default.rviz')
31+
return LaunchDescription([
32+
launch.actions.DeclareLaunchArgument(name='yaml_path', default_value =
33+
os.path.join(get_package_share_directory('openvino_node'), 'param','pipeline_segmentation_instance_yolov8_seg_ci.yaml')),
34+
# Realsense
35+
# NOTE: Split realsense_node launching from OpenVINO package, which
36+
# will be launched by RDK launching file or manually.
37+
38+
# Openvino detection
39+
launch_ros.actions.Node(
40+
package='openvino_node',
41+
executable='pipeline_with_params',
42+
arguments=['-config', LaunchConfiguration('yaml_path')],
43+
remappings=[
44+
('/openvino_toolkit/image_raw', '/camera/color/image_raw'),
45+
('/openvino_toolkit/segmentation/segmented_obejcts',
46+
'/ros2_openvino_toolkit/segmented_obejcts'),
47+
('/openvino_toolkit/segmentation/images', '/ros2_openvino_toolkit/image_rviz')],
48+
output='screen'),
49+
50+
# Rviz
51+
#launch_ros.actions.Node(
52+
# package='rviz2',
53+
# executable='rviz2', output='screen',
54+
# arguments=['--display-config', default_rviz]),
55+
])
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Pipelines:
2+
- name: segmentation
3+
inputs: [Image]
4+
input_path: /root/catkin_ws/src/ros2_openvino_toolkit/data/images/sample_faces.jpg
5+
6+
infers:
7+
- name: ObjectSegmentationInstance
8+
# for Yolov8 Seg models -----------------
9+
model: /opt/openvino_toolkit/models/convert/public/FP32/yolov8n-seg/yolov8n-seg.xml
10+
model_type: yolov8
11+
label: /opt/openvino_toolkit/labels/object_detection/coco.names
12+
engine: CPU #"HETERO:CPU,GPU," #"HETERO:CPU,GPU,MYRIAD"
13+
batch: 1
14+
confidence_threshold: 0.5
15+
outputs: [RosTopic]
16+
connects:
17+
- left: Image
18+
right: [ObjectSegmentationInstance]
19+
- left: ObjectSegmentationInstance
20+
right: [ImageWindow]
21+
- left: ObjectSegmentationInstance
22+
right: [RosTopic]
23+
24+
Common:

0 commit comments

Comments
 (0)