Skip to content

Commit d740fc8

Browse files
authored
Release/v1.0.0b3 (#56)
* Add b6, b7 models + new weights (autoaugment) * Change version * Update readme
1 parent 48e36b4 commit d740fc8

File tree

4 files changed

+59
-55
lines changed

4 files changed

+59
-55
lines changed

README.md

+16-17
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,16 @@ See the complete example of loading the model and making an inference in the Jup
7373

7474
The performance of each model variant using the pre-trained weights converted from checkpoints provided by the authors is as follows:
7575

76-
| Architecture | @top1* | @top5* | Weights |
77-
| -------------- | :----: | :----: | :-----: |
78-
| EfficientNetB0 | 0.7668 | 0.9312 | + |
79-
| EfficientNetB1 | 0.7863 | 0.9418 | + |
80-
| EfficientNetB2 | 0.7968 | 0.9475 | + |
81-
| EfficientNetB3 | 0.8083 | 0.9531 | + |
82-
| EfficientNetB4 | 0.8259 | 0.9612 | + |
83-
| EfficientNetB5 | 0.8309 | 0.9646 | + |
84-
| EfficientNetB6 | - | - | - |
85-
| EfficientNetB7 | - | - | - |
76+
| Architecture | @top1* |
77+
| -------------- | :----: |
78+
| EfficientNetB0 | 0.772 |
79+
| EfficientNetB1 | 0.791 |
80+
| EfficientNetB2 | 0.802 |
81+
| EfficientNetB3 | 0.816 |
82+
| EfficientNetB4 | 0.830 |
83+
| EfficientNetB5 | 0.837 |
84+
| EfficientNetB6 | 0.841 |
85+
| EfficientNetB7 | 0.844 |
8686

8787
**\*** - topK accuracy score for converted models (imagenet `val` set)
8888

@@ -102,13 +102,16 @@ $ pip install -U git+https://github.com/qubvel/efficientnet
102102

103103
### Installing from PyPI
104104

105-
Stable release
105+
PyPI stable release
106+
106107
```bash
107108
$ pip install -U efficientnet
108109
```
109-
Latest release (with keras and tf.keras support)
110+
111+
PyPI latest release (with keras and tf.keras support)
112+
110113
```bash
111-
$ pip install -U efficientnet==1.0.0b2
114+
$ pip install -U --pre efficientnet
112115
```
113116

114117
## Frequently Asked Questions
@@ -123,10 +126,6 @@ $ ./scripts/convert_efficientnet.sh --target_dir dist
123126

124127
You can also optionally create the virtual environment with all the dependencies installed by adding `--make_venv=true` and operate in a self-destructing temporary location instead of the target directory by setting `--tmp_working_dir=true`.
125128

126-
* **Why are B6 and B7 model variants not yet supported?**
127-
128-
Weights for B6-B7 have not been made available yet, but might appear soon. Follow the [issue](https://github.com/tensorflow/tpu/issues/377) for updates.
129-
130129
## Acknowledgements
131130
I would like to thanks community members who actively contribute to this repository:
132131

efficientnet/__version__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
# ==============================================================================
15-
VERSION = (1, 0, '0b2')
15+
VERSION = (1, 0, '0b3')
1616

1717
__version__ = ".".join(map(str, VERSION))
1818

efficientnet/model.py

+34-31
Original file line numberDiff line numberDiff line change
@@ -50,30 +50,38 @@
5050
'releases/download/efficientnet/')
5151

5252
WEIGHTS_HASHES = {
53-
'efficientnet-b0': ('dd631faed10515e2cd08e3b5da0624b3'
54-
'f50d523fe69b9b5fdf037365f9f907f0',
55-
'e5649d29a9f2dd60380dd05d63389666'
56-
'1c36e1f9596e302a305f9ff1774c1bc8'),
57-
'efficientnet-b1': ('3b88771863db84f3ddea6d722a818719'
58-
'04e0fa6288869a0adaa85059094974bb',
59-
'5b47361e17c7bd1d21e42add4456960c'
60-
'9312f71b57b9f6d548e85b7ad9243bdf'),
61-
'efficientnet-b2': ('e78c89b8580d907238fd45f8ef200131'
62-
'95d198d16135fadc80650b2453f64f6c',
63-
'ac3c2de4e43096d2979909dd9ec22119'
64-
'c3a34a9fd3cbda9977c1d05f7ebcede9'),
65-
'efficientnet-b3': ('99725ac825f7ddf5e47c05d333d9fb62'
66-
'3faf1640c0b0c7372f855804e1861508',
67-
'e70d7ea35fa684f9046e6cc62783940b'
68-
'd83d16edc238807fb75c73105d7ffbaa'),
69-
'efficientnet-b4': ('242890effb990b11fdcc91fceb59cd74'
70-
'9388c6b712c96dfb597561d6dae3060a',
71-
'eaa6455c773db0f2d4d097f7da771bb7'
72-
'25dd8c993ac6f4553b78e12565999fc1'),
73-
'efficientnet-b5': ('c4cb66916633b7311688dbcf6ed5c35e'
74-
'45ce06594181066015c001103998dc67',
75-
'14161a20506013aa229abce8fd994b45'
76-
'da76b3a29e1c011635376e191c2c2d54')
53+
'efficientnet-b0': ('163292582f1c6eaca8e7dc7b51b01c61'
54+
'5b0dbc0039699b4dcd0b975cc21533dc',
55+
'c1421ad80a9fc67c2cc4000f666aa507'
56+
'89ce39eedb4e06d531b0c593890ccff3'),
57+
'efficientnet-b1': ('d0a71ddf51ef7a0ca425bab32b7fa7f1'
58+
'6043ee598ecee73fc674d9560c8f09b0',
59+
'75de265d03ac52fa74f2f510455ba64f'
60+
'9c7c5fd96dc923cd4bfefa3d680c4b68'),
61+
'efficientnet-b2': ('bb5451507a6418a574534aa76a91b106'
62+
'f6b605f3b5dde0b21055694319853086',
63+
'433b60584fafba1ea3de07443b74cfd3'
64+
'2ce004a012020b07ef69e22ba8669333'),
65+
'efficientnet-b3': ('03f1fba367f070bd2545f081cfa7f3e7'
66+
'6f5e1aa3b6f4db700f00552901e75ab9',
67+
'c5d42eb6cfae8567b418ad3845cfd63a'
68+
'a48b87f1bd5df8658a49375a9f3135c7'),
69+
'efficientnet-b4': ('98852de93f74d9833c8640474b2c698d'
70+
'b45ec60690c75b3bacb1845e907bf94f',
71+
'7942c1407ff1feb34113995864970cd4'
72+
'd9d91ea64877e8d9c38b6c1e0767c411'),
73+
'efficientnet-b5': ('30172f1d45f9b8a41352d4219bf930ee'
74+
'3339025fd26ab314a817ba8918fefc7d',
75+
'9d197bc2bfe29165c10a2af8c2ebc675'
76+
'07f5d70456f09e584c71b822941b1952'),
77+
'efficientnet-b6': ('f5270466747753485a082092ac9939ca'
78+
'a546eb3f09edca6d6fff842cad938720',
79+
'1d0923bb038f2f8060faaf0a0449db4b'
80+
'96549a881747b7c7678724ac79f427ed'),
81+
'efficientnet-b7': ('876a41319980638fa597acbbf956a82d'
82+
'10819531ff2dcb1a52277f10c7aefa1a',
83+
'60b56ff3a8daccc8d96edfd40b204c11'
84+
'3e51748da657afd58034d54d3cec2bac')
7785
}
7886

7987
BlockArgs = collections.namedtuple('BlockArgs', [
@@ -347,11 +355,6 @@ def EfficientNet(width_coefficient,
347355
raise ValueError('If using `weights` as `"imagenet"` with `include_top`'
348356
' as true, `classes` should be 1000')
349357

350-
if weights == 'imagenet' and (model_name not in WEIGHTS_HASHES):
351-
raise ValueError('Pre-trained weights are only available for '
352-
'EfficientNet-B0 to -B5, but you requested weights for ' +
353-
model_name + '.')
354-
355358
# Determine proper input shape
356359
input_shape = _obtain_input_shape(input_shape,
357360
default_size=default_resolution,
@@ -454,10 +457,10 @@ def EfficientNet(width_coefficient,
454457
# Load weights.
455458
if weights == 'imagenet':
456459
if include_top:
457-
file_name = model_name + '_weights_tf_dim_ordering_tf_kernels.h5'
460+
file_name = model_name + '_weights_tf_dim_ordering_tf_kernels_autoaugment.h5'
458461
file_hash = WEIGHTS_HASHES[model_name][0]
459462
else:
460-
file_name = model_name + '_weights_tf_dim_ordering_tf_kernels_notop.h5'
463+
file_name = model_name + '_weights_tf_dim_ordering_tf_kernels_autoaugment_notop.h5'
461464
file_hash = WEIGHTS_HASHES[model_name][1]
462465
weights_path = keras_utils.get_file(file_name,
463466
BASE_WEIGHTS_PATH + file_name,

tests/test_model.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@
1616
PANDA_PATH = 'misc/panda.jpg'
1717

1818
PANDA_ARGS = [
19-
(efn.EfficientNetB0, (388, 0.8347934)),
20-
(efn.EfficientNetB1, (388, 0.8702488)),
21-
(efn.EfficientNetB2, (388, 0.8227086)),
22-
(efn.EfficientNetB3, (388, 0.8152614)),
23-
(efn.EfficientNetB4, (388, 0.7353228)),
24-
(efn.EfficientNetB5, (388, 0.8103732)),
19+
(efn.EfficientNetB0, (388, 0.7587869)),
20+
(efn.EfficientNetB1, (388, 0.8373562)),
21+
(efn.EfficientNetB2, (388, 0.8569102)),
22+
(efn.EfficientNetB3, (388, 0.8761664)),
23+
(efn.EfficientNetB4, (388, 0.7342420)),
24+
(efn.EfficientNetB5, (388, 0.8810669)),
25+
(efn.EfficientNetB6, (388, 0.8667784)),
26+
(efn.EfficientNetB7, (388, 0.8399882)),
2527
]
2628

2729

0 commit comments

Comments
 (0)