Skip to content

Commit 597d053

Browse files
author
Anna Grebneva
authored
Added efficientnet v2 models (#2982)
* Added efficientnet-v2-b0 model * Added efficientnet-v2-s model * Fix yamllint errors * Updated link to paper
1 parent a04512d commit 597d053

File tree

12 files changed

+430
-0
lines changed

12 files changed

+430
-0
lines changed

demos/classification_demo/python/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ omz_converter --list models.lst
5050
* efficientnet-b5-pytorch
5151
* efficientnet-b7_auto_aug
5252
* efficientnet-b7-pytorch
53+
* efficientnet-v2-b0
54+
* efficientnet-v2-s
5355
* googlenet-v1
5456
* googlenet-v1-tf
5557
* googlenet-v2

demos/classification_demo/python/models.lst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ efficientnet-b5
1818
efficientnet-b5-pytorch
1919
efficientnet-b7_auto_aug
2020
efficientnet-b7-pytorch
21+
efficientnet-v2-b0
22+
efficientnet-v2-s
2123
googlenet-v1
2224
googlenet-v1-tf
2325
googlenet-v2

models/public/device_support.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
| efficientnet-b5-pytorch | YES | YES | |
4141
| efficientnet-b7-pytorch | YES | YES | |
4242
| efficientnet-b7_auto_aug | YES | YES | |
43+
| efficientnet-v2-b0 | YES | YES | |
44+
| efficientnet-v2-s | YES | YES | |
4345
| f3net | YES | YES | YES |
4446
| face-detection-retail-0044 | YES | YES | |
4547
| face-recognition-resnet100-arcface-onnx | YES | YES | |
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# efficientnet-v2-b0
2+
3+
## Use Case and High-Level Description
4+
5+
The `efficientnet-v2-b0` model is a variant of the EfficientNetV2 pre-trained on ImageNet dataset for image classification task. EfficientNetV2 is a new family of convolutional networks that have faster training speed and better parameter efficiency than previous models. A combination of training-aware neural architecture search and scaling were used in the development to jointly optimize training speed and parameter efficiency.
6+
7+
More details provided in the [paper](https://arxiv.org/abs/2104.00298) and [repository](https://github.com/rwightman/pytorch-image-models).
8+
9+
## Specification
10+
11+
| Metric | Value |
12+
|---------------------------------|----------------|
13+
| Type | Classification |
14+
| GFlops | 1.4641 |
15+
| MParams | 7.1094 |
16+
| Source framework | PyTorch\* |
17+
18+
## Accuracy
19+
20+
| Metric | Value |
21+
| ------ | ------ |
22+
| Top 1 | 78.36% |
23+
| Top 5 | 94.02% |
24+
25+
## Input
26+
27+
### Original Model
28+
29+
Image, name: `input`, shape: `1, 3, 224, 224`, format: `B, C, H, W`, where:
30+
31+
- `B` - batch size
32+
- `C` - number of channels
33+
- `H` - image height
34+
- `W` - image width
35+
36+
Expected color order: `RGB`.
37+
Mean values - [123.675, 116.28, 103.53], scale values - [58.395, 57.12, 57.375].
38+
39+
### Converted Model
40+
41+
Image, name: `input`, shape: `1, 3, 224, 224`, format: `B, C, H, W`, where:
42+
43+
- `B` - batch size
44+
- `C` - number of channels
45+
- `H` - image height
46+
- `W` - image width
47+
48+
Expected color order: `BGR`.
49+
50+
## Output
51+
52+
### Original Model
53+
54+
Object classifier according to ImageNet classes, name: `logits`, shape: `1, 1000`, output data format is `B, C`, where:
55+
56+
- `B` - batch size
57+
- `C` - vector of probabilities for all dataset classes in logits format
58+
59+
### Converted Model
60+
61+
Object classifier according to ImageNet classes, name: `logits`, shape: `1, 1000`, output data format is `B, C`, where:
62+
63+
- `B` - batch size
64+
- `C` - vector of probabilities for all dataset classes in logits format
65+
66+
## Download a Model and Convert it into Inference Engine Format
67+
68+
You can download models and if necessary convert them into Inference Engine format using the [Model Downloader and other automation tools](../../../tools/model_tools/README.md) as shown in the examples below.
69+
70+
An example of using the Model Downloader:
71+
```
72+
omz_downloader --name <model_name>
73+
```
74+
75+
An example of using the Model Converter:
76+
```
77+
omz_converter --name <model_name>
78+
```
79+
80+
## Legal Information
81+
82+
The original model is distributed under the
83+
[Apache License, Version 2.0](https://raw.githubusercontent.com/rwightman/pytorch-image-models/master/LICENSE).
84+
A copy of the license is provided in `<omz_dir>/models/public/licenses/APACHE-2.0-PyTorch-Image-Models.txt`.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
models:
2+
- name: efficientnet-v2-b0-onnx
3+
4+
launchers:
5+
- framework: onnx_runtime
6+
model: efficientnet-v2-b0.onnx
7+
adapter: classification
8+
9+
datasets:
10+
- name: imagenet_1000_classes
11+
reader: pillow_imread
12+
13+
preprocessing:
14+
- type: resize
15+
size: 256
16+
aspect_ratio_scale: greater
17+
use_pillow: True
18+
interpolation: BICUBIC
19+
20+
- type: crop
21+
use_pillow: True
22+
size: 224
23+
24+
- type: normalization
25+
mean: [123.675, 116.28, 103.53]
26+
std: [58.395, 57.12, 57.375]
27+
28+
metrics:
29+
- name: accuracy@top1
30+
type: accuracy
31+
top_k: 1
32+
reference: 0.78358
33+
- name: accuracy@top5
34+
type: accuracy
35+
top_k: 5
36+
reference: 0.94024
37+
38+
- name: efficientnet-v2-b0
39+
40+
launchers:
41+
- framework: dlsdk
42+
adapter: classification
43+
44+
datasets:
45+
- name: imagenet_1000_classes
46+
reader: pillow_imread
47+
48+
preprocessing:
49+
- type: rgb_to_bgr
50+
51+
- type: resize
52+
size: 256
53+
aspect_ratio_scale: greater
54+
use_pillow: True
55+
interpolation: BICUBIC
56+
57+
- type: crop
58+
use_pillow: True
59+
size: 224
60+
61+
metrics:
62+
- name: accuracy@top1
63+
type: accuracy
64+
top_k: 1
65+
reference: 0.78358
66+
- name: accuracy@top5
67+
type: accuracy
68+
top_k: 5
69+
reference: 0.94024
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Copyright (c) 2021 Intel Corporation
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
description: >-
16+
The "efficientnet-v2-b0" model is a variant of the EfficientNetV2 pre-trained on
17+
ImageNet dataset for image classification task. EfficientNetV2 is a new family of
18+
convolutional networks that have faster training speed and better parameter efficiency
19+
than previous models. A combination of training-aware neural architecture search
20+
and scaling were used in the development to jointly optimize training speed and
21+
parameter efficiency.
22+
23+
More details provided in the paper <https://arxiv.org/abs/2104.00298> and repository
24+
<https://github.com/rwightman/pytorch-image-models>.
25+
task_type: classification
26+
files:
27+
- name: timm-0.4.12-py3-none-any.whl
28+
size: 376973
29+
checksum: e5030b792501314113ca804b3b00d35d89c40d0a92d53aa0c41e2a83697d11ef5ea8c73ed1c0bec28c4791047c9dd1b3
30+
source: https://files.pythonhosted.org/packages/90/fc/606bc5cf46acac3aa9bd179b3954433c026aaf88ea98d6b19f5d14c336da/timm-0.4.12-py3-none-any.whl
31+
- name: tf_efficientnetv2_b0-c7cc451f.pth
32+
size: 28865269
33+
checksum: b3192e284c7ecf9ab766eb77682ee258152b3f9b142b3a962bdbd409a5332b7731574f8f7e6a5fe3f7af353acd6ad76a
34+
source: https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-effv2-weights/tf_efficientnetv2_b0-c7cc451f.pth
35+
postprocessing:
36+
- $type: unpack_archive
37+
format: zip
38+
file: timm-0.4.12-py3-none-any.whl
39+
conversion_to_onnx_args:
40+
- --model-path=$dl_dir
41+
- --model-name=tf_efficientnetv2_b0
42+
- --import-module=timm.models.efficientnet
43+
- --weights=$dl_dir/tf_efficientnetv2_b0-c7cc451f.pth
44+
- --input-shape=1,3,224,224
45+
- --input-names=input
46+
- --output-names=logits
47+
- --output-file=$conv_dir/efficientnet-v2-b0.onnx
48+
model_optimizer_args:
49+
- --input_shape=[1,3,224,224]
50+
- --input=input
51+
- --input_model=$conv_dir/efficientnet-v2-b0.onnx
52+
- --mean_values=input[123.675,116.28,103.53]
53+
- --scale_values=input[58.395,57.12,57.375]
54+
- --reverse_input_channels
55+
- --output=logits
56+
framework: pytorch
57+
license: https://raw.githubusercontent.com/rwightman/pytorch-image-models/master/LICENSE
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# efficientnet-v2-s
2+
3+
## Use Case and High-Level Description
4+
5+
The `efficientnet-v2-s` model is a small variant of the EfficientNetV2 pre-trained on ImageNet-21k dataset and fine-tuned on ImageNet-1k for image classification task. EfficientNetV2 is a new family of convolutional networks that have faster training speed and better parameter efficiency than previous models. A combination of training-aware neural architecture search and scaling were used in the development to jointly optimize training speed and parameter efficiency.
6+
7+
More details provided in the [paper](https://arxiv.org/abs/2104.00298) and [repository](https://github.com/rwightman/pytorch-image-models).
8+
9+
## Specification
10+
11+
| Metric | Value |
12+
|---------------------------------|----------------|
13+
| Type | Classification |
14+
| GFlops | 16.9406 |
15+
| MParams | 21.3816 |
16+
| Source framework | PyTorch\* |
17+
18+
## Accuracy
19+
20+
| Metric | Value |
21+
| ------ | ------ |
22+
| Top 1 | 84.29% |
23+
| Top 5 | 97.26% |
24+
25+
## Input
26+
27+
### Original Model
28+
29+
Image, name: `input`, shape: `1, 3, 384, 384`, format: `B, C, H, W`, where:
30+
31+
- `B` - batch size
32+
- `C` - number of channels
33+
- `H` - image height
34+
- `W` - image width
35+
36+
Expected color order: `RGB`.
37+
Mean values - [127.5, 127.5, 127.5], scale values - [127.5, 127.5, 127.5].
38+
39+
### Converted Model
40+
41+
Image, name: `input`, shape: `1, 3, 384, 384`, format: `B, C, H, W`, where:
42+
43+
- `B` - batch size
44+
- `C` - number of channels
45+
- `H` - image height
46+
- `W` - image width
47+
48+
Expected color order: `BGR`.
49+
50+
## Output
51+
52+
### Original Model
53+
54+
Object classifier according to ImageNet classes, name: `logits`, shape: `1, 1000`, output data format is `B, C`, where:
55+
56+
- `B` - batch size
57+
- `C` - vector of probabilities for all dataset classes in logits format
58+
59+
### Converted Model
60+
61+
Object classifier according to ImageNet classes, name: `logits`, shape: `1, 1000`, output data format is `B, C`, where:
62+
63+
- `B` - batch size
64+
- `C` - vector of probabilities for all dataset classes in logits format
65+
66+
## Download a Model and Convert it into Inference Engine Format
67+
68+
You can download models and if necessary convert them into Inference Engine format using the [Model Downloader and other automation tools](../../../tools/model_tools/README.md) as shown in the examples below.
69+
70+
An example of using the Model Downloader:
71+
```
72+
omz_downloader --name <model_name>
73+
```
74+
75+
An example of using the Model Converter:
76+
```
77+
omz_converter --name <model_name>
78+
```
79+
80+
## Legal Information
81+
82+
The original model is distributed under the
83+
[Apache License, Version 2.0](https://raw.githubusercontent.com/rwightman/pytorch-image-models/master/LICENSE).
84+
A copy of the license is provided in `<omz_dir>/models/public/licenses/APACHE-2.0-PyTorch-Image-Models.txt`.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
models:
2+
- name: efficientnet-v2-s-onnx
3+
4+
launchers:
5+
- framework: onnx_runtime
6+
model: efficientnet-v2-s.onnx
7+
adapter: classification
8+
9+
datasets:
10+
- name: imagenet_1000_classes
11+
reader: pillow_imread
12+
13+
preprocessing:
14+
- type: resize
15+
size: 384
16+
aspect_ratio_scale: greater
17+
use_pillow: True
18+
interpolation: BICUBIC
19+
20+
- type: crop
21+
use_pillow: True
22+
size: 384
23+
24+
- type: normalization
25+
mean: [127.5, 127.5, 127.5]
26+
std: [127.5, 127.5, 127.5]
27+
28+
metrics:
29+
- name: accuracy@top1
30+
type: accuracy
31+
top_k: 1
32+
reference: 0.84286
33+
- name: accuracy@top5
34+
type: accuracy
35+
top_k: 5
36+
reference: 0.97256
37+
38+
- name: efficientnet-v2-s
39+
40+
launchers:
41+
- framework: dlsdk
42+
adapter: classification
43+
44+
datasets:
45+
- name: imagenet_1000_classes
46+
reader: pillow_imread
47+
48+
preprocessing:
49+
- type: rgb_to_bgr
50+
51+
- type: resize
52+
size: 384
53+
aspect_ratio_scale: greater
54+
use_pillow: True
55+
interpolation: BICUBIC
56+
57+
- type: crop
58+
use_pillow: True
59+
size: 384
60+
61+
metrics:
62+
- name: accuracy@top1
63+
type: accuracy
64+
top_k: 1
65+
reference: 0.84286
66+
- name: accuracy@top5
67+
type: accuracy
68+
top_k: 5
69+
reference: 0.97256

0 commit comments

Comments
 (0)