@@ -0,0 +1,1849 @@
+import matplotlib.image as mpimg%0Aimport matplotlib.pyplot as plt%0Aimport numpy as np%0Aimport cv2%0Aimport glob%0Aimport os%0A#from skimage.feature import hog%0A#from skimage import color, exposure%0A# images are divided up into vehicles and non-vehicles%0A%0Aos.chdir('./objects')%0A%0A# Define a function to return some characteristics of the dataset%0Adef data_look(car_list, notcar_list):%0A    data_dict = %7B%7D%0A    # Define a key in data_dict %22n_cars%22 and store the number of car images%0A    data_dict%5B%22n_cars%22%5D = len(car_list)%0A    # Define a key %22n_notcars%22 and store the number of notcar images%0A    data_dict%5B%22n_notcars%22%5D = len(notcar_list)%0A    # Read in a test image, either car or notcar%0A    test_img = mpimg.imread(car_list%5B0%5D)%0A    # Define a key %22image_shape%22 and store the test image shape 3-tuple%0A    data_dict%5B%22image_shape%22%5D = test_img.shape%0A    # Define a key %22data_type%22 and store the data type of the test image.%0A    data_dict%5B%22data_type%22%5D = test_img.dtype%0A    # Return data_dict%0A    return data_dict%0A%0Adef main():%0A%0A    images = glob.glob('*.jpeg')%0A    cars = %5B%5D%0A    notcars = %5B%5D%0A%0A    for image in images:%0A        if 'image' in image or 'extra' in image:%0A            notcars.append(image)%0A        else:%0A            cars.append(image)%0A%0A    data_info = data_look(cars, notcars)%0A    # Just for fun choose random car / not-car indices and plot example images%0A    car_ind = np.random.randint(0, len(cars))%0A    notcar_ind = np.random.randint(0, len(notcars))%0A%0A    # Read in car / not-car images%0A    car_image = mpimg.imread(cars%5Bcar_ind%5D)%0A    notcar_image = mpimg.imread(notcars%5Bnotcar_ind%5D)%0A%0A    # Plot the examples%0A%0A    fig = plt.figure()%0A    plt.subplot(121)%0A    plt.imshow(car_image)%0A    plt.title('Example Car Image')%0A    plt.subplot(122)%0A    plt.imshow(notcar_image)%0A    plt.title('Example Not-car Image')%0A    plt.show()%0A%0A%0Aif __name__ == '__main__':%0A    main()%0A

Add scripts which define a function to return some characteristics of the dataset