This repository has been archived by the owner on Dec 15, 2021. It is now read-only.
forked from facebookresearch/maskrcnn-benchmark
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add dcn from mmdetection (facebookresearch#693)
* make pixel indexes 0-based for bounding box in pascal voc dataset * replacing all instances of torch.distributed.deprecated with torch.distributed * replacing all instances of torch.distributed.deprecated with torch.distributed * add GroupNorm * add GroupNorm -- sort out yaml files * use torch.nn.GroupNorm instead, replace 'use_gn' with 'conv_block' and use 'BaseStem'&'Bottleneck' to simply codes * modification on 'group_norm' and 'conv_with_kaiming_uniform' function * modification on yaml files in configs/gn_baselines/ and reduce the amount of indentation and code duplication * use 'kaiming_uniform' to initialize resnet, disable gn after fc layer, and add dilation into ResNetHead * agnostic-regression for bbox * please set 'STRIDE_IN_1X1' to be 'False' when backbone use GN * add README.md for GN * add dcn from mmdetection
- Loading branch information
1 parent
88dfcf2
commit 91d4686
Showing
24 changed files
with
3,453 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,4 @@ dist/ | |
# project dirs | ||
/datasets | ||
/models | ||
/output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
### Reference | ||
1 [Deformable ConvNets v2: More Deformable, Better Results](https://arxiv.org/pdf/1811.11168.pdf) | ||
2 third-party: [mmdetection](https://github.com/open-mmlab/mmdetection/tree/master/configs/dcn) | ||
|
||
### Performance | ||
| case | bbox AP | mask AP | | ||
|----------------------------:|--------:|:-------:| | ||
| R-50-FPN-dcn (implement) | 39.8 | - | | ||
| R-50-FPN-dcn (mmdetection) | 40.0 | - | | ||
| R-50-FPN-mdcn (implement) | 40.0 | - | | ||
| R-50-FPN-mdcn (mmdetection) | 40.3 | - | | ||
| R-50-FPN-dcn (implement) | 40.8 | 36.8 | | ||
| R-50-FPN-dcn (mmdetection) | 41.1 | 37.2 | | ||
| R-50-FPN-dcn (implement) | 40.7 | 36.7 | | ||
| R-50-FPN-dcn (mmdetection) | 41.4 | 37.4 | | ||
|
||
|
||
### Note | ||
see [dcn-v2](https://github.com/open-mmlab/mmdetection/blob/master/MODEL_ZOO.md#deformable-convolution-v2) in `mmdetection` for more details. | ||
|
||
|
||
### Usage | ||
add these three lines | ||
``` | ||
MODEL: | ||
RESNETS: | ||
# corresponding to C2,C3,C4,C5 | ||
STAGE_WITH_DCN: (False, True, True, True) | ||
WITH_MODULATED_DCN: True | ||
DEFORMABLE_GROUPS: 1 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
INPUT: | ||
MIN_SIZE_TRAIN: (800,) | ||
MAX_SIZE_TRAIN: 1333 | ||
MIN_SIZE_TEST: 800 | ||
MAX_SIZE_TEST: 1333 | ||
MODEL: | ||
META_ARCHITECTURE: "GeneralizedRCNN" | ||
WEIGHT: "catalog://ImageNetPretrained/MSRA/R-50" | ||
BACKBONE: | ||
CONV_BODY: "R-50-FPN" | ||
RESNETS: | ||
BACKBONE_OUT_CHANNELS: 256 | ||
STAGE_WITH_DCN: (False, True, True, True) | ||
WITH_MODULATED_DCN: False | ||
DEFORMABLE_GROUPS: 1 | ||
RPN: | ||
USE_FPN: True | ||
ANCHOR_STRIDE: (4, 8, 16, 32, 64) | ||
PRE_NMS_TOP_N_TRAIN: 2000 | ||
PRE_NMS_TOP_N_TEST: 1000 | ||
POST_NMS_TOP_N_TEST: 1000 | ||
FPN_POST_NMS_TOP_N_TEST: 1000 | ||
ROI_HEADS: | ||
USE_FPN: True | ||
ROI_BOX_HEAD: | ||
POOLER_RESOLUTION: 7 | ||
POOLER_SCALES: (0.25, 0.125, 0.0625, 0.03125) | ||
POOLER_SAMPLING_RATIO: 2 | ||
FEATURE_EXTRACTOR: "FPN2MLPFeatureExtractor" | ||
PREDICTOR: "FPNPredictor" | ||
DATASETS: | ||
TRAIN: ("coco_2014_train", "coco_2014_valminusminival") | ||
TEST: ("coco_2014_minival",) | ||
DATALOADER: | ||
SIZE_DIVISIBILITY: 32 | ||
SOLVER: | ||
# Assume 8 gpus | ||
BASE_LR: 0.02 | ||
WEIGHT_DECAY: 0.0001 | ||
STEPS: (60000, 80000) | ||
MAX_ITER: 90000 | ||
IMS_PER_BATCH: 16 | ||
TEST: | ||
IMS_PER_BATCH: 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
INPUT: | ||
MIN_SIZE_TRAIN: (800,) | ||
MAX_SIZE_TRAIN: 1333 | ||
MIN_SIZE_TEST: 800 | ||
MAX_SIZE_TEST: 1333 | ||
MODEL: | ||
META_ARCHITECTURE: "GeneralizedRCNN" | ||
WEIGHT: "catalog://ImageNetPretrained/MSRA/R-50" | ||
BACKBONE: | ||
CONV_BODY: "R-50-FPN" | ||
RESNETS: | ||
BACKBONE_OUT_CHANNELS: 256 | ||
STAGE_WITH_DCN: (False, True, True, True) | ||
WITH_MODULATED_DCN: True | ||
DEFORMABLE_GROUPS: 1 | ||
RPN: | ||
USE_FPN: True | ||
ANCHOR_STRIDE: (4, 8, 16, 32, 64) | ||
PRE_NMS_TOP_N_TRAIN: 2000 | ||
PRE_NMS_TOP_N_TEST: 1000 | ||
POST_NMS_TOP_N_TEST: 1000 | ||
FPN_POST_NMS_TOP_N_TEST: 1000 | ||
ROI_HEADS: | ||
USE_FPN: True | ||
ROI_BOX_HEAD: | ||
POOLER_RESOLUTION: 7 | ||
POOLER_SCALES: (0.25, 0.125, 0.0625, 0.03125) | ||
POOLER_SAMPLING_RATIO: 2 | ||
FEATURE_EXTRACTOR: "FPN2MLPFeatureExtractor" | ||
PREDICTOR: "FPNPredictor" | ||
DATASETS: | ||
TRAIN: ("coco_2014_train", "coco_2014_valminusminival") | ||
TEST: ("coco_2014_minival",) | ||
DATALOADER: | ||
SIZE_DIVISIBILITY: 32 | ||
SOLVER: | ||
# Assume 8 gpus | ||
BASE_LR: 0.02 | ||
WEIGHT_DECAY: 0.0001 | ||
STEPS: (60000, 80000) | ||
MAX_ITER: 90000 | ||
IMS_PER_BATCH: 16 | ||
TEST: | ||
IMS_PER_BATCH: 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
INPUT: | ||
MIN_SIZE_TRAIN: (800,) | ||
MAX_SIZE_TRAIN: 1333 | ||
MIN_SIZE_TEST: 800 | ||
MAX_SIZE_TEST: 1333 | ||
MODEL: | ||
META_ARCHITECTURE: "GeneralizedRCNN" | ||
WEIGHT: "catalog://ImageNetPretrained/MSRA/R-50" | ||
BACKBONE: | ||
CONV_BODY: "R-50-FPN" | ||
RESNETS: | ||
BACKBONE_OUT_CHANNELS: 256 | ||
STAGE_WITH_DCN: (False, True, True, True) | ||
WITH_MODULATED_DCN: False | ||
DEFORMABLE_GROUPS: 1 | ||
RPN: | ||
USE_FPN: True | ||
ANCHOR_STRIDE: (4, 8, 16, 32, 64) | ||
PRE_NMS_TOP_N_TRAIN: 2000 | ||
PRE_NMS_TOP_N_TEST: 1000 | ||
POST_NMS_TOP_N_TEST: 1000 | ||
FPN_POST_NMS_TOP_N_TEST: 1000 | ||
ROI_HEADS: | ||
USE_FPN: True | ||
ROI_BOX_HEAD: | ||
POOLER_RESOLUTION: 7 | ||
POOLER_SCALES: (0.25, 0.125, 0.0625, 0.03125) | ||
POOLER_SAMPLING_RATIO: 2 | ||
FEATURE_EXTRACTOR: "FPN2MLPFeatureExtractor" | ||
PREDICTOR: "FPNPredictor" | ||
ROI_MASK_HEAD: | ||
POOLER_SCALES: (0.25, 0.125, 0.0625, 0.03125) | ||
FEATURE_EXTRACTOR: "MaskRCNNFPNFeatureExtractor" | ||
PREDICTOR: "MaskRCNNC4Predictor" | ||
POOLER_RESOLUTION: 14 | ||
POOLER_SAMPLING_RATIO: 2 | ||
RESOLUTION: 28 | ||
SHARE_BOX_FEATURE_EXTRACTOR: False | ||
MASK_ON: True | ||
DATASETS: | ||
TRAIN: ("coco_2014_train", "coco_2014_valminusminival") | ||
TEST: ("coco_2014_minival",) | ||
DATALOADER: | ||
SIZE_DIVISIBILITY: 32 | ||
SOLVER: | ||
# Assume 8 gpus | ||
BASE_LR: 0.02 | ||
WEIGHT_DECAY: 0.0001 | ||
STEPS: (60000, 80000) | ||
MAX_ITER: 90000 | ||
IMS_PER_BATCH: 16 | ||
TEST: | ||
IMS_PER_BATCH: 8 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
INPUT: | ||
MIN_SIZE_TRAIN: (800,) | ||
MAX_SIZE_TRAIN: 1333 | ||
MIN_SIZE_TEST: 800 | ||
MAX_SIZE_TEST: 1333 | ||
MODEL: | ||
META_ARCHITECTURE: "GeneralizedRCNN" | ||
WEIGHT: "catalog://ImageNetPretrained/MSRA/R-50" | ||
BACKBONE: | ||
CONV_BODY: "R-50-FPN" | ||
RESNETS: | ||
BACKBONE_OUT_CHANNELS: 256 | ||
STAGE_WITH_DCN: (False, True, True, True) | ||
WITH_MODULATED_DCN: True | ||
DEFORMABLE_GROUPS: 1 | ||
RPN: | ||
USE_FPN: True | ||
ANCHOR_STRIDE: (4, 8, 16, 32, 64) | ||
PRE_NMS_TOP_N_TRAIN: 2000 | ||
PRE_NMS_TOP_N_TEST: 1000 | ||
POST_NMS_TOP_N_TEST: 1000 | ||
FPN_POST_NMS_TOP_N_TEST: 1000 | ||
ROI_HEADS: | ||
USE_FPN: True | ||
ROI_BOX_HEAD: | ||
POOLER_RESOLUTION: 7 | ||
POOLER_SCALES: (0.25, 0.125, 0.0625, 0.03125) | ||
POOLER_SAMPLING_RATIO: 2 | ||
FEATURE_EXTRACTOR: "FPN2MLPFeatureExtractor" | ||
PREDICTOR: "FPNPredictor" | ||
ROI_MASK_HEAD: | ||
POOLER_SCALES: (0.25, 0.125, 0.0625, 0.03125) | ||
FEATURE_EXTRACTOR: "MaskRCNNFPNFeatureExtractor" | ||
PREDICTOR: "MaskRCNNC4Predictor" | ||
POOLER_RESOLUTION: 14 | ||
POOLER_SAMPLING_RATIO: 2 | ||
RESOLUTION: 28 | ||
SHARE_BOX_FEATURE_EXTRACTOR: False | ||
MASK_ON: True | ||
DATASETS: | ||
TRAIN: ("coco_2014_train", "coco_2014_valminusminival") | ||
TEST: ("coco_2014_minival",) | ||
DATALOADER: | ||
SIZE_DIVISIBILITY: 32 | ||
SOLVER: | ||
# Assume 8 gpus | ||
BASE_LR: 0.02 | ||
WEIGHT_DECAY: 0.0001 | ||
STEPS: (60000, 80000) | ||
MAX_ITER: 90000 | ||
IMS_PER_BATCH: 16 | ||
TEST: | ||
IMS_PER_BATCH: 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.