Comments (10)
@whatdhack, The mode of preprocess_input
is not related to the backend. It stands for the library used in the original repository (e.g., VGG: caffe).
from keras-applications.
@whatdhack, The mode of preprocess_input
is originated from each model's original repository:
caffe
: 'RGB'->'BGR' followed byx -= [103.939, 116.779, 123.68]
(e.g.,VGG16
andVGG19
),tf
:x /= 127.5
followed byx -= 1
(e.g.,InceptionV3
andInceptionResNetV2
),torch
:x /= 255.
followed byx -= [0.485, 0.456, 0.406]
andx /= [0.229, 0.224, 0.225]
(e.g.,DenseNet121
andDenseNet169
).
If you are trying to deploy the pretrained networks, it is not an option to modify the mode designated for each model. Otherwise, you can choose another mode but it is not so recommended.
from keras-applications.
@whatdhack, It doesn't need to be documented because end-users will not directly call imagenet_utils.preprocess_input
. And, the mode of preprocess_input
is about only normalization and orthogonal to the backend (i.e., caffe
mode works on all the backends).
from keras-applications.
@taehoonlee , that is a good start. Can put more details in your answers. Your answers are cryptic ( and incomplete) . Looks like you are closing these issues for the sake of closing.
from keras-applications.
@taehoonlee , for the pre-trained models (e.g. VGG16) , it needs to be documented what modes are applicable. otherwise it takes time to run experiments and figure out what modes are available. For VGG16 it looks like, the pre-trained model can only handle 'caffe' mode.
A related question is the support across different backend uniform (i.e. does the 'caffe' mode work across TF, PyTorch , CNTK , etc . ) ?
from keras-applications.
@taehoonlee Really ? All the Keras applications examples use preprocess_input . See for yourself - vgg16
from keras-applications.
@whatdhack, Users will use a wrapper function preprocess_input(x)
rather than a imagenet_utils.preprocess_input(x, data_format, mode)
. The example also presents x = preprocess_input(x)
.
from keras-applications.
@taehoonlee , I am not sure I can take your word on this one as you did not even know usage of process_input() before I pointed that out. Documentation on preprocess_input() will clarify the confusion.
from keras-applications.
:)
from keras-applications.
Seems legit, but the naming is awfully confusing for someone looking into the code (for exploration or debugging purposes)
@whatdhack, The mode of
preprocess_input
is originated from each model's original repository:
caffe
: 'RGB'->'BGR' followed byx -= [103.939, 116.779, 123.68]
(e.g.,VGG16
andVGG19
),tf
:x /= 127.5
followed byx -= 1
(e.g.,InceptionV3
andInceptionResNetV2
),torch
:x /= 255.
followed byx -= [0.485, 0.456, 0.406]
andx /= [0.229, 0.224, 0.225]
(e.g.,DenseNet121
andDenseNet169
).If you are trying to deploy the pretrained networks, it is not an option to modify the mode designated for each model. Otherwise, you can choose another mode but it is not so recommended.
from keras-applications.
Related Issues (20)
- [Requested Queries]: Adding features in keras-application for Object Detection API!
- ValueError: Unable to create group (name already exists)` when saving MobilenetV3 model to .h5 HOT 2
- AttributeError: Can't Import EfficientNet! HOT 1
- Model not accepting same input shape image defined in input layer. HOT 2
- Settings used for ImageNet pre-training
- Imagenet pretrained weights not match the current implementation of ResNext, thanks HOT 2
- InceptionResnetV2 summary() seems to be another network as it does not look like the one in the paper. HOT 1
- [Request] Adding Vision Transformer (ViT) in Keras
- Efficientnet's BASE_WEIGHTS_PATH points to external release
- shufflenet v2
- The drop connect rate (aka survival rate) is incorrect HOT 9
- Missing one conv2d layer in inceptionv3?
- AutoGraph could not transform model.make_predict_function ... and run it as-is.
- problem with loading keras model
- How to create ResNetD?
- Will keras applications keep update?
- Obtained baseline accuracy for ResNet50v2 is different than officially reported HOT 4
- NASNetLarge input shape error
- Keras MobileNetv2 image normalization
- There is a bug using GPU in MobileNetV3Small
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from keras-applications.