georgesung / advanced_lane_detection

Advanced lane detection using computer vision
527 stars 208 forks source link

how can i use this decect my dataset??? #2

Open zhaohuaqing1993 opened 7 years ago

zhaohuaqing1993 commented 7 years ago

how can i use this decect my dataset??? I just replace the project_video and it failed.

Afeihan commented 7 years ago

I met the same problem, ,have you solved it?

georgesung commented 7 years ago

What was the error? Was the input video formatted in mp4 format?

Afeihan commented 7 years ago

@georgesung It is the mp4 format, but when I test the code with the input video that recorded with my phone,I failed. the error is:

TypeError: 'NoneType' object is not subscriptable

[MoviePy] >>>> Building video project_out.mp4 [MoviePy] Writing video project_out.mp4 0%| | 0/3861 [00:00<?, ?it/s]Traceback (most recent call last): File "/home/han/lane-detection/advanced_lane_detection-master/line_fit_video.py", line 104, in annotate_video('project.mp4', 'project_out.mp4') File "/home/han/lane-detection/advanced_lane_detection-master/line_fit_video.py", line 99, in annotate_video annotated_video.write_videofile(output_file, audio=False) File "", line 2, in write_videofile File "/usr/local/lib/python3.5/dist-packages/moviepy/decorators.py", line 54, in requires_duration return f(clip, *a, k) File "", line 2, in write_videofile File "/usr/local/lib/python3.5/dist-packages/moviepy/decorators.py", line 137, in use_clip_fps_by_default return f(clip, *new_a, *new_kw) File "", line 2, in write_videofile File "/usr/local/lib/python3.5/dist-packages/moviepy/decorators.py", line 22, in convert_masks_to_RGB return f(clip, a, k) File "/usr/local/lib/python3.5/dist-packages/moviepy/video/VideoClip.py", line 349, in write_videofile progress_bar=progress_bar) File "/usr/local/lib/python3.5/dist-packages/moviepy/video/io/ffmpeg_writer.py", line 209, in ffmpeg_write_video fps=fps, dtype="uint8"): File "/usr/local/lib/python3.5/dist-packages/tqdm/_tqdm.py", line 833, in iter for obj in iterable: File "/usr/local/lib/python3.5/dist-packages/moviepy/Clip.py", line 475, in generator frame = self.get_frame(t) File "", line 2, in get_frame File "/usr/local/lib/python3.5/dist-packages/moviepy/decorators.py", line 89, in wrapper return f(*new_a, **new_kw) File "/usr/local/lib/python3.5/dist-packages/moviepy/Clip.py", line 95, in get_frame return self.make_frame(t) File "/usr/local/lib/python3.5/dist-packages/moviepy/Clip.py", line 136, in newclip = self.set_make_frame(lambda t: fun(self.get_frame, t)) File "/usr/local/lib/python3.5/dist-packages/moviepy/video/VideoClip.py", line 533, in return self.fl(lambda gf, t: image_func(gf(t)), apply_to) File "/home/han/lane-detection/advanced_lane_detection-master/line_fit_video.py", line 65, in annotate_image left_fit = ret['left_fit'] TypeError: 'NoneType' object is not subscriptable Process finished with exit code 1

and I found that in the file of line_fit.py, in the line of 79,the value of lefty and leftx is 0.

Do you have any method to solve this problem? or Is it because there is a demand for camera placement or the pixels of the vedio ?

I'm looking forward your reply!

georgesung commented 7 years ago

Thanks for the info about the error. Sometimes it's possible that the filters create an empty binary image (i.e. all 0's), because the scene does not fit under the assumptions of the hard-coded parameters. Can you check if left_lane_inds and right_lane_inds are empty lists? If so, then the above may be the issue.

There are a couple ways to handle this issue: 1) Tweak the filter parameters to fit your scene 2) Build in error tolerance logic to tolerate empty left_lane_inds/right_lane_inds (maybe just don't display any lane lines in that scenario)

Afeihan commented 7 years ago

@georgesung Thanks for your reply!I will check the code as you siad.