This project is a deep learning-based self-driving car implementation using the Udacity Self-Driving Car Simulator. A convolutional neural network (CNN) is trained with images from the simulator to predict steering angles for autonomous driving.
The car receives images from a front-facing camera in the simulator and uses a trained model to predict the steering angle in real time. The model is trained using TensorFlow and follows an end-to-end learning approach inspired by NVIDIAβs self-driving research.
- Python 3
- TensorFlow 2.x / Keras
- OpenCV
- NumPy
- Udacity Self-Driving Car Simulator
- Clone this repository
git clone [https://github.com/GeneralSubhra/Self-driving-car]
cd self-driving-car-udacity- Create and activate a virtual environment (optional but recommended)
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies
pip install -r requirements.txt- Download the Udacity Simulator
Simulator download: Udacity Self-Driving Car Simulator
Use the simulator in training mode to drive manually and collect images + steering angles. The data will be saved into a CSV log and an image folder.
python train.pyThis will train the model and save it as model.h5.
Run the simulator in autonomous mode, then:
python drive.py model.h5.
βββ data/ # Collected driving data (images + driving_log.csv)
βββ model/ # Saved model(s)
βββ script.py # Script to drive car in simulator using trained model
βββ app.py # CNN architecture (TensorFlow/Keras)
βββ requirements.txt # List of dependencies
βββ README.md # This file
- Add lane detection and object avoidance
- Train on multiple tracks
- Implement PID control for smoother driving
Contributions and suggestions are welcome! Please fork the repo and open a pull request.
This project is licensed under the MIT License.