I am trying to execute a piece of code using Hog() to find the car from the given picture. I am facing an error when I execute the following code.
test_img = mpimg.imread('./test_images/test4.jpg') ystart = 400 ystop = 660 scale = 1.5 colorspace = 'YUV' orient = 11 pix_per_cell = 16 cell_per_block = 2 hog_channel = 'ALL' rectangles = find_cars(test_img, ystart, ystop, scale, colorspace, hog_channel, svc, None, orient, pix_per_cell,cell_per_block, None, None)
The error which I am facing is given below.
ValueError: Expected 2D array, got 1D array instead:
array=[0.12365632 0.10520883 0.13647298 … 0.00876717 0.00176261 0.00102563].
Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.