Skip to content

Commit 1a0e95d

Browse files
committed
REARRANGE
1 parent 08f99fb commit 1a0e95d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+165
-188207
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
data/
2+
models/
3+
*.record
4+
.ipynb_checkpoints/

README.md

+15-111
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
[//]: # (Image References)
23
[left0000]: ./examples/left0000.jpg
34
[left0003]: ./examples/left0003.jpg
@@ -9,148 +10,51 @@
910
[real0000]: ./examples/real0000.png
1011
[real0140]: ./examples/real0140.png
1112
[real0701]: ./examples/real0701.png
12-
[sim0003]: ./examples/sim0003.png
13-
[sim0011]: ./examples/sim0011.png
14-
[sim0027]: ./examples/sim0027.png
1513

1614
# Traffic Light Detection and Classification with TensorFlow Object Detection API
17-
---
1815

19-
#### A brief introduction to the project is available [here](https://medium.com/@Vatsal410/traffic-light-detection-tensorflow-api-c75fdbadac62)
16+
The project is forked from https://github.com/coldKnight/TrafficLight_Detection-TensorFlowAPI.git
2017

21-
---
18+
A brief introduction to the project is available [here](https://medium.com/@Vatsal410/traffic-light-detection-tensorflow-api-c75fdbadac62)
2219

23-
AWS AMI with all the software dependencies like TensorFlow and Anaconda (in the community AMIs) - `udacity-carnd-advanced-deep-learning`
2420

2521
### Get the dataset
2622

2723
[Drive location](https://drive.google.com/file/d/0B-Eiyn-CUQtxdUZWMkFfQzdObUE/view?usp=sharing)
2824

29-
### Get the models
30-
31-
Do `git clone https://github.com/tensorflow/models.git` inside the tensorflow directory
3225

33-
Follow the instructions at [this page](https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md) for installing some simple dependencies.
26+
### Get the tensorflow models lib
3427

35-
**All the files have to be kept inside the `tensorflow/models/research/` directory - data/, config/, data_conversion python files, .record files and utilitites/ ,etc.**
28+
Do `git clone https://github.com/tensorflow/models.git` and update directory in .sh files
3629

30+
Follow the instructions at [this page](https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md) for installing some simple dependencies.
3731

38-
### Location of pre-trained models:
32+
Location of pre-trained models:
3933
[pre-trained models zoo](https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md)
4034

41-
Download the required model tar.gz files and untar them into `/tensorflow/models/research/` directory with `tar -xvzf name_of_tar_file`.
42-
43-
### Creating TFRecord files:
44-
45-
`python data_conversion_udacity_sim.py --output_path sim_data.record`
46-
47-
`python data_conversion_udacity_real.py --output_path real_data.record`
48-
49-
---
50-
51-
## Commands for training the models and saving the weights for inference.
52-
53-
## Using Faster-RCNN model
54-
55-
### For Simulator Data
56-
57-
#### Training
58-
59-
`python object_detection/train.py --pipeline_config_path=config/faster_rcnn-traffic-udacity_sim.config --train_dir=data/sim_training_data/sim_data_capture`
60-
61-
#### Saving for Inference
62-
63-
`python object_detection/export_inference_graph.py --pipeline_config_path=config/faster_rcnn-traffic-udacity_sim.config --trained_checkpoint_prefix=data/sim_training_data/sim_data_capture/model.ckpt-5000 --output_directory=frozen_sim/`
64-
65-
66-
### For Real Data
67-
68-
#### Training
69-
70-
`python object_detection/train.py --pipeline_config_path=config/faster_rcnn-traffic_udacity_real.config --train_dir=data/real_training_data`
71-
72-
#### Saving for Inference
73-
74-
`python object_detection/export_inference_graph.py --pipeline_config_path=config/faster_rcnn-traffic_udacity_real.config --trained_checkpoint_prefix=data/real_training_data/model.ckpt-10000 --output_directory=frozen_real/`
75-
76-
---
77-
78-
## Using Inception SSD v2
35+
Download the required model tar.gz files and untar them into `models/` directory with `tar -xvzf name_of_tar_file`.
7936

80-
### For Simulator Data
8137

82-
#### Training
83-
84-
`python object_detection/train.py --pipeline_config_path=config/ssd_inception-traffic-udacity_sim.config --train_dir=data/sim_training_data/sim_data_capture`
85-
86-
#### Saving for Inference
38+
### Creating TFRecord files:
8739

88-
`python object_detection/export_inference_graph.py --pipeline_config_path=config/ssd_inception-traffic-udacity_sim.config --trained_checkpoint_prefix=data/sim_training_data/sim_data_capture/model.ckpt-5000 --output_directory=frozen_models/frozen_sim_inception/`
40+
`python data_conversion.py --input_yaml data/training_data/annotations_train.yaml --output_path data/train.record`
41+
`python data_conversion.py --input_yaml data/training_data/annotations_eval.yaml --output_path data/eval.record`
8942

9043

91-
### For Real Data
44+
## Using Faster-RCNN / Inception SSD v2 / MobileNet SSD v1 model
9245

9346
#### Training
9447

95-
`python object_detection/train.py --pipeline_config_path=config/ssd_inception-traffic_udacity_real.config --train_dir=data/real_training_data`
48+
`sh train.sh <faster_rcnn | ssd_inception | ssd_mobilene>`
9649

97-
#### Saving for Inference
98-
99-
`python object_detection/export_inference_graph.py --pipeline_config_path=config/ssd_inception-traffic_udacity_real.config --trained_checkpoint_prefix=data/real_training_data/model.ckpt-10000 --output_directory=frozen_models/frozen_real_inception/`
50+
#### Saving Weights for Inference
10051

52+
`sh freeze.sh <faster_rcnn | ssd_inception | ssd_mobilene> <model checkpoint version num>`
10153
---
10254

103-
## Using MobileNet SSD v1
104-
(Due to some unknown reasons the model gets trained but does not save for inference. Ignoring this for now.)
105-
106-
### For Simulator Data
107-
108-
#### Training
109-
110-
`python object_detection/train.py --pipeline_config_path=config/ssd_mobilenet-traffic-udacity_sim.config --train_dir=data/sim_training_data/sim_data_capture`
111-
112-
#### Saving for Inference
113-
114-
`python object_detection/export_inference_graph.py --pipeline_config_path=config/ssd_mobilenet-traffic-udacity_sim.config --trained_checkpoint_prefix=data/sim_training_data/sim_data_capture/model.ckpt-5000 --output_directory=frozen_models/frozen_sim_mobile/`
115-
116-
117-
### For Real Data
118-
119-
#### Training
120-
121-
`python object_detection/train.py --pipeline_config_path=config/ssd_mobilenet-traffic_udacity_real.config --train_dir=data/real_training_data`
122-
123-
#### Saving for Inference
124-
125-
`python object_detection/export_inference_graph.py --pipeline_config_path=config/ssd_mobilenet-traffic_udacity_real.config --trained_checkpoint_prefix=data/real_training_data/model.ckpt-10000 --output_directory=frozen_models/frozen_real_mobile/`
126-
127-
---
12855

12956
**Inference results can be viewed using the TrafficLightDetection-Inference.ipynb or .html files.**
13057

13158
### Camera Image and Model's Detections
13259
![alt-text][left0000]
13360
![alt-text][real0000]
134-
135-
![alt-text][left0140]
136-
![alt-text][real0140]
137-
138-
![alt-text][left0701]
139-
![alt-text][real0701]
140-
141-
![alt-text][left0003]
142-
![alt-text][sim0003]
143-
144-
![alt-text][left0011]
145-
![alt-text][sim0011]
146-
147-
![alt-text][left0027]
148-
![alt-text][sim0027]
149-
150-
---
151-
152-
#### Some useful links
153-
154-
- [Uploading/Downloading files between AWS and GoogleDrive](http://olivermarshall.net/how-to-upload-a-file-to-google-drive-from-the-command-line/)
155-
156-
- [Using Jupyter notebooks with AWS](https://medium.com/towards-data-science/setting-up-and-using-jupyter-notebooks-on-aws-61a9648db6c5)

0 commit comments

Comments
 (0)