Skip to content

Commit

Permalink
fixing error in color encoding of yolov8 recognition
Browse files Browse the repository at this point in the history
  • Loading branch information
igormaurell committed Oct 8, 2023
1 parent 29a6db5 commit d2e5410
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ def callback(self, *args):
description_header = img_rgb.header
description_header.seq = 0

results = self.model.predict(cv_img, conf=self.threshold, imgsz=max(*cv_img.shape), verbose=False)
debug_img = cv_img
results = self.model.predict(cv_img[:, :, ::-1], conf=self.threshold, verbose=True)
boxes_ = results[0].boxes.cpu().numpy()

if len(results[0].boxes):
Expand Down Expand Up @@ -116,7 +115,7 @@ def callback(self, *args):
description.label = index + '/' + label_class if index is not None else label_class
objects_recognition.descriptions.append(description)

debug_img = results[0].plot()
debug_img = results[0].plot()[:, :, ::-1]
description_header.seq += 1

self.debug_publisher.publish(ros_numpy.msgify(Image, debug_img, 'rgb8'))
Expand All @@ -127,7 +126,7 @@ def callback(self, *args):
if len(people_recognition.descriptions) > 0:
self.people_detection_publisher.publish(people_recognition)
else:
debug_img = results[0].plot()
debug_img = results[0].plot()[:, :, ::-1]
self.debug_publisher.publish(ros_numpy.msgify(Image, debug_img, 'rgb8'))

def readParameters(self):
Expand Down

0 comments on commit d2e5410

Please sign in to comment.