Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues Fixed in 'driving_data.py' and 'run_dataset.py' Files #51

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .idea/.gitignore

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

8 changes: 8 additions & 0 deletions .idea/Autopilot-TensorFlow.iml

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

14 changes: 14 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

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

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

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

7 changes: 7 additions & 0 deletions .idea/misc.xml

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

8 changes: 8 additions & 0 deletions .idea/modules.xml

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

6 changes: 6 additions & 0 deletions .idea/vcs.xml

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

13 changes: 11 additions & 2 deletions driving_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import random
import numpy as np


xs = []
ys = []

Expand All @@ -16,7 +17,15 @@
#the paper by Nvidia uses the inverse of the turning radius,
#but steering wheel angle is proportional to the inverse of turning radius
#so the steering wheel angle in radians is used as the output
ys.append(float(line.split()[1]) * 3.14159265 / 180)
# Assuming the value you want to convert is in line.split()[1]
raw_value = line.split()[1]

# Extract only the numeric part (remove the comma and year)
numeric_part = raw_value.split(',')[0]

# Convert the numeric part to a float
ys.append(float(numeric_part) * 3.14159265 / 180)


#get number of images
num_images = len(xs)
Expand Down Expand Up @@ -53,4 +62,4 @@ def LoadValBatch(batch_size):
x_out.append(cv2.resize(cv2.imread(val_xs[(val_batch_pointer + i) % num_val_images])[-150:], (200, 66)) / 255.0)
y_out.append([val_ys[(val_batch_pointer + i) % num_val_images]])
val_batch_pointer += batch_size
return x_out, y_out
return x_out, y_out
Binary file not shown.
5 changes: 4 additions & 1 deletion run_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import cv2
from subprocess import call
import os
import time

#check if on windows OS
windows = False
Expand Down Expand Up @@ -36,4 +37,6 @@
cv2.imshow("steering wheel", dst)
i += 1

cv2.destroyAllWindows()
time.sleep(0.04)

cv2.destroyAllWindows()
Binary file added save/model.ckpt.data-00000-of-00001
Binary file not shown.
Binary file added save/model.ckpt.index
Binary file not shown.
Binary file modified save/model.ckpt.meta
Binary file not shown.