inception 预处理
https://github.com/fchollet/keras/blob/master/keras/applications/inception_v3.py
def preprocess_input(x):
x /= 255.
x -= 0.5
x *= 2.
return x
vgg 预处理
if len(x.shape) == 3:
#print("[INFO] channel:{}".format(data_format))
if data_format == 'channels_first':
x = x.transpose(2, 0, 1)
elif len(x.shape) == 2:
if data_format == 'channels_first':
x = x.reshape((1, x.shape[0], x.shape[1]))
else:
x = x.reshape((x.shape[0], x.shape[1], 1))
else:
raise ValueError('Unsupported image shape: ', x.shape)
im[:,:,0] -= 103.939
im[:,:,1] -= 116.779
im[:,:,2] -= 123.68
top2
try
_________________________________________________________________
Layer (type) Output Shape Param #
===========