В холодный зимний вечер богатый молодой человек по имени Дмитрий Волков возвращался из своего офиса в Москве. Снег падал густыми хлопьями, покрывая улицы белым одеялом. Вместо того чтобы ехать домой на своём дорогом “Мерседесе”, он решил пройтись пешком, наслаждаясь тишиной заснеженного парка.
Вдруг он услышал слабый плач. Сначала подумал, что это ветер, но звук повторился. Дмитрий свернул к детской площадке и замер от ужаса. Под снегом лежала маленькая девочка, крепко прижимающая к себе двух младенцев. Её губы посинели от холода, а пальцы побелели.
Без раздумий он снял свою шубу, завернул детей и позвонил своему личному врачу. “Доктор Петров, срочно приезжайте в мой дом. Я нашёл троих детей в парке. Один без сознания.”
В его роскошной усадьбе на Рублёвке царила суматоха. Горничная Анна, верная слуга семьи Волковых больше десяти лет, быстро подготовила комнаты. Она ахнула, увидев, с какими детьми вернулся Дмитрий.
Когда девочка очнулась, её зелёные глаза расширились от страха. “Где малыши?” прошептала она. “Спит Вера, а где Маша?”
“С ними всё в порядке, малышка,” успокоил её Дмитрий. “Как тебя зовут?”
“Лиза,” еле с# Overview
This repository contains a set of scripts that perform the following actions:
1. `predict.py` – A deep learning model that predicts the angle of a steering wheel based on images of the road ahead. This script is designed to work with a simulator that generates training data.
2. `train.py` – A script that trains the deep learning model using the data collected from the simulator.
3. `drive.py` – A script that interfaces with the simulator to allow the model to drive the car autonomously.
# Prerequisites
Before running these scripts, ensure you have the following installed:
– Python 3.6 or later
– TensorFlow 2.x
– Keras
– NumPy
– OpenCV
– Flask (for the drive.py web server)
– The simulator provided by Udacity’s Self-Driving Car Engineer Nanodegree program
# Usage
## Collecting Data
1. Launch the Udacity simulator in training mode.
2. Use the simulator to drive the car around the track, ensuring to capture a variety of driving scenarios.
3. The simulator will save images from the car’s cameras along with corresponding steering angles in a CSV file.
## Training the Model
1. Place the collected data (images and CSV file) in a directory.
2. Run the training script:
“`bash
python train.py –data_dir path_to_your_data –epochs 10 –batch_size 32
“`
This will train the model and save the weights to a file named `model.h5`.
## Autonomous Driving
1. Launch the Udacity simulator in autonomous mode.
2. Start the drive script:
“`bash
python drive.py model.h5
“`
3. The script will create a local web server that the simulator can connect to.
4. The model will process the images from the simulator’s cameras and predict the steering angle to keep the car on the road.
# Model Architecture
The model used is based on the NVIDIA autonomous vehicle architecture, which consists of:
– Normalization layer
– Convolutional layers with ReLU activation
– Fully connected layers
– Dropout layers to prevent overfitting
# Data Augmentation
To improve the model’s robustness, the following augmentation techniques are applied:
– Random brightness adjustment
– Random horizontal flipping (with corresponding steering angle inversion)
– Random shadow addition
# Performance
The model is evaluated on a separate validation set to ensure it generalizes well to unseen data. The mean squared error (MSE) is used as the loss function during training.
# Notes
– Ensure that the simulator and the scripts are using the same image resolution and color space.
– The model may require fine-tuning for different tracks or driving conditions.
– Autonomous driving should only be performed in a simulated environment for safety.
# Credits
This project was inspired by the Udacity Self-Driving Car Engineer Nanodegree program and uses concepts from the NVIDIA End-to-End Learning for Self-Driving Cars paper.