How to make sure preprocess function is doing what it's supposed to?
Opened this issue · 3 comments
mazatov commented
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]])
ZFTurbo commented
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)
mazatov commented
Interesting. I was just basing it on this line:
ResNet18, preprocess_input = Classifiers.get('resnet18')
ZFTurbo commented
Yes. You do it right. preprocess_input
for these models returns input as is.