|
38 | 38 | # Or |
39 | 39 | pip install -U git+https://github.com/leondgarse/keras_efficientnet_v2 |
40 | 40 | ``` |
41 | | - - **Define model and load pretrained weights** Parameter `pretrained` is added in value `[None, "imagenet", "imagenet21k", "imagenet21k-ft1k"]`, default is `imagenet`. |
| 41 | + - **Define model and load pretrained weights** Parameter `pretrained` is added in value `[None, "imagenet", "imagenet21k", "imagenet21k-ft1k"]`, default is `imagenet`. Model input value should be in range `[-1, 1]`. |
42 | 42 | ```py |
43 | 43 | # Will download and load `imagenet` pretrained weights. |
44 | 44 | # Model weight is loaded with `by_name=True, skip_mismatch=True`. |
|
50 | 50 | from tensorflow import keras |
51 | 51 | from skimage.data import chelsea |
52 | 52 | imm = tf.image.resize(chelsea(), model.input_shape[1:3]) # Chelsea the cat |
53 | | - pred = model(tf.expand_dims(imm / 255, 0)).numpy() |
| 53 | + pred = model(tf.expand_dims(imm / 128. - 1., 0)).numpy() |
54 | 54 | print(keras.applications.imagenet_utils.decode_predictions(pred)[0]) |
55 | | - # [('n02124075', 'Egyptian_cat', 0.89163685), ('n02123045', 'tabby', 0.01682318), ...] |
| 55 | + # [('n02124075', 'Egyptian_cat', 0.8642886), ('n02123159', 'tiger_cat', 0.030793495), ...] |
56 | 56 | ``` |
57 | 57 | Or download `h5` model and load directly |
58 | 58 | ```py |
|
93 | 93 | | 7 | Conv1x1 & Pooling & FC | - | 1280 | 1 | |
94 | 94 |
|
95 | 95 | - Progressive training settings for EfficientNetV2 |
96 | | - |
| 96 | + |
97 | 97 | | | S min | S max | M min | M max | L min | M max | |
98 | 98 | | ------------ | ----- | ----- | ----- | ----- | ----- | ----- | |
99 | 99 | | Image Size | 128 | 300 | 128 | 380 | 128 | 380 | |
|
0 commit comments