diff --git a/main.py b/main.py index 254237d..bce384a 100644 --- a/main.py +++ b/main.py @@ -11,14 +11,15 @@ # we run the algorithm on Caltech Pedestrian and Nexet Dataset # set the corresponding directory of the dataset here -inDirectory = "Datasets/Nexet_1" -outDirectory = inDirectory + "_out" -if not os.path.exists(outDirectory): - os.makedirs(outDirectory) -imageNames = os.listdir(inDirectory + "/") +inDirectory = "Datasets/Caltech_Pedestrian" + # Nexet dataset if(inDirectory == "Datasets/Nexet_1"): + outDirectory = inDirectory + "_out" + if not os.path.exists(outDirectory): + os.makedirs(outDirectory) + imageNames = os.listdir(inDirectory + "/") for imageName in imageNames: if imageName == '.DS_Store': continue @@ -28,7 +29,7 @@ out = process_image(image) mpimg.imsave(outDirectory + "/" + imageName, out) # print("Processed " + outDirectory + "/" + imageName) - print("Processing complete.") + print("Processing complete.") # Caltech Pedestrian dataset @@ -47,8 +48,7 @@ '''NOTE: this function expects color images!! this runs the function process_image over each frame of the video''' white_clip = clip1.fl_image(process_image) - print("Processing complete.") - # %time white_clip.write_videofile(white_output, audio=False) + white_clip.write_videofile(white_output, audio=False) ''' Helper functions for seq file processing''' diff --git a/utils/functions.py b/utils/functions.py index eb9ad60..def24ec 100644 --- a/utils/functions.py +++ b/utils/functions.py @@ -1,4 +1,4 @@ -print("Functions") +# print("Functions") import math import numpy as np diff --git a/utils/globalvars.py b/utils/globalvars.py index c6ab9f1..77da250 100644 --- a/utils/globalvars.py +++ b/utils/globalvars.py @@ -1,4 +1,4 @@ -print("Globals") +# print("Globals") global avgLeft global avgRight diff --git a/utils/process_image.py b/utils/process_image.py index 5f95ad4..1b3e714 100644 --- a/utils/process_image.py +++ b/utils/process_image.py @@ -77,12 +77,6 @@ def process_image(image): # Test detected edges by uncommenting this #return cv2.cvtColor(regionInterestImage, cv2.COLOR_GRAY2RGB) - # draw ROI on the image for visualization - cv2.line(image, (vertices[0][0], vertices[0][1]), (vertices[1][0], vertices[1][1]), [255,255,0], 10) - cv2.line(image, (vertices[1][0], vertices[1][1]), (vertices[2][0], vertices[2][1]), [255,255,0], 10) - cv2.line(image, (vertices[2][0], vertices[2][1]), (vertices[3][0], vertices[3][1]), [255,255,0], 10) - cv2.line(image, (vertices[3][0], vertices[3][1]), (vertices[0][0], vertices[0][1]), [255,255,0], 10) - # draw output on top of original weightedImage = weighted_img(lineMarkedImage, image)