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

Preprocessing for each network #113

Closed
MayStepanyan opened this issue Mar 1, 2023 · 2 comments
Closed

Preprocessing for each network #113

MayStepanyan opened this issue Mar 1, 2023 · 2 comments

Comments

@MayStepanyan
Copy link

Hi, thanks for the huge work you've done! The package is very helpful

I have an issue figuring out what preprocessing each network's inputs need. Is there a list or some other place where I can look up this info?

@leondgarse
Copy link
Owner

Ya, I didn't make a list for that info. Currently you can get them by:

""" Get model rescale mode """
from keras_cv_attention_models import efficientnet
mm = efficientnet.EfficientNetV2B0()
print(mm.preprocess_input.rescale_mode)
# torch

""" Get the related mean std value for rescale mdoe """
from keras_cv_attention_models.imagenet import data
mean, std = data.init_mean_std_by_rescale_mode(mm.preprocess_input.rescale_mode)
print(mean, std)
# 0 255.0

Generally, it's just resize an image to mm.input_shape[1:-1], then apply mean and std (image - mean) / std.

@MayStepanyan
Copy link
Author

Great, thanks.

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