Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Name 'lanes_points' is not defined #1

Closed
Yen-Lung-Huang opened this issue Feb 18, 2022 · 2 comments
Closed

Name 'lanes_points' is not defined #1

Yen-Lung-Huang opened this issue Feb 18, 2022 · 2 comments

Comments

@Yen-Lung-Huang
Copy link

Hello, thanks for the code. I'm running "imageLaneDetection.py" with culan tflite model and change model_type value in imageLaneDetection.py like:

model_type = ModelType.CULANE

then, i got these on terminal:

163: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray
  return np.array(lane_points_mat), np.array(lanes_detected)
Traceback (most recent call last):
  File "imageLaneDetection.py", line 18, in <module>
    output_img = lane_detector.detect_lanes(img)
  File "/home/ubuntu/Codes/TfLite-Ultra-Fast-Lane-Detection-Inference/ultrafastLaneDetector/ultrafastLaneDetector.py", line 82, in detect_lanes
    visualization_img = self.draw_lanes(image, self.lanes_points, self.lanes_detected, self.cfg, draw_points)
  File "/home/ubuntu/Codes/TfLite-Ultra-Fast-Lane-Detection-Inference/ultrafastLaneDetector/ultrafastLaneDetector.py", line 175, in draw_lanes
    cv2.fillPoly(lane_segment_img, pts = [np.vstack((lanes_points[1],np.flipud(lanes_points[2])))], color =(255,191,0))
NameError: name 'lanes_points' is not defined

image

is the error message means the "lanes_points" variable in ultrafastLaneDetector.py is not defined? Where should I define the "lanes_points" in code?

ibaiGorordo added a commit that referenced this issue Mar 4, 2022
@ibaiGorordo
Copy link
Owner

yeah, that should have been lane_points_mat instead of lanes_points (I copy pasted this part from my other repository, but forgot to modify it).

I think it should work now.

@Yen-Lung-Huang
Copy link
Author

Yes, it works well! Thank you very much.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants