Skip to content

Commit a20b9b3

Browse files
Merge pull request #8 from airctic/mmdet-2.25.0
Update to mmdet 2.25.0
2 parents edceb5d + b78b844 commit a20b9b3

206 files changed

Lines changed: 7841 additions & 2399 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# dataset settings
2+
dataset_type = 'OpenImagesDataset'
3+
data_root = 'data/OpenImages/'
4+
img_norm_cfg = dict(
5+
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
6+
train_pipeline = [
7+
dict(type='LoadImageFromFile'),
8+
dict(type='LoadAnnotations', with_bbox=True, denorm_bbox=True),
9+
dict(type='Resize', img_scale=(1024, 800), keep_ratio=True),
10+
dict(type='RandomFlip', flip_ratio=0.5),
11+
dict(type='Normalize', **img_norm_cfg),
12+
dict(type='Pad', size_divisor=32),
13+
dict(type='DefaultFormatBundle'),
14+
dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels']),
15+
]
16+
test_pipeline = [
17+
dict(type='LoadImageFromFile'),
18+
dict(
19+
type='MultiScaleFlipAug',
20+
img_scale=(1024, 800),
21+
flip=False,
22+
transforms=[
23+
dict(type='Resize', keep_ratio=True),
24+
dict(type='RandomFlip'),
25+
dict(type='Normalize', **img_norm_cfg),
26+
dict(type='Pad', size_divisor=32),
27+
dict(type='ImageToTensor', keys=['img']),
28+
dict(type='Collect', keys=['img']),
29+
],
30+
),
31+
]
32+
data = dict(
33+
samples_per_gpu=2,
34+
workers_per_gpu=0, # workers_per_gpu > 0 may occur out of memory
35+
train=dict(
36+
type=dataset_type,
37+
ann_file=data_root + 'annotations/oidv6-train-annotations-bbox.csv',
38+
img_prefix=data_root + 'OpenImages/train/',
39+
label_file=data_root + 'annotations/class-descriptions-boxable.csv',
40+
hierarchy_file=data_root +
41+
'annotations/bbox_labels_600_hierarchy.json',
42+
pipeline=train_pipeline),
43+
val=dict(
44+
type=dataset_type,
45+
ann_file=data_root + 'annotations/validation-annotations-bbox.csv',
46+
img_prefix=data_root + 'OpenImages/validation/',
47+
label_file=data_root + 'annotations/class-descriptions-boxable.csv',
48+
hierarchy_file=data_root +
49+
'annotations/bbox_labels_600_hierarchy.json',
50+
meta_file=data_root + 'annotations/validation-image-metas.pkl',
51+
image_level_ann_file=data_root +
52+
'annotations/validation-annotations-human-imagelabels-boxable.csv',
53+
pipeline=test_pipeline),
54+
test=dict(
55+
type=dataset_type,
56+
ann_file=data_root + 'annotations/validation-annotations-bbox.csv',
57+
img_prefix=data_root + 'OpenImages/validation/',
58+
label_file=data_root + 'annotations/class-descriptions-boxable.csv',
59+
hierarchy_file=data_root +
60+
'annotations/bbox_labels_600_hierarchy.json',
61+
meta_file=data_root + 'annotations/validation-image-metas.pkl',
62+
image_level_ann_file=data_root +
63+
'annotations/validation-annotations-human-imagelabels-boxable.csv',
64+
pipeline=test_pipeline))
65+
evaluation = dict(interval=1, metric='mAP')

configs/_base_/default_runtime.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,14 @@
1414
load_from = None
1515
resume_from = None
1616
workflow = [('train', 1)]
17+
18+
# disable opencv multithreading to avoid system being overloaded
19+
opencv_num_threads = 0
20+
# set multi-process start method as `fork` to speed up the training
21+
mp_start_method = 'fork'
22+
23+
# Default setting for scaling LR automatically
24+
# - `enable` means enable scaling LR automatically
25+
# or not by default.
26+
# - `base_batch_size` = (8 GPUs) x (2 samples per GPU).
27+
auto_scale_lr = dict(enable=False, base_batch_size=16)

configs/_base_/models/faster_rcnn_r50_caffe_c4.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@
4242
dilation=1,
4343
style='caffe',
4444
norm_cfg=norm_cfg,
45-
norm_eval=True),
45+
norm_eval=True,
46+
init_cfg=dict(
47+
type='Pretrained',
48+
checkpoint='open-mmlab://detectron2/resnet50_caffe')),
4649
bbox_roi_extractor=dict(
4750
type='SingleRoIExtractor',
4851
roi_layer=dict(type='RoIAlign', output_size=14, sampling_ratio=0),
@@ -78,7 +81,7 @@
7881
pos_fraction=0.5,
7982
neg_pos_ub=-1,
8083
add_gt_as_proposals=False),
81-
allowed_border=0,
84+
allowed_border=-1,
8285
pos_weight=-1,
8386
debug=False),
8487
rpn_proposal=dict(

configs/albu_example/README.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
# Albu Example
22

3-
## Abstract
3+
> [Albumentations: fast and flexible image augmentations](https://arxiv.org/abs/1809.06839)
4+
5+
<!-- [OTHERS] -->
46

5-
<!-- [ABSTRACT] -->
7+
## Abstract
68

79
Data augmentation is a commonly used technique for increasing both the size and the diversity of labeled training sets by leveraging input transformations that preserve output labels. In computer vision domain, image augmentations have become a common implicit regularization technique to combat overfitting in deep convolutional neural networks and are ubiquitously used to improve performance. While most deep learning frameworks implement basic image transformations, the list is typically limited to some variations and combinations of flipping, rotating, scaling, and cropping. Moreover, the image processing speed varies in existing tools for image augmentation. We present Albumentations, a fast and flexible library for image augmentations with many various image transform operations available, that is also an easy-to-use wrapper around other augmentation libraries. We provide examples of image augmentations for different computer vision tasks and show that Albumentations is faster than other commonly used image augmentation tools on the most of commonly used image transformations.
810

9-
<!-- [IMAGE] -->
1011
<div align=center>
1112
<img src="https://user-images.githubusercontent.com/40661020/143870703-74f3ea3f-ae23-4035-9856-746bc3f88464.png" height="400" />
1213
</div>
1314

14-
<!-- [PAPER_TITLE: Albumentations: fast and flexible image augmentations] -->
15-
<!-- [PAPER_URL: https://arxiv.org/abs/1809.06839] -->
15+
## Results and Models
1616

17-
## Citation
17+
| Backbone | Style | Lr schd | Mem (GB) | Inf time (fps) | box AP | mask AP | Config | Download |
18+
| :------: | :-----: | :-----: | :------: | :------------: | :----: | :-----: | :--------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
19+
| R-50 | pytorch | 1x | 4.4 | 16.6 | 38.0 | 34.5 | [config](https://github.com/open-mmlab/mmdetection/tree/master/configs/albu_example/mask_rcnn_r50_fpn_albu_1x_coco.py) | [model](https://download.openmmlab.com/mmdetection/v2.0/albu_example/mask_rcnn_r50_fpn_albu_1x_coco/mask_rcnn_r50_fpn_albu_1x_coco_20200208-ab203bcd.pth) \| [log](https://download.openmmlab.com/mmdetection/v2.0/albu_example/mask_rcnn_r50_fpn_albu_1x_coco/mask_rcnn_r50_fpn_albu_1x_coco_20200208_225520.log.json) |
1820

19-
<!-- [OTHERS] -->
21+
## Citation
2022

21-
```
23+
```latex
2224
@article{2018arXiv180906839B,
2325
author = {A. Buslaev, A. Parinov, E. Khvedchenya, V.~I. Iglovikov and A.~A. Kalinin},
2426
title = "{Albumentations: fast and flexible image augmentations}",
@@ -27,9 +29,3 @@ Data augmentation is a commonly used technique for increasing both the size and
2729
year = 2018
2830
}
2931
```
30-
31-
## Results and Models
32-
33-
| Backbone | Style | Lr schd | Mem (GB) | Inf time (fps) | box AP | mask AP | Config | Download |
34-
|:---------:|:-------:|:-------:|:--------:|:--------------:|:------:|:-------:|:------:|:--------:|
35-
| R-50 | pytorch | 1x | 4.4 | 16.6 | 38.0 | 34.5 |[config](https://github.com/open-mmlab/mmdetection/tree/master/configs/albu_example/mask_rcnn_r50_fpn_albu_1x_coco.py) | [model](https://download.openmmlab.com/mmdetection/v2.0/albu_example/mask_rcnn_r50_fpn_albu_1x_coco/mask_rcnn_r50_fpn_albu_1x_coco_20200208-ab203bcd.pth) &#124; [log](https://download.openmmlab.com/mmdetection/v2.0/albu_example/mask_rcnn_r50_fpn_albu_1x_coco/mask_rcnn_r50_fpn_albu_1x_coco_20200208_225520.log.json) |

configs/atss/README.md

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
1-
# Bridging the Gap Between Anchor-based and Anchor-free Detection via Adaptive Training Sample Selection
1+
# ATSS
22

3-
## Abstract
3+
> [Bridging the Gap Between Anchor-based and Anchor-free Detection via Adaptive Training Sample Selection](https://arxiv.org/abs/1912.02424)
4+
5+
<!-- [ALGORITHM] -->
46

5-
<!-- [ABSTRACT] -->
7+
## Abstract
68

79
Object detection has been dominated by anchor-based detectors for several years. Recently, anchor-free detectors have become popular due to the proposal of FPN and Focal Loss. In this paper, we first point out that the essential difference between anchor-based and anchor-free detection is actually how to define positive and negative training samples, which leads to the performance gap between them. If they adopt the same definition of positive and negative samples during training, there is no obvious difference in the final performance, no matter regressing from a box or a point. This shows that how to select positive and negative training samples is important for current object detectors. Then, we propose an Adaptive Training Sample Selection (ATSS) to automatically select positive and negative samples according to statistical characteristics of object. It significantly improves the performance of anchor-based and anchor-free detectors and bridges the gap between them. Finally, we discuss the necessity of tiling multiple anchors per location on the image to detect objects. Extensive experiments conducted on MS COCO support our aforementioned analysis and conclusions. With the newly introduced ATSS, we improve state-of-the-art detectors by a large margin to 50.7% AP without introducing any overhead.
810

9-
<!-- [IMAGE] -->
1011
<div align=center>
1112
<img src="https://user-images.githubusercontent.com/40661020/143870776-c81168f5-e8b2-44ee-978b-509e4372c5c9.png"/>
1213
</div>
1314

14-
<!-- [PAPER_TITLE: Bridging the Gap Between Anchor-based and Anchor-free Detection via Adaptive Training Sample Selection] -->
15-
<!-- [PAPER_URL: https://arxiv.org/abs/1912.02424] -->
15+
## Results and Models
1616

17-
## Citation
17+
| Backbone | Style | Lr schd | Mem (GB) | Inf time (fps) | box AP | Config | Download |
18+
| :------: | :-----: | :-----: | :------: | :------------: | :----: | :---------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
19+
| R-50 | pytorch | 1x | 3.7 | 19.7 | 39.4 | [config](https://github.com/open-mmlab/mmdetection/tree/master/configs/atss/atss_r50_fpn_1x_coco.py) | [model](https://download.openmmlab.com/mmdetection/v2.0/atss/atss_r50_fpn_1x_coco/atss_r50_fpn_1x_coco_20200209-985f7bd0.pth) \| [log](https://download.openmmlab.com/mmdetection/v2.0/atss/atss_r50_fpn_1x_coco/atss_r50_fpn_1x_coco_20200209_102539.log.json) |
20+
| R-101 | pytorch | 1x | 5.6 | 12.3 | 41.5 | [config](https://github.com/open-mmlab/mmdetection/tree/master/configs/atss/atss_r101_fpn_1x_coco.py) | [model](https://download.openmmlab.com/mmdetection/v2.0/atss/atss_r101_fpn_1x_coco/atss_r101_fpn_1x_20200825-dfcadd6f.pth) \| [log](https://download.openmmlab.com/mmdetection/v2.0/atss/atss_r101_fpn_1x_coco/atss_r101_fpn_1x_20200825-dfcadd6f.log.json) |
1821

19-
<!-- [ALGORITHM] -->
22+
## Citation
2023

2124
```latex
2225
@article{zhang2019bridging,
@@ -26,10 +29,3 @@ Object detection has been dominated by anchor-based detectors for several years.
2629
year = {2019}
2730
}
2831
```
29-
30-
## Results and Models
31-
32-
| Backbone | Style | Lr schd | Mem (GB) | Inf time (fps) | box AP | Config | Download |
33-
|:---------:|:-------:|:-------:|:--------:|:--------------:|:------:|:------:|:--------:|
34-
| R-50 | pytorch | 1x | 3.7 | 19.7 | 39.4 | [config](https://github.com/open-mmlab/mmdetection/tree/master/configs/atss/atss_r50_fpn_1x_coco.py) | [model](https://download.openmmlab.com/mmdetection/v2.0/atss/atss_r50_fpn_1x_coco/atss_r50_fpn_1x_coco_20200209-985f7bd0.pth) &#124; [log](https://download.openmmlab.com/mmdetection/v2.0/atss/atss_r50_fpn_1x_coco/atss_r50_fpn_1x_coco_20200209_102539.log.json) |
35-
| R-101 | pytorch | 1x | 5.6 | 12.3 | 41.5 | [config](https://github.com/open-mmlab/mmdetection/tree/master/configs/atss/atss_r101_fpn_1x_coco.py) | [model](https://download.openmmlab.com/mmdetection/v2.0/atss/atss_r101_fpn_1x_coco/atss_r101_fpn_1x_20200825-dfcadd6f.pth) &#124; [log](https://download.openmmlab.com/mmdetection/v2.0/atss/atss_r101_fpn_1x_coco/atss_r101_fpn_1x_20200825-dfcadd6f.log.json) |

configs/autoassign/README.md

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,35 @@
1-
# AutoAssign: Differentiable Label Assignment for Dense Object Detection
1+
# AutoAssign
22

3-
## Abstract
3+
> [AutoAssign: Differentiable Label Assignment for Dense Object Detection](https://arxiv.org/abs/2007.03496)
4+
5+
<!-- [ALGORITHM] -->
46

5-
<!-- [ABSTRACT] -->
7+
## Abstract
68

79
Determining positive/negative samples for object detection is known as label assignment. Here we present an anchor-free detector named AutoAssign. It requires little human knowledge and achieves appearance-aware through a fully differentiable weighting mechanism. During training, to both satisfy the prior distribution of data and adapt to category characteristics, we present Center Weighting to adjust the category-specific prior distributions. To adapt to object appearances, Confidence Weighting is proposed to adjust the specific assign strategy of each instance. The two weighting modules are then combined to generate positive and negative weights to adjust each location's confidence. Extensive experiments on the MS COCO show that our method steadily surpasses other best sampling strategies by large margins with various backbones. Moreover, our best model achieves 52.1% AP, outperforming all existing one-stage detectors. Besides, experiments on other datasets, e.g., PASCAL VOC, Objects365, and WiderFace, demonstrate the broad applicability of AutoAssign.
810

9-
<!-- [IMAGE] -->
1011
<div align=center>
1112
<img src="https://user-images.githubusercontent.com/40661020/143870875-33567e44-0584-4470-9a90-0df0fb6c1fe2.png"/>
1213
</div>
1314

14-
<!-- [PAPER_TITLE: AutoAssign: Differentiable Label Assignment for Dense Object Detection] -->
15-
<!-- [PAPER_URL: https://arxiv.org/abs/2007.03496] -->
15+
## Results and Models
1616

17-
## Citation
17+
| Backbone | Style | Lr schd | Mem (GB) | box AP | Config | Download |
18+
| :------: | :---: | :-----: | :------: | :----: | :------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
19+
| R-50 | caffe | 1x | 4.08 | 40.4 | [config](https://github.com/open-mmlab/mmdetection/tree/master/configs/autoassign/autoassign_r50_fpn_8x2_1x_coco.py) | [model](https://download.openmmlab.com/mmdetection/v2.0/autoassign/auto_assign_r50_fpn_1x_coco/auto_assign_r50_fpn_1x_coco_20210413_115540-5e17991f.pth) \| [log](https://download.openmmlab.com/mmdetection/v2.0/autoassign/auto_assign_r50_fpn_1x_coco/auto_assign_r50_fpn_1x_coco_20210413_115540-5e17991f.log.json) |
1820

19-
<!-- [ALGORITHM] -->
21+
**Note**:
2022

21-
```
23+
1. We find that the performance is unstable with 1x setting and may fluctuate by about 0.3 mAP. mAP 40.3 ~ 40.6 is acceptable. Such fluctuation can also be found in the original implementation.
24+
2. You can get a more stable results ~ mAP 40.6 with a schedule total 13 epoch, and learning rate is divided by 10 at 10th and 13th epoch.
25+
26+
## Citation
27+
28+
```latex
2229
@article{zhu2020autoassign,
2330
title={AutoAssign: Differentiable Label Assignment for Dense Object Detection},
2431
author={Zhu, Benjin and Wang, Jianfeng and Jiang, Zhengkai and Zong, Fuhang and Liu, Songtao and Li, Zeming and Sun, Jian},
2532
journal={arXiv preprint arXiv:2007.03496},
2633
year={2020}
2734
}
2835
```
29-
30-
## Results and Models
31-
32-
| Backbone | Style | Lr schd | Mem (GB) | box AP | Config | Download |
33-
|:---------:|:-------:|:-------:|:--------:|:------:|:------:|:--------:|
34-
| R-50 | caffe | 1x | 4.08 | 40.4 | [config](https://github.com/open-mmlab/mmdetection/tree/master/configs/autoassign/autoassign_r50_fpn_8x2_1x_coco.py) |[model](https://download.openmmlab.com/mmdetection/v2.0/autoassign/auto_assign_r50_fpn_1x_coco/auto_assign_r50_fpn_1x_coco_20210413_115540-5e17991f.pth) &#124; [log](https://download.openmmlab.com/mmdetection/v2.0/autoassign/auto_assign_r50_fpn_1x_coco/auto_assign_r50_fpn_1x_coco_20210413_115540-5e17991f.log.json) |
35-
36-
**Note**:
37-
38-
1. We find that the performance is unstable with 1x setting and may fluctuate by about 0.3 mAP. mAP 40.3 ~ 40.6 is acceptable. Such fluctuation can also be found in the original implementation.
39-
2. You can get a more stable results ~ mAP 40.6 with a schedule total 13 epoch, and learning rate is divided by 10 at 10th and 13th epoch.

0 commit comments

Comments
 (0)