I am trying to categorize the dog breeding identification using CNN. I have converted the images to gray scale and re-scaled them in order to be smaller in size. So now I am trying to add them in numpy array and do the training. Also I will use Relu activation function because it performs well with multi layer and a categorical cross entropy for the different categories of dog breeding.
Below is the code for grayscale and re-scale:
def RescaleGrayscaleImg():
# iterate through the names of contents of the folder
for image_path in os.listdir(path):
# create the full input path and read the file
input_path = os.path.join(path, image_path)
# make image grayscale
img = io.imread(input_path)
img_scaled = rescale(img, 2.0 / 4.0)
GrayImg = color.rgb2gray(img_scaled)
# create full output path, 'example.jpg'
# becomes 'grayscaled_example.jpg', save the file to disk
fullpath = os.path.join(outPath, 'grayscaled_'+image_path)
misc.imsave(fullpath, GrayImg)
How I will convert the images to array? Will each column be an image?