Skip to content

Commit a04a482

Browse files
hachreakZwwWayne
andauthored
roi_extractors: GRoIE addition (#2584)
* roi_extractors: GRoIE addition Signed-off-by: Leonardo Rossi <[email protected]> * Fix bug caused by empty tensor and update benchmark results Co-authored-by: ZwwWayne <[email protected]>
1 parent c6948c6 commit a04a482

14 files changed

+393
-3
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ venv.bak/
104104
.mypy_cache/
105105

106106
mmdet/version.py
107-
./data/
107+
data/
108108
.vscode
109109
.idea
110110
.DS_Store

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ Other features
8888
- [x] [GCNet](configs/gcnet/README.md)
8989
- [x] [Mixed Precision (FP16) Training](configs/fp16/README.md)
9090
- [x] [InstaBoost](configs/instaboost/README.md)
91+
- [x] [GRoIE](configs/groie/README.md)
9192

9293
Some other methods are also supported in [projects using MMDetection](./docs/projects.md).
9394

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
_base_ = ['../grid_rcnn/grid_rcnn_r50_fpn_gn-head_2x_coco.py']
2+
# learning policy
3+
lr_config = dict(
4+
policy='step',
5+
warmup='linear',
6+
warmup_iters=500,
7+
warmup_ratio=0.001,
8+
step=[8, 11])
9+
checkpoint_config = dict(interval=1)
10+
# runtime settings
11+
total_epochs = 12

configs/groie/README.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# GRoIE
2+
3+
## A novel Region of Interest Extraction Layer for Instance Segmentation
4+
5+
By Leonardo Rossi, Akbar Karimi and Andrea Prati from
6+
[IMPLab](http://implab.ce.unipr.it/).
7+
8+
We provide config files to reproduce the results in the paper for
9+
"*A novel Region of Interest Extraction Layer for Instance Segmentation*"
10+
on COCO object detection.
11+
12+
## Introduction
13+
14+
This paper is motivated by the need to overcome to the limitations of existing
15+
RoI extractors which select only one (the best) layer from FPN.
16+
17+
Our intuition is that all the layers of FPN retain useful information.
18+
19+
Therefore, the proposed layer (called Generic RoI Extractor - **GRoIE**)
20+
introduces non-local building blocks and attention mechanisms to boost the
21+
performance.
22+
23+
## Results and models
24+
25+
The results on COCO 2017 minival (5k images) are shown in the below table.
26+
You can find
27+
[here](https://drive.google.com/drive/folders/19ssstbq_h0Z1cgxHmJYFO8s1arf3QJbT)
28+
the trained models.
29+
30+
### Application of GRoIE to different architectures
31+
32+
| Backbone | Model | Lr schd | box AP | mask AP | Config file |
33+
| :-------: | :--------------: | :-----: | :----: | :-----: | :-----------------------------------------------------------------: |
34+
| R-50-FPN | Faster Original | 1x | 37.4 | | [config file](../faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py) |
35+
| R-50-FPN | + GRoIE | 1x | 38.3 | | [config file](./faster_rcnn_r50_fpn_groie_1x_coco.py) |
36+
| R-50-FPN | Grid R-CNN | 1x | 39.1 | | [config file](../grid_rcnn/grid_rcnn_r50_fpn_gn-head_1x_coco.py) |
37+
| R-50-FPN | + GRoIE | 1x | | | [config file](./grid_rcnn_r50_fpn_gn-head_groie_1x_coco.py) |
38+
| R-50-FPN | Mask R-CNN | 1x | 38.2 | 34.7 | [config file](../mask_rcnn/mask_rcnn_r50_fpn_1x_coco.py) |
39+
| R-50-FPN | + GRoIE | 1x | 39.0 | 36.0 | [config file](./mask_rcnn_r50_fpn_groie_1x_coco.py) |
40+
| R-50-FPN | GC-Net | 1x | 40.7 | 36.5 | [config file](../gcnet/mask_rcnn_r50_fpn_syncbn-backbone_r4_gcb_c3-c5_1x_coco.py) |
41+
| R-50-FPN | + GRoIE | 1x | 41.0 | 37.8 | [config file](./mask_rcnn_r50_fpn_syncbn-backbone_r4_gcb_c3-c5_groie_1x_coco.py) |
42+
| R-101-FPN | GC-Net | 1x | 42.2 | 37.8 | [config file](../configs/gcnet/mask_rcnn_r101_fpn_syncbn-backbone_r4_gcb_c3-c5_1x_coco.py) |
43+
| R-101-FPN | + GRoIE | 1x | | | [config file](./mask_rcnn_r101_fpn_syncbn-backbone_r4_gcb_c3-c5_groie_1x_coco.py) |
44+
45+
46+
47+
## Citation
48+
49+
If you use this work or benchmark in your research, please cite this project.
50+
51+
```
52+
@misc{rossi2020novel,
53+
title={A novel Region of Interest Extraction Layer for Instance Segmentation},
54+
author={Leonardo Rossi and Akbar Karimi and Andrea Prati},
55+
year={2020},
56+
eprint={2004.13665},
57+
archivePrefix={arXiv},
58+
primaryClass={cs.CV}
59+
}
60+
```
61+
62+
## Contact
63+
64+
The implementation of GROI is currently maintained by
65+
[Leonardo Rossi](https://github.com/hachreak/).
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
_base_ = '../faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py'
2+
# model settings
3+
model = dict(
4+
roi_head=dict(
5+
bbox_roi_extractor=dict(
6+
type='SumGenericRoiExtractor',
7+
roi_layer=dict(type='RoIAlign', out_size=7, sample_num=2),
8+
out_channels=256,
9+
featmap_strides=[4, 8, 16, 32],
10+
pre_cfg=dict(
11+
type='ConvModule',
12+
in_channels=256,
13+
out_channels=256,
14+
kernel_size=5,
15+
padding=2,
16+
inplace=False,
17+
),
18+
post_cfg=dict(
19+
type='GeneralizedAttention',
20+
in_channels=256,
21+
spatial_range=-1,
22+
num_heads=6,
23+
attention_type='0100',
24+
kv_stride=2))))
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
_base_ = '../grid_rcnn/grid_rcnn_r50_fpn_gn-head_1x_coco.py'
2+
# model settings
3+
model = dict(
4+
roi_head=dict(
5+
bbox_roi_extractor=dict(
6+
type='SumGenericRoiExtractor',
7+
roi_layer=dict(type='RoIAlign', out_size=7, sample_num=2),
8+
out_channels=256,
9+
featmap_strides=[4, 8, 16, 32],
10+
pre_cfg=dict(
11+
type='ConvModule',
12+
in_channels=256,
13+
out_channels=256,
14+
kernel_size=5,
15+
padding=2,
16+
inplace=False,
17+
),
18+
post_cfg=dict(
19+
type='GeneralizedAttention',
20+
in_channels=256,
21+
spatial_range=-1,
22+
num_heads=6,
23+
attention_type='0100',
24+
kv_stride=2)),
25+
grid_roi_extractor=dict(
26+
type='SumGenericRoiExtractor',
27+
roi_layer=dict(type='RoIAlign', out_size=14, sample_num=2),
28+
out_channels=256,
29+
featmap_strides=[4, 8, 16, 32],
30+
pre_cfg=dict(
31+
type='ConvModule',
32+
in_channels=256,
33+
out_channels=256,
34+
kernel_size=5,
35+
padding=2,
36+
inplace=False,
37+
),
38+
post_cfg=dict(
39+
type='GeneralizedAttention',
40+
in_channels=256,
41+
spatial_range=-1,
42+
num_heads=6,
43+
attention_type='0100',
44+
kv_stride=2))))
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
_base_ = '../gcnet/mask_rcnn_r101_fpn_syncbn-backbone_r4_gcb_c3-c5_1x_coco.py'
2+
# model settings
3+
model = dict(
4+
roi_head=dict(
5+
bbox_roi_extractor=dict(
6+
type='SumGenericRoiExtractor',
7+
roi_layer=dict(type='RoIAlign', out_size=7, sample_num=2),
8+
out_channels=256,
9+
featmap_strides=[4, 8, 16, 32],
10+
pre_cfg=dict(
11+
type='ConvModule',
12+
in_channels=256,
13+
out_channels=256,
14+
kernel_size=5,
15+
padding=2,
16+
inplace=False,
17+
),
18+
post_cfg=dict(
19+
type='GeneralizedAttention',
20+
in_channels=256,
21+
spatial_range=-1,
22+
num_heads=6,
23+
attention_type='0100',
24+
kv_stride=2)),
25+
mask_roi_extractor=dict(
26+
type='SumGenericRoiExtractor',
27+
roi_layer=dict(type='RoIAlign', out_size=14, sample_num=2),
28+
out_channels=256,
29+
featmap_strides=[4, 8, 16, 32],
30+
pre_cfg=dict(
31+
type='ConvModule',
32+
in_channels=256,
33+
out_channels=256,
34+
kernel_size=5,
35+
padding=2,
36+
inplace=False,
37+
),
38+
post_cfg=dict(
39+
type='GeneralizedAttention',
40+
in_channels=256,
41+
spatial_range=-1,
42+
num_heads=6,
43+
attention_type='0100',
44+
kv_stride=2))))
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
_base_ = '../mask_rcnn/mask_rcnn_r50_fpn_1x_coco.py'
2+
# model settings
3+
model = dict(
4+
roi_head=dict(
5+
bbox_roi_extractor=dict(
6+
type='SumGenericRoiExtractor',
7+
roi_layer=dict(type='RoIAlign', out_size=7, sample_num=2),
8+
out_channels=256,
9+
featmap_strides=[4, 8, 16, 32],
10+
pre_cfg=dict(
11+
type='ConvModule',
12+
in_channels=256,
13+
out_channels=256,
14+
kernel_size=5,
15+
padding=2,
16+
inplace=False,
17+
),
18+
post_cfg=dict(
19+
type='GeneralizedAttention',
20+
in_channels=256,
21+
spatial_range=-1,
22+
num_heads=6,
23+
attention_type='0100',
24+
kv_stride=2)),
25+
mask_roi_extractor=dict(
26+
type='SumGenericRoiExtractor',
27+
roi_layer=dict(type='RoIAlign', out_size=14, sample_num=2),
28+
out_channels=256,
29+
featmap_strides=[4, 8, 16, 32],
30+
pre_cfg=dict(
31+
type='ConvModule',
32+
in_channels=256,
33+
out_channels=256,
34+
kernel_size=5,
35+
padding=2,
36+
inplace=False,
37+
),
38+
post_cfg=dict(
39+
type='GeneralizedAttention',
40+
in_channels=256,
41+
spatial_range=-1,
42+
num_heads=6,
43+
attention_type='0100',
44+
kv_stride=2))))
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
_base_ = '../gcnet/mask_rcnn_r50_fpn_syncbn-backbone_r4_gcb_c3-c5_1x_coco.py'
2+
# model settings
3+
model = dict(
4+
roi_head=dict(
5+
bbox_roi_extractor=dict(
6+
type='SumGenericRoiExtractor',
7+
roi_layer=dict(type='RoIAlign', out_size=7, sample_num=2),
8+
out_channels=256,
9+
featmap_strides=[4, 8, 16, 32],
10+
pre_cfg=dict(
11+
type='ConvModule',
12+
in_channels=256,
13+
out_channels=256,
14+
kernel_size=5,
15+
padding=2,
16+
inplace=False,
17+
),
18+
post_cfg=dict(
19+
type='GeneralizedAttention',
20+
in_channels=256,
21+
spatial_range=-1,
22+
num_heads=6,
23+
attention_type='0100',
24+
kv_stride=2)),
25+
mask_roi_extractor=dict(
26+
type='SumGenericRoiExtractor',
27+
roi_layer=dict(type='RoIAlign', out_size=14, sample_num=2),
28+
out_channels=256,
29+
featmap_strides=[4, 8, 16, 32],
30+
pre_cfg=dict(
31+
type='ConvModule',
32+
in_channels=256,
33+
out_channels=256,
34+
kernel_size=5,
35+
padding=2,
36+
inplace=False,
37+
),
38+
post_cfg=dict(
39+
type='GeneralizedAttention',
40+
in_channels=256,
41+
spatial_range=-1,
42+
num_heads=6,
43+
attention_type='0100',
44+
kv_stride=2))))

docs/model_zoo.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ Please refer to [RegNet](https://github.com/open-mmlab/mmdetection/blob/master/c
129129
### Res2Net
130130
Please refer to [Res2Net](https://github.com/open-mmlab/mmdetection/blob/master/configs/res2net) for details.
131131

132+
### GRoIE
133+
Please refer to [GRoIE](https://github.com/open-mmlab/mmdetection/blob/master/configs/groie) for details.
134+
132135
### Other datasets
133136

134137
We also benchmark some methods on [PASCAL VOC](https://github.com/open-mmlab/mmdetection/blob/master/configs/pascal_voc), [Cityscapes](https://github.com/open-mmlab/mmdetection/blob/master/configs/cityscapes) and [WIDER FACE](https://github.com/open-mmlab/mmdetection/blob/master/configs/wider_face).

0 commit comments

Comments
 (0)