ZFTurbo / classification_models_3D

Set of models for classifcation of 3D volumes
MIT License
155 stars 29 forks source link

How to make sure preprocess function is doing what it's supposed to? #4

Open mazatov opened 2 years ago

mazatov commented 2 years ago

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 2 years ago

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 2 years ago

Interesting. I was just basing it on this line: ResNet18, preprocess_input = Classifiers.get('resnet18')

ZFTurbo commented 2 years ago

Yes. You do it right. preprocess_input for these models returns input as is.