Skip to content

Commit

Permalink
yolov8_node fixes
Browse files Browse the repository at this point in the history
  - typing added to enable_cb
  - fuse for v10
  - ultralytics updated
  • Loading branch information
mgonzs13 committed Aug 21, 2024
1 parent d1177df commit dabdb90
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
opencv-python==4.8.1.78
typing-extensions>=4.4.0
ultralytics==8.2.71
ultralytics==8.2.79
super_gradients==3.7.1
lap==0.4.0
14 changes: 6 additions & 8 deletions yolov8_ros/yolov8_ros/yolov8_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,11 @@ def on_configure(self, state: LifecycleState) -> TransitionCallbackReturn:

return TransitionCallbackReturn.SUCCESS

def enable_cb(self, request, response):
self.enable = request.data
response.success = True
return response

def on_activate(self, state: LifecycleState) -> TransitionCallbackReturn:
self.get_logger().info(f"Activating {self.get_name()}")

self.yolo = self.type_to_model[self.model_type](self.model)

if "v10" not in self.model:
self.yolo.fuse()
self.yolo.fuse()

# subs
self._sub = self.create_subscription(
Expand Down Expand Up @@ -152,6 +145,11 @@ def on_cleanup(self, state: LifecycleState) -> TransitionCallbackReturn:

return TransitionCallbackReturn.SUCCESS

def enable_cb(self, request: SetBool.Request, response: SetBool.Response) -> SetBool.Response:
self.enable = request.data
response.success = True
return response

def parse_hypothesis(self, results: Results) -> List[Dict]:

hypothesis_list = []
Expand Down

0 comments on commit dabdb90

Please sign in to comment.