diff --git a/object_detection/object_detection/ObjectDetection.py b/object_detection/object_detection/ObjectDetection.py index 61fd4dc..549954b 100644 --- a/object_detection/object_detection/ObjectDetection.py +++ b/object_detection/object_detection/ObjectDetection.py @@ -111,7 +111,7 @@ def detection_cb(self, img_msg): # Check if the confidence is above the threshold if confidence >= self.confidence_threshold: - x1, y1, x2, y2 = map(int, prediction['box']) + x1, y1, x2, y2 = map(int, prediction['box']) # Draw the bounding box cv_image = cv2.rectangle(cv_image, (x1, y1), (x2, y2), (0, 255, 0), 1) @@ -127,6 +127,7 @@ def detection_cb(self, img_msg): output = self.bridge.cv2_to_imgmsg(cv_image, "bgr8") self.img_pub.publish(output) + def main(): rclpy.init() od = ObjectDetection()