classification_models_3D
classification_models_3D copied to clipboard
How to make sure preprocess function is doing what it's supposed to?
For example, I'm trying out resnet152 and the preprocess_function doesn't seem to do anything. Just giving back the same output.
ResNet18, preprocess_input = Classifiers.get('resnet18')
preprocess_input(np.array([[1000,1],[-2,5]]))
Out[27]:
array([[1000, 1],
[ -2, 5]])
As I remember these models were trained without any preprocessing.
Thier first layer is BatchNorm:
# resnet bottom
x = layers.BatchNormalization(name='bn_data', **no_scale_bn_params)(img_input)
Interesting. I was just basing it on this line:
ResNet18, preprocess_input = Classifiers.get('resnet18')
Yes. You do it right. preprocess_input for these models returns input as is.