Skip to content

Commit

Permalink
update configs
Browse files Browse the repository at this point in the history
  • Loading branch information
czczup committed May 31, 2022
1 parent c5ade0a commit ed505bf
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 11 deletions.
49 changes: 49 additions & 0 deletions detection/configs/_base_/datasets/coco_instance_augreg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# dataset settings
dataset_type = 'CocoDataset'
data_root = 'data/coco/'
img_norm_cfg = dict(
mean=[127.5, 127.5, 127.5], std=[127.5, 127.5, 127.5], to_rgb=True)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations', with_bbox=True, with_mask=True),
dict(type='Resize', img_scale=(1333, 800), keep_ratio=True),
dict(type='RandomFlip', flip_ratio=0.5),
dict(type='Normalize', **img_norm_cfg),
dict(type='Pad', size_divisor=32),
dict(type='DefaultFormatBundle'),
dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels', 'gt_masks']),
]
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(
type='MultiScaleFlipAug',
img_scale=(1333, 800),
flip=False,
transforms=[
dict(type='Resize', keep_ratio=True),
dict(type='RandomFlip'),
dict(type='Normalize', **img_norm_cfg),
dict(type='Pad', size_divisor=32),
dict(type='ImageToTensor', keys=['img']),
dict(type='Collect', keys=['img']),
])
]
data = dict(
samples_per_gpu=2,
workers_per_gpu=2,
train=dict(
type=dataset_type,
ann_file=data_root + 'annotations/instances_train2017.json',
img_prefix=data_root + 'train2017/',
pipeline=train_pipeline),
val=dict(
type=dataset_type,
ann_file=data_root + 'annotations/instances_val2017.json',
img_prefix=data_root + 'val2017/',
pipeline=test_pipeline),
test=dict(
type=dataset_type,
ann_file=data_root + 'annotations/instances_val2017.json',
img_prefix=data_root + 'val2017/',
pipeline=test_pipeline))
evaluation = dict(metric=['bbox', 'segm'])
18 changes: 9 additions & 9 deletions detection/configs/mask_rcnn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
<!-- [ALGORITHM] -->

## Abstract
## Introduction

We present a conceptually simple, flexible, and general framework for object instance segmentation. Our approach efficiently detects objects in an image while simultaneously generating a high-quality segmentation mask for each instance. The method, called Mask R-CNN, extends Faster R-CNN by adding a branch for predicting an object mask in parallel with the existing branch for bounding box recognition. Mask R-CNN is simple to train and adds only a small overhead to Faster R-CNN, running at 5 fps. Moreover, Mask R-CNN is easy to generalize to other tasks, e.g., allowing us to estimate human poses in the same framework. We show top results in all three tracks of the COCO suite of challenges, including instance segmentation, bounding-box object detection, and person keypoint detection. Without bells and whistles, Mask R-CNN outperforms all existing, single-model entries on every task, including the COCO 2016 challenge winners. We hope our simple and effective approach will serve as a solid baseline and help ease future research in instance-level recognition.
Mask R-CNN is a conceptually simple, flexible, and general framework for object instance segmentation. It efficiently detects objects in an image while simultaneously generating a high-quality segmentation mask for each instance. And it extends Faster R-CNN by adding a branch for predicting an object mask in parallel with the existing branch for bounding box recognition. Mask R-CNN is simple to train and adds only a small overhead to Faster R-CNN, running at 5 fps. Moreover, Mask R-CNN is easy to generalize to other tasks, e.g., allowing us to estimate human poses in the same framework. Without bells and whistles, Mask R-CNN outperforms all existing, single-model entries on every task, including the COCO 2016 challenge winners.

<div align=center>
<img src="https://user-images.githubusercontent.com/40661020/143967081-c2552bed-9af2-46c4-ae44-5b3b74e5679f.png"/>
</div>

## Results and Models

| Backbone | Pre-train | Lr schd | box AP | mask AP | Config | Download |
|:-------------:|:----------------------------------------------------------------------------------------------------------------------------------------------------------------:|:-------:|:------:|:-------:|:--------------------------------------------------------------:|:-------------------------------------------------------------------------------------------------------------------------------:|
| ViT-Adapter-T | [DeiT-T]() | 3x | 46.0 | 41.0 | [config](./mask_rcnn_deit_adapter_tiny_fpn_3x_coco.py) | [model](https://github.com/czczup/ViT-Adapter/releases/download/v0.1.2/mask_rcnn_deit_adapter_tiny_fpn_3x_coco.pth.tar) |
| ViT-Adapter-S | [DeiT-S]() | 3x | 48.2 | 42.8 | [config](./mask_rcnn_deit_adapter_small_fpn_3x_coco.py) | [model]() |
| ViT-Adapter-B | [DeiT-B]() | 3x | 49.6 | 43.6 | [config](./mask_rcnn_deit_adapter_base_fpn_3x_coco.py) | [model]() |
| ViT-Adapter-B | [Uni-Perceiver](https://github.com/czczup/ViT-Adapter/releases/download/v0.1.1/uniperceiver_pretrain.pth) | 3x | 50.7 | 44.9 | [config](./mask_rcnn_uniperceiver_adapter_base_fpn_3x_coco.py) | [model](https://github.com/czczup/ViT-Adapter/releases/download/v0.1.1/mask_rcnn_uniperceiver_adapter_base_fpn_3x_coco.pth.tar) |
| ViT-Adapter-L | [AugReg](https://storage.googleapis.com/vit_models/augreg/L_16-i21k-300ep-lr_0.001-aug_medium1-wd_0.1-do_0.1-sd_0.1--imagenet2012-steps_20k-lr_0.01-res_384.npz) | 3x | 50.9 | 44.8 | [config](./mask_rcnn_augreg_adapter_large_fpn_3x_coco.py) | [model]() |
| Backbone | Pre-train | Lr schd | box AP | mask AP | #Param | Config | Download |
|:-------------:|:----------------------------------------------------------------------------------------------------------------------------------------------------------------:|:-------:|:------:|:-------:|:------:|:--------------------------------------------------------------:|:-------------------------------------------------------------------------------------------------------------------------------:|
| ViT-Adapter-T | [DeiT-T](https://dl.fbaipublicfiles.com/deit/deit_tiny_patch16_224-a1311bcf.pth) | 3x | 46.0 | 41.0 | 28M | [config](./mask_rcnn_deit_adapter_tiny_fpn_3x_coco.py) | [model](https://github.com/czczup/ViT-Adapter/releases/download/v0.1.2/mask_rcnn_deit_adapter_tiny_fpn_3x_coco.pth.tar) |
| ViT-Adapter-S | [DeiT-S](https://dl.fbaipublicfiles.com/deit/deit_small_patch16_224-cd65a155.pth) | 3x | 48.2 | 42.8 | 48M | [config](./mask_rcnn_deit_adapter_small_fpn_3x_coco.py) | [model]() |
| ViT-Adapter-B | [DeiT-B](https://dl.fbaipublicfiles.com/deit/deit_base_patch16_224-b5f2ef4d.pth) | 3x | 49.6 | 43.6 | 120M | [config](./mask_rcnn_deit_adapter_base_fpn_3x_coco.py) | [model]() |
| ViT-Adapter-B | [Uni-Perceiver](https://github.com/czczup/ViT-Adapter/releases/download/v0.1.1/uniperceiver_pretrain.pth) | 3x | 50.7 | 44.9 | 120M | [config](./mask_rcnn_uniperceiver_adapter_base_fpn_3x_coco.py) | [model](https://github.com/czczup/ViT-Adapter/releases/download/v0.1.1/mask_rcnn_uniperceiver_adapter_base_fpn_3x_coco.pth.tar) |
| ViT-Adapter-L | [AugReg](https://storage.googleapis.com/vit_models/augreg/L_16-i21k-300ep-lr_0.001-aug_medium1-wd_0.1-do_0.1-sd_0.1--imagenet2012-steps_20k-lr_0.01-res_384.npz) | 3x | 50.9 | 44.8 | 348M | [config](./mask_rcnn_augreg_adapter_large_fpn_3x_coco.py) | [model]() |
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
deform_num_heads=16,
cffn_ratio=0.25,
deform_ratio=0.5,
interact_indexes=[[0, 5], [6, 11], [12, 17], [18, 23]],
interaction_indexes=[[0, 5], [6, 11], [12, 17], [18, 23]],
window_attn=[True, True, True, True, True, False,
True, True, True, True, True, False,
True, True, True, True, True, False,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
deform_num_heads=6,
cffn_ratio=0.25,
deform_ratio=1.0,
interact_indexes=[[0, 2], [3, 5], [6, 8], [9, 11]],
interaction_indexes=[[0, 2], [3, 5], [6, 8], [9, 11]],
window_attn=[True, True, False, True, True, False,
True, True, False, True, True, False],
window_size=[14, 14, None, 14, 14, None,
Expand Down

0 comments on commit ed505bf

Please sign in to comment.