This project attempts to calculate lane lines and information about the lead car based on two sequential input camera frames. Special thanks to comma.ai for making their openpilot model open-source for us all to use. Also special thanks to @littlemountainman and @nikebless for a lot of the project code modeld , openpilot-pipeline.
- Make sure to have python, git and pip3 installed beforehand.
- Make sure that you have a version older than python 3.10 installed since onnxruntime is not supported with the newest version of python. Python 3.9 is a good option and do not forget to change the base interpreter to this python version on your IDE of choice.
If you are using pycharm as your IDE, you can simply click VCS and then Get From Version Control. Then paste the link of this github page you should have all the necessary files in your directory to run the program.
Install the required packages by typing the following commands into the terminal:
- pip3 install -r requirements.txt
Run main.py:
- python3 main.py
After running the program, you should get a frame pop up that consists of a video of a car driving with lane lines and the lead car distance approximations included.
- The program can be tested on any dashcam video of a car driving and the program should output the video with lane lines and the lead car distance to a reasonable approximation depending on the quality of the video. Make sure to resize the video to 1168 x 874 before testing it (you can use the website https://ezgif.com/resize-video to do this or any video editing software).
- To convert a youtube video into an mp4 you can use this website: https://onlinevideoconverter.pro/en51/youtube-downloader-mp4
- To test another video file, paste the path of the mp4 file on line 29 in main.py: cap = cv2.VideoCapture('File path goes here')