Skip to content

Commit c2c67fc

Browse files
legendary111WovchenaAndrei Kochineaidova
authored
erfnet to omz (#3525)
* Create 1 * Add files via upload * Delete 1 * Create re * Add files via upload * Delete re * Add files via upload * Add files via upload * Add files via upload * MIT * Update README.md * Add files via upload * Delete demos/lane_detection_demo/python directory * Add files via upload * Add files via upload * Add files via upload The modification has been completed. Please check. * Add files via upload * demos: add erfnet to C++ segmentation demo, update tests * Add files via upload * read me * Add files via upload * Add files via upload * Add files via upload * README.md Thank you for your advice * Update models/public/erfnet/README.md Co-authored-by: Ekaterina Aidova <[email protected]> * Update README.md * Update README.md * Update device_support.md * Update README.md * Update index.md Co-authored-by: Wovchena <[email protected]> Co-authored-by: Andrei Kochin <[email protected]> Co-authored-by: Ekaterina Aidova <[email protected]>
1 parent 7eb5510 commit c2c67fc

File tree

10 files changed

+240
-2
lines changed

10 files changed

+240
-2
lines changed

data/dataset_definitions.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,6 +1341,16 @@ datasets:
13411341
images_dir: SYGData0829/dataset_format_VOC2007/JPEGImages
13421342
has_background: False
13431343

1344+
- name: erfnet_data
1345+
annotation_conversion:
1346+
converter: voc_segmentation
1347+
imageset_file: val.txt
1348+
images_dir: JPEGImages/
1349+
mask_dir: Annotations/
1350+
dataset_meta_file: erfnet_meta_zxw.json
1351+
data_source: JPEGImages/
1352+
additional_data_source: Annotations/
1353+
13441354
- name: speech_denoising_dataset
13451355
data_source: ICASSP_dev_test_set/track_1/synthetic
13461356
reader:

data/datasets.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,28 @@ To use this dataset with OMZ tools, make sure `<DATASET_DIR>` contains the follo
163163
### Datasets in dataset_definitions.yml
164164
* `SYGData0829` used for evaluation models on SYGData0829 dataset for object detection task. Label map with 4 object categories are used. (model examples: [mobilenet-yolo-v4-syg](../models/public/mobilenet-yolo-v4-syg/README.md))
165165

166+
## [erfnet_data](https://github.com/Zhangxianwen2021/ERFNet/releases/tag/erfnet)
167+
168+
### How to download dataset
169+
170+
To download erfnet_data dataset, you need to follow the steps below:
171+
1. Go to the [github repo](https://github.com/Zhangxianwen2021/ERFNet/releases/tag/erfnet)
172+
2. Select [`Annotations.rar`](https://github.com/Zhangxianwen2021/ERFNet/releases/download/erfnet/Annotations.rar)
173+
Select ['JPEGImages.rar'](https://github.com/Zhangxianwen2021/ERFNet/releases/download/erfnet/JPEGImages.rar)
174+
Select ['erfnet_meta_zxw.json'](https://github.com/Zhangxianwen2021/ERFNet/releases/download/erfnet/erfnet_meta_zxw.json)
175+
Select ['val.txt'](https://github.com/Zhangxianwen2021/ERFNet/releases/download/erfnet/val.txt)
176+
3. Unpack archive
177+
178+
### Files layout
179+
* `erfnet_data` - directory containing annotations, images, image sets and dataset meta files directories
180+
* `Annotations` - directory containing the erfnet_data annotation files
181+
* `JPEGImages` - directory containing the erfnet_data images
182+
* `erfnet_meta_zxw.json` - directory containing the erfnet_data text files specifying lists of images for different tasks
183+
* `val.txt` - image sets file for validation of detection tasks
184+
185+
### Datasets in dataset_definitions.yml
186+
* `erfnet_data` used for evaluation models on erfnet_data dataset for object segmentation task. (model examples: [`erfnet`](../models/public/erfnet/README.md))
187+
166188
## PASCAL-S
167189

168190
### Download dataset

demos/segmentation_demo/cpp/models.lst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# This file can be used with the --list option of the model downloader.
22
deeplabv3
33
drn-d-38
4+
erfnet
45
fastseg-large
56
fastseg-small
67
hrnet-v2-c1-segmentation

demos/segmentation_demo/python/models.lst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# For --architecture_type=segmentation
33
deeplabv3
44
drn-d-38
5+
erfnet
56
fastseg-large
67
fastseg-small
78
hrnet-v2-c1-segmentation

demos/tests/cases.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,9 @@ def single_option_cases(key, *args):
627627
ModelArg('deeplabv3'),
628628
ModelArg('ocrnet-hrnet-w48-paddle'),
629629
ModelArg('pspnet-pytorch'),
630-
ModelArg('drn-d-38'))),
630+
ModelArg('drn-d-38'),
631+
# ModelArg('erfnet'), # TODO add after CI is up
632+
)),
631633
],
632634
)),
633635

@@ -1275,7 +1277,9 @@ def single_option_cases(key, *args):
12751277
ModelArg('deeplabv3'),
12761278
ModelArg('ocrnet-hrnet-w48-paddle'),
12771279
ModelArg('pspnet-pytorch'),
1278-
ModelArg('drn-d-38'))),
1280+
ModelArg('drn-d-38'),
1281+
# ModelArg('erfnet'), # TODO add after CI is up
1282+
)),
12791283
TestCase(options={
12801284
'-m': ModelArg('f3net'),
12811285
'-i': DataPatternArg('road-segmentation-adas'),

models/public/device_support.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
| efficientnet-b0-pytorch | YES | YES | YES |
3232
| efficientnet-v2-b0 | YES | YES | |
3333
| efficientnet-v2-s | YES | YES | |
34+
| erfnet | YES | | |
3435
| f3net | YES | YES | YES |
3536
| face-detection-retail-0044 | YES | YES | |
3637
| face-recognition-resnet100-arcface-onnx | YES | YES | |

models/public/erfnet/README.md

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# erfnet
2+
3+
## Use Case and High-Level Description
4+
5+
This is a ONNX\* version of `erfnet` model designed to perform real-time lane detection on multi-lane road (maximum number of lanes - 4).
6+
This model is pre-trained in PyTorch\* framework and retrained by CULane.
7+
For details see [repository](https://github.com/Zhangxianwen2021/ERFNet),
8+
paper of [ERFNet](https://doi.org/10.1109/TITS.2017.2750080) and [repository](https://github.com/cardwing/Codes-for-Lane-Detection/tree/master/ERFNet-CULane-PyTorch)
9+
10+
## Specification
11+
12+
| Metric | Value |
13+
|-------------------|-----------------------|
14+
| Type | Semantic segmentation |
15+
| GFLOPs | 11.13 |
16+
| MParams | 7.87 |
17+
| Source framework | PyTorch\* |
18+
19+
## Accuracy
20+
21+
| Metric | Value |
22+
| ------ | -------|
23+
| mean_iou | 76.47% |
24+
25+
## Input
26+
27+
### Original model
28+
29+
Image, name - `input_1`, shape - `1,3,208,976`, format is `B,C,H,W` where:
30+
31+
- `B` - batch size
32+
- `C` - channel
33+
- `H` - height
34+
- `W` - width
35+
36+
37+
Channel order is `BGR`.
38+
39+
### Converted model
40+
41+
Image, name - `input_1`, shape - `1,3,208,976`, format is `B,C,H,W` where:
42+
43+
- `B` - batch size
44+
- `C` - channel
45+
- `H` - height
46+
- `W` - width
47+
48+
49+
Channel order is `BGR`.
50+
51+
## Output
52+
53+
### Original model
54+
Feature map, name - `output1`, shape - `1,5,208,976`, format is `B,C,H,W` where:
55+
56+
- `B` - batch size
57+
- `C` - channel
58+
- `H` - height
59+
- `W` - width
60+
61+
It can be treated as a five-channel feature map, where each channel is information of classes: background, road line1, road line2, road line3, road line4.
62+
Road line1, road line2, road line3 and road line4 match respectively the actual lane1, lane2, lane3 and lane4 from left to right.
63+
64+
65+
### Converted model
66+
67+
Feature map, name - `output1`, shape - `1,5,208,976`, format is `B,C,H,W` where:
68+
69+
- `B` - batch size
70+
- `C` - channel
71+
- `H` - height
72+
- `W` - width
73+
74+
75+
## Download a Model and Convert it into Inference Engine Format
76+
77+
You can download models and if necessary convert them into Inference Engine format using the Model Downloader and other automation tools as shown in the examples below.
78+
An example of using the Model Downloader:
79+
```
80+
omz_downloader --name <model_name>
81+
```
82+
An example of using the Model Converter:
83+
```
84+
omz_converter --name <model_name>
85+
```
86+
## Demo usage
87+
88+
The model can be used in the following demos provided by the Open Model Zoo to show its capabilities:
89+
90+
* [Image Segmentation C++ Demo](../../../demos/segmentation_demo/cpp/README.md)
91+
* [Image Segmentation Python\* Demo](../../../demos/segmentation_demo/python/README.md)
92+
## Legal Information
93+
94+
The original model is distributed under the following [license1](https://raw.githubusercontent.com/Zhangxianwen2021/ERFNet/main/License).
95+
96+
```
97+
MIT License
98+
Copyright (c) 2022 BJTU-SYG
99+
100+
Permission is hereby granted, free of charge, to any person obtaining a copy
101+
of this software and associated documentation files (the "Software"), to deal
102+
in the Software without restriction, including without limitation the rights
103+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
104+
copies of the Software, and to permit persons to whom the Software is
105+
furnished to do so, subject to the following conditions:
106+
107+
The above copyright notice and this permission notice shall be included in all
108+
copies or substantial portions of the Software.
109+
110+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
111+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
112+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
113+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
114+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
115+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
116+
SOFTWARE.
117+
```
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
models:
2+
- name: ERFNet
3+
launchers:
4+
- framework: onnx_runtime
5+
adapter:
6+
type: segmentation
7+
make_argmax: True
8+
datasets:
9+
- name: erfnet_data
10+
preprocessing:
11+
- type: resize
12+
dst_width: 976
13+
dst_height: 208
14+
postprocessing:
15+
- type: resize_segmentation_mask
16+
dst_width: 1640
17+
dst_height: 350
18+
apply_to: prediction
19+
metrics:
20+
- type: segmentation_accuracy
21+
use_argmax: false
22+
presenter: print_scalar
23+
- type: mean_iou
24+
use_argmax: false
25+
presenter: print_scalar
26+
- name: ERFNet
27+
launchers:
28+
- framework: openvino
29+
adapter:
30+
type: segmentation
31+
make_argmax: True
32+
datasets:
33+
- name: erfnet_data
34+
preprocessing:
35+
- type: resize
36+
dst_width: 976
37+
dst_height: 208
38+
postprocessing:
39+
- type: resize_segmentation_mask
40+
dst_width: 1640
41+
dst_height: 350
42+
apply_to: prediction
43+
metrics:
44+
- type: mean_iou
45+
use_argmax: false
46+
presenter: print_scalar
47+
reference: 0.7647

models/public/erfnet/model.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copyright © 2022 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+
This is a ONNX* version of `ERFNet` model designed to perform real-time lane detection.
17+
This model is pre-trained in PyTorch* framework and retrained by CULane.
18+
For details see repository <https://github.com/Zhangxianwen2021/ERFNet>,
19+
paper of ERFNet<https://doi.org/10.1109/TITS.2017.2750080>and repository <https://github.com/cardwing/Codes-for-Lane-Detection/tree/master/ERFNet-CULane-PyTorch>
20+
task_type: semantic_segmentation
21+
files:
22+
- name: erfnet.onnx
23+
size: 8253755
24+
checksum: f6597d416f02b8218b557c4f673a0837fc215213055f9957267667003578e76507515d7c2be5d6983549f81cb96a0a66
25+
source: https://github.com/Zhangxianwen2021/ERFNet/raw/main/erfnet.onnx
26+
input_info:
27+
- name: input
28+
shape: [1, 3, 208, 976]
29+
layout: NCHW
30+
model_optimizer_args:
31+
- --input_model=$dl_dir/erfnet.onnx
32+
framework: onnx
33+
license: https://raw.githubusercontent.com/Zhangxianwen2021/ERFNet/main/License

models/public/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
omz_models_model_efficientnet_b0_pytorch
3939
omz_models_model_efficientnet_v2_b0
4040
omz_models_model_efficientnet_v2_s
41+
omz_models_model_erfnet
4142
omz_models_model_f3net
4243
omz_models_model_face_detection_retail_0044
4344
omz_models_model_face_recognition_resnet100_arcface_onnx
@@ -241,6 +242,7 @@ detect areas with complex shape.
241242
| ------------------------- | -------------- | -------------- | -------- | ------ | ------- |
242243
| DeepLab V3 | TensorFlow\* | [deeplabv3](./deeplabv3/README.md) | 68.41% | 11.469 | 23.819 |
243244
| DRN-D-38 | PyTorch\* | [drn-d-38](./drn-d-38/README.md) | 71.31% | 1768.3276 | 25.9939 |
245+
| Erfnet | PyTorch\* | [erfnet](./erfnet/README.md)| 76.47% | 11.13 | 7.87 |
244246
| HRNet V2 C1 Segmentation | PyTorch\* | [hrnet-v2-c1-segmentation](./hrnet-v2-c1-segmentation/README.md) | 77.69% | 81.993 | 66.4768 |
245247
| Fastseg MobileV3Large LR-ASPP, F=128 | PyTorch\* | [fastseg-large](./fastseg-large/README.md) | 72.67% | 140.9611 | 3.2 |
246248
| Fastseg MobileV3Small LR-ASPP, F=128 | PyTorch\* | [fastseg-small](./fastseg-small/README.md) | 67.15% | 69.2204 | 1.1 |

0 commit comments

Comments
 (0)