CarCam is a artificial intelligence pipeline for autonomous vehicles, built with PyTorch and OpenCV. CarCam uses machine learning and computer vision to detect lanes, track road entities (like other vehicles), and assess collision risks with these road entities.
CarCam relies on input from only one camera, instead of relying on several cameras, multiple sensors, and/or complex systems like LiDAR, making safe self-driving simple, cheap, and easily accessible to all vehicles.
Lanes are marked with blue lines, and road entities are bounded in green or red boxes. A road entity with which a collision is unlikely to occur is bounded in a green box and is deemed 'safe'. A road entity with which a collision may occur is bounded in a red box and is deemed 'risky'.
- Download/clone the repository.
- Create a Python virtual environment and install the packages listed in the
requirements.txt
file, usingconda
,pip
, etc. To do this step withconda
, run this command:conda create --name <your env name> --file requirements.txt
. - Run this command:
cd config/ && sh ./download_weights.sh
to download the weights of the YOLO object detection model. - Walk through the Jupyter notebook
carcam.ipynb
or run thecarcam.py
file with this command:python3 carcam.py
. Depending on the specs of your system, this may take a while, so please be patient. Your results will be ready soon!
Download and play the video output.mp4
. The same video can also be watched on YouTube, here: https://youtu.be/IRfuNHZG8CQ. Enjoy!