Skip to content

Commit dffd8da

Browse files
authored
OV2.0 provide layout as mo parameter for public models (openvinotoolkit#2945)
* provide layout as mo parameter for public models * update docs for public tf models * correct layout for aclnet * fixes * Update models/public/deeplabv3/model.yml * provide layout for new models * turn off layouts for failed models
1 parent 77eabec commit dffd8da

File tree

182 files changed

+254
-115
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

182 files changed

+254
-115
lines changed

models/public/Sphereface/model.yml

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ files:
2727
model_optimizer_args:
2828
- --input_shape=[1,3,112,96]
2929
- --input=data
30+
- --layout=data(NCHW)
3031
- --mean_values=data[127.5,127.5,127.5]
3132
- --scale_values=data[128.0]
3233
- --output=fc5

models/public/aclnet-int8/model.yml

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ files:
3333
model_optimizer_args:
3434
- --input_shape=[1,1,1,16000]
3535
- --input=result.1
36+
- --layout=result.1(NCWL)
3637
- --output=486
3738
- --input_model=$dl_dir/aclnet_des_53_int8.onnx
3839
framework: onnx

models/public/aclnet/model.yml

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ files:
3131
model_optimizer_args:
3232
- --input_shape=[1,1,1,16000]
3333
- --input=input
34+
- --layout=input(NCWL)
3435
- --output=output
3536
- --input_model=$dl_dir/aclnet_des_53.onnx
3637
framework: onnx

models/public/alexnet/model.yml

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ model_optimizer_args:
4343
- --input_shape=[1,3,227,227]
4444
- --input=data
4545
- --mean_values=data[104.0,117.0,123.0]
46+
- --layout=data(NCHW)
4647
- --output=prob
4748
- --input_model=$dl_dir/alexnet.caffemodel
4849
- --input_proto=$dl_dir/alexnet.prototxt

models/public/anti-spoof-mn3/model.yml

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ model_optimizer_args:
3232
- --input=actual_input_1
3333
- --mean_values=actual_input_1[151.2405,119.5950,107.8395]
3434
- --scale_values=actual_input_1[63.0105,56.4570,55.0035]
35+
- --layout=actual_input_1(NCHW)
3536
- --reverse_input_channels
3637
- --input_model=$dl_dir/anti-spoof-mn3.onnx
3738
framework: onnx

models/public/bert-base-ner/model.yml

+1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ conversion_to_onnx_args:
8989
model_optimizer_args:
9090
- --input_shape=[1,128],[1,128],[1,128]
9191
- --input=input_ids,attention_mask,token_type_ids
92+
- --layout=input_ids(NC),attention_mask(NC),token_type_ids(NC)
9293
- --input_model=$conv_dir/bert-base-ner.onnx
9394
- --output=output
9495
framework: pytorch

models/public/brain-tumor-segmentation-0001/model.yml

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ files:
4141
model_optimizer_args:
4242
- --input_shape=[1,4,128,128,128]
4343
- --input=data_crop
44+
- --layout=data_crop(NCDHW)
4445
- --output=blockgrad7
4546
- --input_model=$dl_dir/brain-tumor-segmentation-0001-0000.params
4647
framework: mxnet

models/public/brain-tumor-segmentation-0002/model.yml

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ files:
2727
source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/public/2022.1/brain-tumor-segmentation-0002/brain-tumor-segmentation-0002.onnx
2828
model_optimizer_args:
2929
- --input_shape=[1,4,128,128,128]
30+
- --layout=NCDHW
3031
- --input_model=$dl_dir/brain-tumor-segmentation-0002.onnx
3132
framework: onnx
3233
license: https://raw.githubusercontent.com/lachinov/brats2019/master/LICENSE

models/public/caffenet/model.yml

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ files:
2828
model_optimizer_args:
2929
- --input_shape=[1,3,227,227]
3030
- --input=data
31+
- --layout=data(NCHW)
3132
- --mean_values=data[104.0,117.0,123.0]
3233
- --output=prob
3334
- --input_model=$dl_dir/bvlc_reference_caffenet.caffemodel

models/public/cocosnet/model.yml

+1
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ model_optimizer_args:
125125
- --output=exemplar_based_output
126126
- --mean_values=ref_image[127.5,127.5,127.5]
127127
- --scale_values=ref_image[127.5,127.5,127.5]
128+
- --layout=input_seg_map(NCHW),ref_image(NCHW),ref_seg_map(NCHW)
128129
- --reverse_input_channels
129130
framework: pytorch
130131
license: https://raw.githubusercontent.com/microsoft/CoCosNet/33f98d092407094a15a08b0555d6f5359490cd3e/LICENSE

models/public/colorization-siggraph/model.yml

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ conversion_to_onnx_args:
5656
model_optimizer_args:
5757
- --input_shape=[1,1,256,256],[1,2,256,256],[1,1,256,256]
5858
- --input=data_l,user_ab,user_map
59+
- --layout=data_l(NCHW),user_ab(NCHW),user_map(NCHW)
5960
- --output=color_ab
6061
- --input_model=$conv_dir/colorization-siggraph.onnx
6162
framework: pytorch

models/public/colorization-v2/model.yml

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ conversion_to_onnx_args:
6363
model_optimizer_args:
6464
- --input_shape=[1,1,256,256]
6565
- --input=data_l
66+
- --layout=data_l(NCHW)
6667
- --output=color_ab
6768
- --input_model=$conv_dir/colorization-v2-eccv16.onnx
6869
framework: pytorch

models/public/common-sign-language-0001/model.yml

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ files:
3232
model_optimizer_args:
3333
- --input=input
3434
- --input_shape=[1,3,8,224,224]
35+
- --layout=input(NCDHW)
3536
- --output=output
3637
- --mean_values=[123.675, 116.28, 103.53]
3738
- --scale_values=[58.395, 57.12, 57.375]

models/public/ctdet_coco_dlav0_512/model.yml

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ conversion_to_onnx_args:
6767
model_optimizer_args:
6868
- --input_shape=[1,3,512,512]
6969
- --input=input.1
70+
- --layout=input.1(NCHW)
7071
- --mean_values=input.1[104.04, 113.985, 119.85]
7172
- --scale_values=input.1[73.695, 69.87, 70.89]
7273
- --output=center_heatmap,width_height,regression

models/public/ctpn/README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ Mean values: [102.9801, 115.9465, 122.7717].
3535

3636
### Converted Model
3737

38-
Image, name: `Placeholder`, shape: `1, 3, 600, 600`, format: `B, C, H, W`, where:
38+
Image, name: `Placeholder`, shape: `1, 600, 600, 3`, format: `B, H, W, C`, where:
3939

4040
- `B` - batch size
41-
- `C` - number of channels
4241
- `H` - image height
4342
- `W` - image width
43+
- `C` - number of channels
4444

4545
Expected color order: `BGR`.
4646

@@ -64,19 +64,19 @@ Expected color order: `BGR`.
6464

6565
### Converted Model
6666

67-
1. Detection boxes, name: `rpn_bbox_pred/Reshape_1/Transpose`, shape: `1, 40, 18, 18` contains predicted regions, format: `B, A, H, W`, where:
67+
1. Detection boxes, name: `rpn_bbox_pred/Reshape_1`, contains predicted regions, in format `B, H, W, A`, where:
6868

6969
- `B` - batch size
70-
- `A` - vector of 4\*N coordinates, where N is the number of detected anchors.
7170
- `H` - image height
7271
- `W` - image width
72+
- `A` - vector of 4\*N coordinates, where N is the number of detected anchors.
7373

74-
2. Probability, name: `Reshape_2/Transpose`, shape: `1, 20, 18, 18`, contains probabilities for predicted regions in a[0,1] range in format `B, A, H, W`, where:
74+
2. Probability, name: `Reshape_2`, contains probabilities for predicted regions in a [0,1] range in format `B, H, W, A`, where:
7575

7676
- `B` - batch size
77-
- `A` - vector of 2\*N class probabilities (0 class for background, 1 class for text), where N is the number of detected anchors.
7877
- `H` - image height
7978
- `W` - image width
79+
- `A` - vector of 4\*N coordinates, where N is the number of detected anchors.
8080

8181
## Download a Model and Convert it into Inference Engine Format
8282

models/public/ctpn/model.yml

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ files:
2525
model_optimizer_args:
2626
- --input_shape=[1,600,600,3]
2727
- --input=Placeholder
28+
- --layout=Placeholder(NHWC)
2829
- --mean_values=Placeholder[102.9801,115.9465,122.7717]
2930
- --output=Reshape_2,rpn_bbox_pred/Reshape_1
3031
- --input_model=$dl_dir/ctpn.pb

models/public/deblurgan-v2/model.yml

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ model_optimizer_args:
7575
- --scale_values=blur_image[127.5]
7676
- --input_shape=[1,3,736,1312]
7777
- --input=blur_image
78+
- --layout=blur_image(NCHW)
7879
- --output=deblur_image
7980
- --input_model=$conv_dir/deblurgan-v2.onnx
8081
framework: pytorch

models/public/deeplabv3/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ Expected color order: `RGB`.
3434

3535
### Converted Model
3636

37-
Image, name: `mul_1/placeholder_port_1`, shape: `1, 3, 513, 513`, format: `B, C, H, W`, where:
37+
Image, name: `mul_1/placeholder_port_1`, shape: `1, 513, 513, 3`, format: `B, H, W, C`, where:
3838

3939
- `B` - batch size
40-
- `C` - number of channels
4140
- `H` - image height
4241
- `W` - image width
42+
- `C` - number of channels
4343

4444
Expected color order: `BGR`.
4545

models/public/deeplabv3/model.yml

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ model_optimizer_args:
3030
- --reverse_input_channels
3131
- --input_shape=[1,513,513,3]
3232
- --input=1:mul_1
33+
# - --layout=1:mul_1(NHWC)
3334
- --output=ArgMax
3435
- --input_model=$dl_dir/deeplabv3_mnv2_pascal_train_aug/frozen_inference_graph.pb
3536
framework: tf

models/public/densenet-121-tf/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ Mean values - [123.68, 116.78, 103.94], scale values - [58.395,57.12,57.375].
3737

3838
### Converted Model
3939

40-
Image, name: `input_1`, shape: `1, 3, 224, 224`, format: `B, C, H, W`, where:
40+
Image, name: `input_1`, shape: `1, 224, 224, 3`, format: `B, H, W, C`, where:
4141

4242
- `B` - batch size
43-
- `C` - number of channels
4443
- `H` - image height
4544
- `W` - image width
45+
- `C` - number of channels
4646

4747
Expected color order: `BGR`.
4848

models/public/densenet-121-tf/model.yml

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ model_optimizer_args:
2828
- --reverse_input_channels
2929
- --input_shape=[1,224,224,3]
3030
- --input=input_1
31+
- --layout=input_1(NHWC)
3132
- --mean_values=input_1[123.68,116.78,103.94]
3233
- --scale_values=input_1[58.395,57.12,57.375]
3334
- --output=StatefulPartitionedCall/densenet121/predictions/Softmax

models/public/densenet-121/model.yml

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ files:
3131
model_optimizer_args:
3232
- --input_shape=[1,3,224,224]
3333
- --input=data
34+
- --layout=data(NCHW)
3435
- --mean_values=data[103.94,116.78,123.68]
3536
- --scale_values=data[58.8235294117647]
3637
- --output=fc6

models/public/detr-resnet50/model.yml

+1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ model_optimizer_args:
8282
- --reverse_input_channels
8383
- --input_shape=[1,3,800,1137]
8484
- --input=input
85+
- --layout=input(NCHW)
8586
- --mean_values=input[123.675,116.28,103.53]
8687
- --scale_values=input[58.395,57.12,57.375]
8788
- --output=boxes,scores

models/public/dla-34/model.yml

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ model_optimizer_args:
4646
- --reverse_input_channels
4747
- --input_shape=[1,3,224,224]
4848
- --input=data
49+
- --layout=data(NCHW)
4950
- --mean_values=data[123.675,116.28,103.53]
5051
- --scale_values=data[58.395,57.12,57.375]
5152
- --output=prob

models/public/drn-d-38/model.yml

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ model_optimizer_args:
6161
- --reverse_input_channels
6262
- --input_shape=[1,3,1024,2048]
6363
- --input=input
64+
- --layout=input(NCHW)
6465
- --output=output
6566
- --mean_values=[73.975742869,83.660769353,73.175805779]
6667
- --scale_values=[46.653282963,47.574230671,47.041147921]

models/public/efficientdet-d0-tf/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ Channel order is `RGB`.
3737

3838
### Converted Model
3939

40-
Image, name - `image_arrays/placeholder_port_0`, shape - `1, 3, 512, 512`, format is `B, C, H, W`, where:
40+
Image, name - `image_arrays/placeholder_port_0`, shape - `1, 512, 512, 3`, format is `B, H, W, C`, where:
4141

4242
- `B` - batch size
43-
- `C` - channel
4443
- `H` - height
4544
- `W` - width
45+
- `C` - channel
4646

4747
Channel order is `BGR`.
4848

models/public/efficientdet-d0-tf/model.yml

+1
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ postprocessing:
117117
model_optimizer_args:
118118
- --input_shape=[1,512,512,3]
119119
- --input=image_arrays
120+
# - --layout=image_arrays(NHWC)
120121
- --reverse_input_channels
121122
- --input_model=$conv_dir/efficientdet-d0_saved_model/efficientdet-d0_frozen.pb
122123
- --transformations_config=$mo_ext_dir/front/tf/automl_efficientdet.json

models/public/efficientdet-d1-tf/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ Channel order is `RGB`.
3737

3838
### Converted Model
3939

40-
Image, name: `image_arrays/placeholder_port_0`, shape: `1, 3, 640, 640`, format is `B, C, H, W`, where:
40+
Image, name: `image_arrays/placeholder_port_0`, shape: `1, 640, 640, 3`, format is `B, H, W, C`, where:
4141

4242
- `B` - batch size
43-
- `C` - channel
4443
- `H` - height
4544
- `W` - width
45+
- `C` - channel
4646

4747
Channel order is `BGR`.
4848

models/public/efficientdet-d1-tf/model.yml

+1
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ postprocessing:
117117
model_optimizer_args:
118118
- --input_shape=[1,640,640,3]
119119
- --input=image_arrays
120+
# - --layout=image_arrays(NHWC)
120121
- --reverse_input_channels
121122
- --input_model=$conv_dir/efficientdet-d1_saved_model/efficientdet-d1_frozen.pb
122123
- --transformations_config=$mo_ext_dir/front/tf/automl_efficientdet.json

models/public/efficientnet-b0-pytorch/model.yml

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ model_optimizer_args:
6767
- --reverse_input_channels
6868
- --input_shape=[1,3,224,224]
6969
- --input=data
70+
- --layout=data(NCHW)
7071
- --mean_values=data[123.675,116.28,103.53]
7172
- --scale_values=data[58.395,57.12,57.375]
7273
- --output=prob

models/public/efficientnet-b0/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ Channel order is `RGB`.
3939

4040
### Converted Model
4141

42-
Image, name - `sub/placeholder_port_0`, shape - `1, 3, 224, 224`, format is `B, C, H, W`, where:
42+
Image, name - `sub/placeholder_port_0`, shape - `1, 224, 224, 3`, format is `B, H, W, C`, where:
4343

4444
- `B` - batch size
45-
- `C` - channel
4645
- `H` - height
4746
- `W` - width
47+
- `C` - channel
4848

4949
Channel order is `BGR`.
5050

models/public/efficientnet-b0/model.yml

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ postprocessing:
3232
model_optimizer_args:
3333
- --input_shape=[1,224,224,3]
3434
- --input=0:sub
35+
# - --layout=0:sub(NHWC)
3536
- --output=logits
3637
- --input_meta_graph=$dl_dir/efficientnet-b0/model.ckpt.meta
3738
- --reverse_input_channels

models/public/f3net/model.yml

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ conversion_to_onnx_args:
6363
model_optimizer_args:
6464
- --input_shape=[1,3,352,352]
6565
- --input=input.1
66+
- --layout=input.1(NCHW)
6667
- --input_model=$conv_dir/f3net.onnx
6768
- --mean_values=input.1[124.55,118.90,102.94]
6869
- --scale_values=input.1[56.77,55.97,57.50]

models/public/face-detection-retail-0044/model.yml

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ files:
3131
model_optimizer_args:
3232
- --input_shape=[1,3,300,300]
3333
- --input=data
34+
- --layout=data(NCHW)
3435
- --input_model=$dl_dir/face-detection-retail-0044.caffemodel
3536
- --input_proto=$dl_dir/face-detection-retail-0044.prototxt
3637
framework: caffe

models/public/face-recognition-resnet100-arcface-onnx/model.yml

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ model_optimizer_args:
3131
- --input_shape=[1,3,112,112]
3232
- --input_model=$dl_dir/arcfaceresnet100-8.onnx
3333
- --input=data
34+
- --layout=data(NCHW)
3435
- --output=fc1
3536
framework: onnx
3637
license: https://raw.githubusercontent.com/onnx/models/master/LICENSE

models/public/faceboxes-pytorch/model.yml

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ conversion_to_onnx_args:
4343
model_optimizer_args:
4444
- --input_shape=[1,3,1024,1024]
4545
- --input=input.1
46+
- --layout=input.1(NCHW)
4647
- --input_model=$conv_dir/faceboxes-pytorch.onnx
4748
- --mean_values=input.1[104.0,117.0,123.0]
4849
- --output=boxes,scores

models/public/facenet-20180408-102900/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ FaceNet: A Unified Embedding for Face Recognition and Clustering. For details se
3737

3838
### Converted model
3939

40-
Image, name - `image_batch/placeholder_port_0`, shape - `1, 3, 160, 160`, format `B, C, H, W`, where:
40+
Image, name - `image_batch/placeholder_port_0`, shape - `1, 160, 160, 3`, format `B, H, W, C`, where:
4141

4242
- `B` - batch size
43-
- `C` - number of channels
4443
- `H` - image height
4544
- `W` - image width
45+
- `C` - number of channels
4646

4747
Expected color order: `BGR`.
4848

models/public/facenet-20180408-102900/model.yml

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ model_optimizer_args:
3333
- --reverse_input_channels
3434
- --input_shape=[1,160,160,3],[1]
3535
- --input=image_batch,phase_train
36+
# - --layout=image_batch(NHWC)
3637
- --mean_values=image_batch[127.5,127.5,127.5]
3738
- --scale_values=image_batch[128.0]
3839
- --output=embeddings

models/public/fast-neural-style-mosaic-onnx/model.yml

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ files:
2727
size: 6728029
2828
model_optimizer_args:
2929
- --input_shape=[1,3,224,224]
30+
- --layout=NCHW
3031
- --input_model=$dl_dir/fast-neural-style-mosaic-onnx.onnx
3132
- --reverse_input_channels
3233
framework: onnx

0 commit comments

Comments
 (0)