for file in files:
srcfile = root + '/' + file
img = cv2.imread(root + '/' + file)
img = scipy.misc.imresize(img, (224, 224), 'bilinear')
new_im = np.zeros((3,224,224),dtype = np.float32)
new_im[0,:,:] = img[:,:,2]
new_im[1,:,:] = img[:,:,1]
new_im[2,:,:] = img[:,:,0]
img = new_im.copy()
#second way
im = image.load_img(srcfile,target_size = (224,224))
im = np.asarray(im,dtype=np.uint8)
im = im.transpose((2,0,1))
im = np.expand_dims(im, axis= 0)
img = np.expand_dims(img,axis= 0)
preds , n , m= vgg.predict(img)
preds2, n2,m2 = vgg.predict(im)
after looping through all images the classification performance, is a little bit different, can anyone guide me to the reason?
classification performance is totally different