Skip to content

Commit

Permalink
overall some small changes
Browse files Browse the repository at this point in the history
Not worth to break them up.
1. some README changes
2. the set steering model button removed from DriveApp.py
3. some image added.
  • Loading branch information
NeilNie committed Apr 14, 2018
1 parent 53546e6 commit 236b1d4
Show file tree
Hide file tree
Showing 20 changed files with 247 additions and 540 deletions.
Binary file modified .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/self-driving-golf-cart.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

160 changes: 75 additions & 85 deletions .idea/workspace.xml

Large diffs are not rendered by default.

316 changes: 0 additions & 316 deletions .ipynb_checkpoints/attention-checkpoint.ipynb

This file was deleted.

174 changes: 106 additions & 68 deletions .ipynb_checkpoints/visualize_attention-checkpoint.ipynb

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions detection/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Welcome to Detection

This is the detectio module. There are three submodules.

1. Object detection
2. Lane detection
3. Traffic light detection
8 changes: 2 additions & 6 deletions driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,12 @@

class Driver:

def __init__(self, steering_model, cruise_control=False, seg_vis=False, obj_det=False, det_vis=False, gps=False):
def __init__(self, steering_model, cruise_control=False, seg_vis=False, obj_det=False, gps=False):

self.steering_model = steering_model
self.cruise_control = cruise_control
self.seg_vis = seg_vis
self.obj_det = obj_det
self.det_vis = det_vis
self.gps = gps

# initialize some private variable
Expand Down Expand Up @@ -133,7 +132,7 @@ def drive(self):

if cap.isOpened():

windowName = "self driving car...running"
windowName = "self driving car... running"
cv2.namedWindow(windowName, cv2.WINDOW_NORMAL)
cv2.resizeWindow(windowName, 1100, 470)
cv2.moveWindow(windowName, 0, 0)
Expand All @@ -154,8 +153,6 @@ def drive(self):

# ------------------ segmentation -------------------------
# press down on "a" key to disable stopping

# TODO: Test this new implementation of stopping
if cv2.waitKey(33) == ord('a'):
self.__disable_stopping = not self.__disable_stopping

Expand Down Expand Up @@ -190,7 +187,6 @@ def drive(self):

# visualizing steering class activation
# checks for the key if the user pressed "h"
# TODO: Make sure this code is bug free
if cv2.waitKey(104) == ord('h'):
self.__steering_heatmap = not self.__steering_heatmap
if self.__steering_heatmap:
Expand Down
Binary file modified engineering/.DS_Store
Binary file not shown.
Binary file removed engineering/Microsoft-LifeCam-Cinema-HD-01.jpg
Binary file not shown.
22 changes: 6 additions & 16 deletions gui/DriveApp.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ def __init__(self, parent, *args, **kwargs):
self.winfo_toplevel().title("self driving golf cart")
self.parent.resizable(width=False, height=False)
self.parent.geometry('{}x{}'.format(300, 350))
# self.parent.iconbitmap(r'/home/neil/Workspace/self-driving-golf-cart/media/icon.ico')
self.create_label("Welcome to the autnomous vehicle program")

# ---- drop down menu ------
Expand All @@ -23,8 +22,8 @@ def __init__(self, parent, *args, **kwargs):
self.var.set("Own")
self.option = tk.OptionMenu(self, self.var, "Own", "Komanda", "Autumn", "AutoPilot")
self.option.pack()
self.button = tk.Button(self, text="OK", command=self.set_steering_model, bg="yellow")
self.button.pack()
# self.button = tk.Button(self, text="OK", command=self.set_steering_model)
# self.button.pack()

# -----------
self.create_label("Please specify run configeration")
Expand All @@ -42,11 +41,6 @@ def __init__(self, parent, *args, **kwargs):
self.cb3 = tk.Checkbutton(self, text="Object Detection", variable=self.detc_bool)
self.cb3.pack()

self.detc_vis = tk.IntVar()
self.detc_vis.set(1)
self.cb4 = tk.Checkbutton(self, text="Detection Visualization", variable=self.detc_vis)
self.cb4.pack()

self.gps_bool = tk.IntVar()
self.cb5 = tk.Checkbutton(self, text="GPS", variable=self.gps_bool)
self.cb5.pack()
Expand All @@ -55,29 +49,25 @@ def __init__(self, parent, *args, **kwargs):
self.beginButton = tk.Button(self, text="Begin", command=self.begin)
self.beginButton.pack()

# -- init driver -----
self.steering_model = None

self.create_label("Once the program has started: ")
self.create_label("- Press the 'a' key to disable braking")
self.create_label("- Press the 'h' key to visualize steering with activation map.")

def begin(self):

if self.steering_model != None:

self.driver = Driver(steering_model=self.steering_model,
self.driver = Driver(steering_model=self.var.get(),
cruise_control=self.cc_bool.get(),
seg_vis=self.seg_vis.get(),
obj_det=self.detc_bool.get(),
det_vis=self.detc_vis.get(),
gps=self.gps_bool.get())


self.driver.drive()
else:
messagebox.showerror("Error", "Please select a steering model and click OK")

def set_steering_model(self):
self.steering_model = self.var.get()
print(self.steering_model)

def create_label(self, str):
string = tk.StringVar()
Expand Down
Binary file modified logger/.DS_Store
Binary file not shown.
Empty file removed logger/ros_data_logger.py
Empty file.
Binary file modified media/.DS_Store
Binary file not shown.
Binary file added media/attention.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 36 additions & 42 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ Flask == 0.12.2

# cruise/model.py: 5,6,7,8
# cruise/visualization.py: 14,15
# detection/object/device_test.py: 29,32
# detection/object/object_detector.py: 11,13
# detection/object/visualize_detection.py: 10,11
# detection/object/object_detector.py: 34,35
# detection/object/yad2k/models/keras_darknet19.py: 5,6,7,8,9
# detection/object/yad2k/models/keras_yolo.py: 6,7,8,9
# semantic_segmentation/models/__init__.py: 2
Expand All @@ -28,25 +26,24 @@ Flask == 0.12.2
# semantic_segmentation/models/icnet/model.py: 6,7,8,9
# semantic_segmentation/models/layers/core.py: 2,3,4,5,9,23
# semantic_segmentation/models/layers/pooling.py: 2,3
# semantic_segmentation/segmentor.py: 14
# semantic_segmentation/visualization.py: 13,17
# steering/autumn.py: 12,13,14,15,17,18,19,20
# steering/models.py: 6,7,8,9,10
# steering/rambo.py: 6
# steering/rambo.py: 10
# steering/validation.py: 3
# steering/visualization/data.py: 5
# steering/visualization/model.py: 3,4,6
Keras == 2.1.5

# detection/object/device_test.py: 30
# detection/object/object_detector.py: 12
# detection/object/visualize_detection.py: 12
# detection/object/object_detector.py: 36
# detection/object/yad2k/utils/draw_boxes.py: 7
# semantic_segmentation/segmentor.py: 18
# gui/info_screen.py: 13,14,15
# semantic_segmentation/segmentor.py: 16
# semantic_segmentation/steering_simulation.py: 10
# semantic_segmentation/visualization.py: 18
# steering/autumn.py: 8,9,10
# steering/simulation.py: 9
# steering/steering_predictor.py: 4,5,6
# steering/visualization/visualization.py: 8,9,10
Pillow == 5.1.0

# semantic_segmentation/steering_simulation.py: 5
Expand All @@ -59,13 +56,16 @@ googlemaps == 2.5.1
# localization/gps.py: 1
gpsd_py3 == 0.3.0

# detection/object/voc_conversion_scripts/voc_to_hdf5.py: 16
# steering/visualization/model.py: 5
h5py == 2.7.1

# driver.py: 22
# detection/object/device_test.py: 30
# logger/dataset_collector.py: 10
imutils == 0.4.6

# steering/visualization/visualization.py: 15
keras_vis == 0.4.1

# cruise/train.py: 7
# detection/lane/lane_detector.py: 9
# semantic_segmentation/segmentation_analyzer.py: 6
Expand All @@ -74,19 +74,17 @@ imutils == 0.4.6
# semantic_segmentation/visualization.py: 12
# steering/train.py: 7
# steering/visualization/dataset_visualizer.py: 14,15,16
# steering/visualization/steering_visualizer.py: 14,15,16
# steering/visualization/testing_visualizer.py: 14,15,16
# steering/visualization/visualization.py: 11,14
matplotlib == 2.2.2

# cruise/train.py: 10
# cruise/utils.py: 2
# cruise/visualization.py: 7
# detection/lane/lane_detector.py: 6
# detection/lane/utils.py: 8
# detection/object/device_test.py: 27
# detection/object/object_detector.py: 10
# detection/object/visualize_detection.py: 9
# detection/object/voc_conversion_scripts/voc_to_hdf5.py: 17
# detection/object/voc_conversion_scripts/voc_to_tfrecords.py: 16
# detection/object/device_test.py: 29
# detection/object/object_detector.py: 33
# detection/object/yad2k/models/keras_yolo.py: 4
# detection/object/yad2k/utils/draw_boxes.py: 6
# detection/traffic-light/scripts/cfg/process.py: 5
Expand All @@ -113,36 +111,36 @@ matplotlib == 2.2.2
# detection/traffic-light/scripts/utils/im_transform.py: 1
# detection/traffic-light/scripts/utils/images_to_mp4.py: 3
# detection/traffic-light/scripts/utils/loader.py: 4
# driver.py: 26
# driver.py: 33
# gui/info_screen.py: 16
# logger/dataset_collector.py: 15
# semantic_segmentation/segmentor.py: 17
# semantic_segmentation/segmentor.py: 15
# semantic_segmentation/steering_simulation.py: 3
# semantic_segmentation/test.py: 4
# semantic_segmentation/train.py: 5
# semantic_segmentation/utils.py: 12
# semantic_segmentation/visualization.py: 16
# steering/komanda.py: 15
# steering/pc_test.py: 10
# steering/preprocess_dataset.py: 10
# steering/rambo.py: 3
# steering/rambo.py: 7
# steering/simulation.py: 6
# steering/steering_predictor.py: 2
# steering/train.py: 3
# steering/utils.py: 2
# steering/validation.py: 1
# steering/visualization/data.py: 4
# steering/visualization/dataset_visualizer.py: 9
# steering/visualization/steering_visualizer.py: 9
# steering/visualization/testing_visualizer.py: 9
# steering/visualization/visualization.py: 7
numpy == 1.14.2

# cruise/cruise_predictor.py: 8
# cruise/utils.py: 1
# cruise/visualization.py: 8
# detection/lane/lane_detector.py: 7
# detection/lane/utils.py: 7
# detection/object/device_test.py: 26
# detection/object/object_detector.py: 7
# detection/object/visualize_detection.py: 5
# detection/object/device_test.py: 28
# detection/object/object_detector.py: 29
# detection/traffic-light/scripts/darkflow.py: 4
# detection/traffic-light/scripts/net/flow.py: 2
# detection/traffic-light/scripts/net/help.py: 9
Expand All @@ -153,50 +151,47 @@ numpy == 1.14.2
# detection/traffic-light/scripts/utils/im_transform.py: 2
# detection/traffic-light/scripts/utils/images_to_mp4.py: 1
# detection/traffic-light/scripts/utils/udacity_voc_csv.py: 8
# driver.py: 25
# driver.py: 32
# logger/dataset_collector.py: 14
# logger/recorder.py: 1
# semantic_segmentation/segmentation_analyzer.py: 1
# semantic_segmentation/segmentor.py: 16
# semantic_segmentation/segmentor.py: 14
# semantic_segmentation/test.py: 1
# semantic_segmentation/utils.py: 9
# semantic_segmentation/visualization.py: 14
# steering/autumn.py: 7
# steering/komanda.py: 14
# steering/pc_test.py: 11
# steering/preprocess_dataset.py: 6
# steering/rambo.py: 9
# steering/rambo.py: 13
# steering/simulation.py: 5
# steering/steering_predictor.py: 3
# steering/train.py: 2
# steering/utils.py: 1
# steering/validation.py: 7
# steering/visualization/data.py: 1
# steering/visualization/dataset_visualizer.py: 10
# steering/visualization/steering_visualizer.py: 10
# steering/visualization/testing_visualizer.py: 10
# steering/visualization/visualization.py: 17
opencv_python == 3.4.0.12

# cruise/train.py: 6
# cruise/utils.py: 5
# cruise/visualization.py: 10
# detection/object/visualize_detection.py: 7
# semantic_segmentation/train.py: 7
# semantic_segmentation/visualization.py: 15
# steering/pc_test.py: 12
# steering/preprocess_dataset.py: 7
# steering/train.py: 1
# steering/utils.py: 3
# steering/validation.py: 4
# steering/visualization/dataset_visualizer.py: 12
# steering/visualization/steering_visualizer.py: 12
# steering/visualization/testing_visualizer.py: 12
pandas == 0.22.0

# cruise/visualization.py: 9
# detection/object/visualize_detection.py: 16
# semantic_segmentation/visualization.py: 19
# steering/preprocess_dataset.py: 9
# steering/visualization/dataset_visualizer.py: 11
# steering/visualization/steering_visualizer.py: 11
# steering/visualization/testing_visualizer.py: 11
pygame == 1.9.3

# cruise/sc.py: 6
Expand All @@ -208,11 +203,11 @@ pyserial == 3.4
# steering/simulation.py: 7
python_socketio == 1.9.0

# steering/pc_test.py: 21
# steering/preprocess_dataset.py: 11
# steering/rambo.py: 7
# steering/rambo.py: 11
# steering/visualization/dataset_visualizer.py: 29
# steering/visualization/steering_visualizer.py: 19
# steering/visualization/testing_visualizer.py: 19
# steering/visualization/visualization.py: 12
scikit_image == 0.13.1

# semantic_segmentation/segmentation_analyzer.py: 4
Expand All @@ -222,12 +217,11 @@ scikit_image == 0.13.1
# steering/auto_pilot.py: 6
# steering/autumn.py: 6
# steering/komanda.py: 12
# steering/rambo.py: 8
# steering/rambo.py: 12
# steering/simulation.py: 12
# steering/validation.py: 10
scipy == 1.0.1

# detection/object/voc_conversion_scripts/voc_to_tfrecords.py: 17
# detection/object/yad2k/models/keras_yolo.py: 5,31
# detection/traffic-light/scripts/net/build.py: 1
# detection/traffic-light/scripts/net/flow.py: 5
Expand All @@ -245,7 +239,7 @@ scipy == 1.0.1
# steering/models.py: 11
tensorflow == 1.7.0

# driver.py: 29
# driver.py: 34
# helper.py: 1
# logger/dataset_collector.py: 16
termcolor == 1.1.0
Binary file modified steering/.DS_Store
Binary file not shown.
15 changes: 12 additions & 3 deletions steering/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Welcome to Autonomous Steering Control Sytetm (ASCS)
# Welcome to Autonomous Steering Control System (ASCS)
One of the most important aspect of the vehicle is the autonomous steering system.

![](../media/ascs.JPG)

## About this directory
### Training
`train.py` trains the ConvNet

`model.pys` has all the model architectures
`models.py` has all the model architectures

### Running
`steering_predictor` is a class that `drive.py` calls. The predictor takes in an image and return a visualization and steering angle.
Expand All @@ -15,8 +16,16 @@ One of the most important aspect of the vehicle is the autonomous steering syste

`./motor_control` has the arduino motor control program.

### Visualization
I have implemented some methods for you to visualize the autonomous steering system. All of those scripts can be found in the `./visualization` directory.

`testing_visualizer.py` allows you to visualize the trained results. You must have the [Udacity validation dataset](https://github.com/udacity/self-driving-car/blob/master/datasets/CH2/Ch2_001.tar.gz.torrent).

There is also a attention visualizatio script which the car uses to draw a heatmap overlay on the input image. You can use this to study the behavior of the model.

![](../media/attention.png)

## Others
`steering_visualization.py` allows you to visualize the trained results. You must have the [Udacity validation dataset](https://github.com/udacity/self-driving-car/blob/master/datasets/CH2/Ch2_001.tar.gz.torrent).

`simulation.py` allows you to run a trained model on the Udacity driving simulator. You can download it here.

Expand Down
Binary file modified steering/__pycache__/configs.cpython-36.pyc
Binary file not shown.
Loading

0 comments on commit 236b1d4

Please sign in to comment.