Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mazatov opened this issue Dec 8, 2021 · 3 comments
Open

Comments

@mazatov
Copy link

mazatov commented Dec 8, 2021

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
Copy link
Owner

ZFTurbo commented Dec 8, 2021

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
Copy link
Author

mazatov commented Dec 8, 2021

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

@ZFTurbo
Copy link
Owner

ZFTurbo commented Dec 8, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants