Skip to content

Commit

Permalink
yolov10
Browse files Browse the repository at this point in the history
  • Loading branch information
mgonzs13 committed Jun 20, 2024
1 parent 94c9099 commit ccb48d6
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 2 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -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
43 changes: 43 additions & 0 deletions yolov8_bringup/launch/yolov10.launch.py
Original file line number Diff line number Diff line change
@@ -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 <https://www.gnu.org/licenses/>.


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(),
)
])
4 changes: 3 additions & 1 deletion yolov8_ros/yolov8_ros/yolov8_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit ccb48d6

Please sign in to comment.