Transfer learning has been used to detect and classify traffic lights. The following models were considered -
An AWS Deep Learning AMI has been used for training the model. The following steps were used -
The training dependencies can be installed by following the steps outlined on this page
Download Tensorflow models
git clone https://github.com/tensorflow/models.git
cd models/research
export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim
cd object_detection
There are 2 options for training data. Download Training data or
build training data by using annotation tools like LabelImg and include the TFrecord file in the
./data
folder
# Ensure that the models are downloaded into the /research/object_detection folder
wget http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v1_coco_2018_01_28.tar.gz
unzip ssd_mobilenet_v1_coco_2018_01_28.tar.gz
# Verify that the current directory is (/models/research/object_detection)
wget https://raw.githubusercontent.com/vishal-kvn/TrafficLight_Detection_Classification/master/config/ssd_mobilenet_v1.config
cd /data
wget https://raw.githubusercontent.com/vishal-kvn/TrafficLight_Detection_Classification/master/data/traffic_light_label_map.pbtxt
python model_main.py \
--pipeline_config_path='./ssd_mobilenet_v1.config' \
--model_dir='training_ssd_mobilenet_v1_sim/' \
--sample_1_of_n_eval_examples=1 \
--alsologtostderr
python export_inference_graph.py \
--input_type image_tensor \
--pipeline_config_path ./ssd_mobilenet_v1.config \
--trained_checkpoint_prefix training_ssd_mobilenet_v1_sim/model.ckpt-5000\
--output_directory ssd_mobilenet_v1_inference_graph
jupyter notebook --ip=0.0.0.0 --no-browser #Ensure that a rule is added to the security group to accept inbound traffic on port 8888.
Copy the IP address of the ec2 instance and view the notebook and run all cells