Skip to content

Commit

Permalink
Implement Coderabbit changes to Landetection Node
Browse files Browse the repository at this point in the history
  • Loading branch information
EyMaxl authored Dec 19, 2024
1 parent dc4f856 commit becb77a
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def image_handler(self, ImageMsg):
self.lane_publisher.publish(lanedetection_image)
else:
# Only there to see if node is running, if lane_mask returns null -> model not working yet
no_img = cv2.imread("/workspace/code/perception/src/cropped_image5.jpg")
no_img = np.zeros_like(self.image) # Creates an empty image with the same dimensions
lanedetection_image = self.bridge.cv2_to_imgmsg(no_img, "bgr8")
self.lane_publisher.publish(lanedetection_image)

Expand Down Expand Up @@ -291,13 +291,14 @@ def detect_lanes(self, image, model):
self.img_freq = 0
print("Detect Lanes successfull")
return dst
except Exception as e:
except RuntimeError as e:
self.img_freq += 5
print("Detect Lanes UNsuccessfull")
print("Detect Lanes unsuccessful")
print(f"An exception occurred: {e}")
torch.cuda.empty_cache()
return None


def inference_one_image(self, model, image):
"""Inference on an image with the detector.
Args:
Expand Down

0 comments on commit becb77a

Please sign in to comment.