This project implements computer vision algorithms to enable basic self-driving capabilities within the GTA V environment. It utilizes real-time image processing to detect lanes and surrounding objects, providing a foundation for automated navigation and obstacle avoidance.
The core objective is to demonstrate how an automated vehicle perceives its environment. By scanning video frames in real-time, the application identifies driving lanes and classifies objects such as cars, pedestrians, and traffic lights. It also includes a proximity warning system to alert when obstacles are too close.
- Real-time Lane Detection: Uses the Hough Transform algorithm to identify and highlight road lanes.
- Object Detection: Implements the YOLOv3 (You Only Look Once) algorithm to detect and classify multiple objects in the frame.
- Proximity Warning: Triggers a "Warning !!!" message on-screen when a detected vehicle (car or truck) is dangerously close.
- GTA V Integration: Designed to capture and process gameplay from GTA V, providing a realistic simulation environment.
- Canny Edge Detection: Identifies sharp changes in intensity to find potential edges.
- Gaussian Blur: Reduces noise and smoothens the image before edge detection.
- Region of Interest (ROI): Focuses processing on the area of the frame where lanes are most likely to appear.
- Hough Line Transform: Extracts straight lines from the edge-detected image to represent lane boundaries.
- Deep Learning Model: Utilizes a pre-trained YOLOv3 network for efficient, real-time object detection.
- Bounding Boxes: Draws rectangles around detected objects with classification labels and confidence scores.
- Non-Maximum Suppression (NMS): Filters redundant overlapping boxes to ensure each object is detected only once.
.
├── assets/
│ ├── clips/ # Sample video clips for testing
│ └── coco.names # COCO dataset class names for YOLO
├── src/
│ ├── lane_detection.py # Independent lane detection implementation
│ ├── object_detection.py # Independent object detection implementation
│ └── self_driving.py # Integrated lane and object detection
├── requirements.txt # Python dependencies
└── README.md # Project documentation
- Python 3.x
- GTA V (optional, for real-time testing)
-
Clone the repository:
git clone <repository-url> cd <repository-directory>
-
Install dependencies:
pip install -r requirements.txt
-
Download YOLOv3 Weights & Config: The YOLOv3 model files are required for object detection. Download them and place them in the
assets/directory:
If you don't have the game, you can run the detection on sample clips provided in assets/clips/:
python src/object_detection.py- Launch GTA V and set the resolution to 800x600.
- Position the game window in the top-left corner of your screen.
- Run the integrated self-driving script:
python src/self_driving.py
- Dhruv Pathak
- Vrushit Patel
This project is open-source and intended for educational purposes.