Skip to content

Commit ccb48d6

Browse files
committed
yolov10
1 parent 94c9099 commit ccb48d6

File tree

3 files changed

+47
-2
lines changed

3 files changed

+47
-2
lines changed

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
opencv-python==4.8.1.78
22
typing-extensions>=4.4.0
3-
ultralytics==8.2.26
3+
ultralytics==8.2.38
44
lap==0.4.0
+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Copyright (C) 2023 Miguel Ángel González Santamarta
2+
3+
# This program is free software: you can redistribute it and/or modify
4+
# it under the terms of the GNU General Public License as published by
5+
# the Free Software Foundation, either version 3 of the License, or
6+
# (at your option) any later version.
7+
8+
# This program is distributed in the hope that it will be useful,
9+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
# GNU General Public License for more details.
12+
13+
# You should have received a copy of the GNU General Public License
14+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
15+
16+
17+
import os
18+
from launch import LaunchDescription
19+
from launch.substitutions import LaunchConfiguration
20+
from launch.actions import IncludeLaunchDescription
21+
from launch.launch_description_sources import PythonLaunchDescriptionSource
22+
from ament_index_python.packages import get_package_share_directory
23+
24+
25+
def generate_launch_description():
26+
27+
return LaunchDescription([
28+
IncludeLaunchDescription(
29+
PythonLaunchDescriptionSource(
30+
os.path.join(get_package_share_directory(
31+
"yolov8_bringup"), "launch", "yolov8.launch.py")),
32+
launch_arguments={
33+
"model": LaunchConfiguration("model", default="yolov10m.pt"),
34+
"tracker": LaunchConfiguration("tracker", default="bytetrack.yaml"),
35+
"device": LaunchConfiguration("device", default="cuda:0"),
36+
"enable": LaunchConfiguration("enable", default="True"),
37+
"threshold": LaunchConfiguration("threshold", default="0.5"),
38+
"input_image_topic": LaunchConfiguration("input_image_topic", default="/camera/rgb/image_raw"),
39+
"image_reliability": LaunchConfiguration("image_reliability", default="2"),
40+
"namespace": LaunchConfiguration("namespace", default="yolo"),
41+
}.items(),
42+
)
43+
])

yolov8_ros/yolov8_ros/yolov8_node.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ def on_activate(self, state: LifecycleState) -> TransitionCallbackReturn:
104104
self.get_logger().info(f"Activating {self.get_name()}")
105105

106106
self.yolo = YOLO(self.model)
107-
self.yolo.fuse()
107+
108+
if "v10" not in self.model:
109+
self.yolo.fuse()
108110

109111
# subs
110112
self._sub = self.create_subscription(

0 commit comments

Comments
 (0)