Skip to content

Commit

Permalink
Update run_dataset.py
Browse files Browse the repository at this point in the history
  • Loading branch information
zitaoc authored Jul 23, 2019
1 parent 5c92e87 commit 6fb2b70
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions Tests/DNN-model/comma-ai-steering-model/run_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@
fi = ti.TensorFI(sess, logLevel = 50, name = "convolutional", disableInjections=True)


i = 140
imgIndex = 140
#while(cv2.waitKey(10) != ord('q')):

for j in range(1):
full_image = scipy.misc.imread("driving_dataset/" + str(i) + ".jpg", mode="RGB")

for i in range(1): # num of imgs to be injected
full_image = scipy.misc.imread("driving_dataset/" + str(imgIndex) + ".jpg", mode="RGB")
image = scipy.misc.imresize(full_image[-150:], [66, 200]) / 255.0

'''
Expand All @@ -52,13 +53,14 @@



fi.turnOnInjections()
ti.faultTypes.sequentialFIinit()
fi.turnOnInjections()

totalFI = 0.
sdcCount = 0
# for k in range(3100):
while(ti.faultTypes.isKeepDoingFI):

fiCount = 100
for k in range(fiCount):
# steering angle under fault
degrees = model.y.eval(feed_dict={model.x: [image], model.keep_prob: 1.0})[0][0] * 180.0 / scipy.pi

totalFI += 1
Expand Down Expand Up @@ -88,6 +90,5 @@
# dst = cv2.warpAffine(img,M,(cols,rows))
# cv2.imshow("steering wheel", dst)

i += 1

cv2.destroyAllWindows()

0 comments on commit 6fb2b70

Please sign in to comment.