diff --git a/requirements.txt b/requirements.txt index c9b615e..6b7201b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ opencv-python==4.8.1.78 typing-extensions>=4.4.0 -ultralytics==8.2.26 +ultralytics==8.2.38 lap==0.4.0 \ No newline at end of file diff --git a/yolov8_bringup/launch/yolov10.launch.py b/yolov8_bringup/launch/yolov10.launch.py new file mode 100644 index 0000000..c4696e8 --- /dev/null +++ b/yolov8_bringup/launch/yolov10.launch.py @@ -0,0 +1,43 @@ +# Copyright (C) 2023 Miguel Ángel González Santamarta + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +import os +from launch import LaunchDescription +from launch.substitutions import LaunchConfiguration +from launch.actions import IncludeLaunchDescription +from launch.launch_description_sources import PythonLaunchDescriptionSource +from ament_index_python.packages import get_package_share_directory + + +def generate_launch_description(): + + return LaunchDescription([ + IncludeLaunchDescription( + PythonLaunchDescriptionSource( + os.path.join(get_package_share_directory( + "yolov8_bringup"), "launch", "yolov8.launch.py")), + launch_arguments={ + "model": LaunchConfiguration("model", default="yolov10m.pt"), + "tracker": LaunchConfiguration("tracker", default="bytetrack.yaml"), + "device": LaunchConfiguration("device", default="cuda:0"), + "enable": LaunchConfiguration("enable", default="True"), + "threshold": LaunchConfiguration("threshold", default="0.5"), + "input_image_topic": LaunchConfiguration("input_image_topic", default="/camera/rgb/image_raw"), + "image_reliability": LaunchConfiguration("image_reliability", default="2"), + "namespace": LaunchConfiguration("namespace", default="yolo"), + }.items(), + ) + ]) diff --git a/yolov8_ros/yolov8_ros/yolov8_node.py b/yolov8_ros/yolov8_ros/yolov8_node.py index cde2b5c..d975411 100644 --- a/yolov8_ros/yolov8_ros/yolov8_node.py +++ b/yolov8_ros/yolov8_ros/yolov8_node.py @@ -104,7 +104,9 @@ def on_activate(self, state: LifecycleState) -> TransitionCallbackReturn: self.get_logger().info(f"Activating {self.get_name()}") self.yolo = YOLO(self.model) - self.yolo.fuse() + + if "v10" not in self.model: + self.yolo.fuse() # subs self._sub = self.create_subscription(