├── tests ├── test_engine │ ├── __init__.py │ └── test_optimizers │ │ └── __init__.py ├── test_structures │ ├── __init__.py │ └── test_bbox │ │ └── __init__.py ├── test_models │ ├── test_layers │ │ └── __init__.py │ ├── test_task_modules │ │ ├── __init__.py │ │ ├── test_samplers │ │ │ └── test_pesudo_sampler.py │ │ └── test_track │ │ │ └── test_similarity.py │ └── test_backbones │ │ └── __init__.py ├── data │ ├── custom_dataset │ │ ├── test.txt │ │ ├── trainval.txt │ │ └── images │ │ │ └── 000001.jpg │ ├── WIDERFace │ │ ├── WIDER_train │ │ │ └── 0--Parade │ │ │ │ └── .gitkeep │ │ └── train.txt │ ├── VOCdevkit │ │ ├── VOC2007 │ │ │ ├── ImageSets │ │ │ │ └── Main │ │ │ │ │ ├── test.txt │ │ │ │ │ └── trainval.txt │ │ │ └── JPEGImages │ │ │ │ └── 000001.jpg │ │ └── VOC2012 │ │ │ ├── ImageSets │ │ │ └── Main │ │ │ │ ├── test.txt │ │ │ │ └── trainval.txt │ │ │ └── JPEGImages │ │ │ └── 000001.jpg │ ├── OpenImages │ │ ├── annotations │ │ │ ├── class-descriptions-boxable.csv │ │ │ ├── image-metas.pkl │ │ │ ├── annotations-human-imagelabels-boxable.csv │ │ │ ├── bbox_labels_600_hierarchy.json │ │ │ └── oidv6-train-annotations-bbox.csv │ │ └── challenge2019 │ │ │ ├── cls-label-description.csv │ │ │ ├── annotations-human-imagelabels-boxable.csv │ │ │ ├── class_label_tree.np │ │ │ └── challenge-2019-train-detection-bbox.txt │ ├── color.jpg │ ├── gray.jpg │ ├── dsdl_det │ │ └── config.py │ └── crowdhuman_dataset │ │ └── id_hw_train.json ├── test_evaluation │ └── test_metrics │ │ └── __init__.py └── test_datasets │ └── test_transforms │ └── __init__.py ├── docs ├── en │ ├── migration.md │ ├── dataset_zoo.md │ ├── advanced_guides │ │ ├── engine.md │ │ ├── models.md │ │ ├── data_flow.md │ │ ├── datasets.md │ │ ├── evaluation.md │ │ └── structures.md │ ├── migration │ │ ├── migration_faq.md │ │ ├── dataset_migration.md │ │ ├── model_migration.md │ │ └── api_and_registry_migration.md │ ├── notes │ │ └── contribution_guide.md │ ├── _static │ │ ├── image │ │ │ └── mmdet-logo.png │ │ └── css │ │ │ └── readthedocs.css │ └── switch_language.md └── zh_cn │ ├── advanced_guides │ ├── datasets.md │ ├── engine.md │ ├── models.md │ ├── data_flow.md │ ├── evaluation.md │ └── structures.md │ ├── migration │ ├── migration_faq.md │ ├── dataset_migration.md │ ├── model_migration.md │ ├── api_and_registry_migration.md │ └── migration.md │ ├── _static │ ├── image │ │ └── mmdet-logo.png │ └── css │ │ └── readthedocs.css │ └── switch_language.md ├── requirements ├── albu.txt ├── mminstall.txt ├── build.txt ├── multimodal.txt ├── tracking.txt ├── optional.txt ├── runtime.txt ├── readthedocs.txt ├── docs.txt └── tests.txt ├── demo ├── demo.jpg ├── demo.mp4 ├── demo_mot.mp4 └── large_image.jpg ├── resources ├── loss_curve.png ├── mmdet-logo.png ├── data_pipeline.png ├── zhihu_qrcode.jpg ├── coco_test_12510.jpg ├── miaomiao_qrcode.jpg └── corruptions_sev_3.png ├── requirements.txt ├── configs ├── v3det │ └── v3det_icon.jpg ├── reppoints │ ├── reppoints.png │ ├── reppoints-minmax_r50_fpn-gn_head-gn_1x_coco.py │ ├── reppoints-partial-minmax_r50_fpn-gn_head-gn_1x_coco.py │ ├── reppoints-bbox_r50-center_fpn-gn_head-gn-grid_1x_coco.py │ ├── reppoints-moment_r50_fpn-gn_head-gn_1x_coco.py │ ├── reppoints-moment_r101_fpn-gn_head-gn_2x_coco.py │ └── reppoints-moment_r101-dconv-c3-c5_fpn-gn_head-gn_2x_coco.py ├── glip │ ├── glip_atss_swin-t_c_fpn_dyhead_pretrain_obj365-goldg.py │ ├── glip_atss_swin-t_fpn_dyhead_pretrain_obj365-goldg-cc3m-sub.py │ ├── glip_atss_swin-t_b_fpn_dyhead_pretrain_obj365.py │ ├── odinw │ │ ├── glip_atss_swin-t_bc_fpn_dyhead_pretrain_odinw13.py │ │ └── glip_atss_swin-t_bc_fpn_dyhead_pretrain_odinw35.py │ ├── lvis │ │ ├── glip_atss_swin-t_bc_fpn_dyhead_pretrain_zeroshot_lvis.py │ │ ├── glip_atss_swin-t_bc_fpn_dyhead_pretrain_zeroshot_mini-lvis.py │ │ ├── glip_atss_swin-l_fpn_dyhead_pretrain_zeroshot_lvis.py │ │ └── glip_atss_swin-l_fpn_dyhead_pretrain_zeroshot_mini-lvis.py │ ├── glip_atss_swin-t_fpn_dyhead_16xb2_ms-2x_funtune_coco.py │ ├── glip_atss_swin-t_c_fpn_dyhead_16xb2_ms-2x_funtune_coco.py │ ├── glip_atss_swin-l_fpn_dyhead_pretrain_mixeddata.py │ └── glip_atss_swin-t_b_fpn_dyhead_16xb2_ms-2x_funtune_coco.py ├── faster_rcnn │ ├── faster-rcnn_r50_fpn_ms-3x_coco.py │ ├── faster-rcnn_r50_fpn_ohem_1x_coco.py │ ├── faster-rcnn_r50_fpn_1x_coco.py │ ├── faster-rcnn_r50_fpn_2x_coco.py │ ├── faster-rcnn_r50-caffe_c4-1x_coco.py │ ├── faster-rcnn_r50-caffe-dc5_1x_coco.py │ ├── faster-rcnn_r101_fpn_1x_coco.py │ ├── faster-rcnn_r101_fpn_2x_coco.py │ ├── faster-rcnn_r50_fpn_iou_1x_coco.py │ ├── faster-rcnn_r101_fpn_ms-3x_coco.py │ ├── faster-rcnn_r50_fpn_ciou_1x_coco.py │ ├── faster-rcnn_r50_fpn_giou_1x_coco.py │ ├── faster-rcnn_r50_fpn_bounded-iou_1x_coco.py │ ├── faster-rcnn_r50_fpn_amp-1x_coco.py │ ├── faster-rcnn_r101-caffe_fpn_1x_coco.py │ ├── faster-rcnn_r101_fpn_8xb8-amp-lsj-200e_coco.py │ ├── faster-rcnn_r18_fpn_8xb8-amp-lsj-200e_coco.py │ ├── faster-rcnn_r101-caffe_fpn_ms-3x_coco.py │ ├── faster-rcnn_r50_fpn_soft-nms_1x_coco.py │ ├── faster-rcnn_x101-32x4d_fpn_1x_coco.py │ ├── faster-rcnn_x101-32x4d_fpn_2x_coco.py │ ├── faster-rcnn_x101-64x4d_fpn_1x_coco.py │ └── faster-rcnn_x101-64x4d_fpn_2x_coco.py ├── tood │ ├── tood_r50_fpn_anchor-based_1x_coco.py │ ├── tood_r101_fpn_ms-2x_coco.py │ ├── tood_r101-dconv-c3-c5_fpn_ms-2x_coco.py │ └── tood_x101-64x4d-dconv-c4-c5_fpn_ms-2x_coco.py ├── deformable_detr │ ├── deformable-detr-refine_r50_16xb2-50e_coco.py │ └── deformable-detr-refine-twostage_r50_16xb2-50e_coco.py ├── centernet │ ├── centernet_r18_8xb16-crop512-140e_coco.py │ ├── centernet-update_r101_fpn_8xb8-amp-lsj-200e_coco.py │ └── centernet-update_r18_fpn_8xb8-amp-lsj-200e_coco.py ├── mask_rcnn │ ├── mask-rcnn_r50_fpn_ms-poly-3x_coco.py │ ├── mask-rcnn_r50_fpn_amp-1x_coco.py │ ├── mask-rcnn_r50_fpn_1x_coco.py │ ├── mask-rcnn_r50_fpn_2x_coco.py │ ├── mask-rcnn_r50-caffe-c4_1x_coco.py │ ├── mask-rcnn_r101_fpn_1x_coco.py │ ├── mask-rcnn_r101_fpn_2x_coco.py │ ├── mask-rcnn_r101-caffe_fpn_1x_coco.py │ ├── mask-rcnn_r101_fpn_8xb8-amp-lsj-200e_coco.py │ ├── mask-rcnn_r18_fpn_8xb8-amp-lsj-200e_coco.py │ ├── mask-rcnn_r101_fpn_ms-poly-3x_coco.py │ ├── mask-rcnn_r50-caffe_fpn_ms-poly-2x_coco.py │ ├── mask-rcnn_r50-caffe_fpn_ms-poly-3x_coco.py │ ├── mask-rcnn_r50-caffe_fpn_1x_coco.py │ ├── mask-rcnn_x101-32x4d_fpn_1x_coco.py │ ├── mask-rcnn_x101-32x4d_fpn_2x_coco.py │ ├── mask-rcnn_x101-64x4d_fpn_1x_coco.py │ └── mask-rcnn_x101-64x4d_fpn_2x_coco.py ├── cascade_rcnn │ ├── cascade-mask-rcnn_r50_fpn_ms-3x_coco.py │ ├── cascade-rcnn_r50_fpn_1x_coco.py │ ├── cascade-rcnn_r50_fpn_20e_coco.py │ ├── cascade-mask-rcnn_r50_fpn_1x_coco.py │ ├── cascade-mask-rcnn_r50_fpn_20e_coco.py │ ├── cascade-rcnn_r101_fpn_1x_coco.py │ ├── cascade-rcnn_r101_fpn_20e_coco.py │ ├── cascade-mask-rcnn_r101_fpn_1x_coco.py │ ├── cascade-mask-rcnn_r101_fpn_20e_coco.py │ ├── cascade-mask-rcnn_r101_fpn_ms-3x_coco.py │ ├── cascade-rcnn_r101-caffe_fpn_1x_coco.py │ ├── cascade-rcnn_r101_fpn_8xb8-amp-lsj-200e_coco.py │ ├── cascade-mask-rcnn_r101-caffe_fpn_1x_coco.py │ ├── cascade-mask-rcnn_r101-caffe_fpn_ms-3x_coco.py │ ├── cascade-rcnn_r18_fpn_8xb8-amp-lsj-200e_coco.py │ ├── cascade-rcnn_x101-32x4d_fpn_1x_coco.py │ ├── cascade-mask-rcnn_r50-caffe_fpn_1x_coco.py │ ├── cascade-rcnn_x101-32x4d_fpn_20e_coco.py │ ├── cascade-mask-rcnn_x101-32x4d_fpn_1x_coco.py │ ├── cascade-mask-rcnn_x101-64x4d_fpn_1x_coco.py │ └── cascade-mask-rcnn_x101-32x4d_fpn_20e_coco.py ├── yolo │ └── yolov3_d53_8xb8-amp-ms-608-273e_coco.py ├── crowddet │ └── crowddet-rcnn_refine_r50_fpn_8xb2-30e_crowdhuman.py ├── grounding_dino │ ├── dod │ │ ├── grounding_dino_swin-b_pretrain_zeroshot_parallel_dod.py │ │ ├── grounding_dino_swin-t_pretrain_zeroshot_parallel_dod.py │ │ └── grounding_dino_swin-b_pretrain_zeroshot_concat_dod.py │ ├── lvis │ │ ├── grounding_dino_swin-b_pretrain_zeroshot_lvis.py │ │ └── grounding_dino_swin-b_pretrain_zeroshot_mini-lvis.py │ ├── refcoco │ │ └── grounding_dino_swin-b_pretrain_zeroshot_refexp.py │ └── grounding_dino_swin-b_pretrain_mixeddata.py ├── mm_grounding_dino │ └── dod │ │ └── grounding_dino_swin-t_pretrain_zeroshot_parallel_dod.py ├── fcos │ ├── fcos_r50-caffe_fpn_gn-head-center_1x_coco.py │ ├── fcos_r50-caffe_fpn_gn-head_4xb4-1x_coco.py │ ├── fcos_r101-caffe_fpn_gn-head-1x_coco.py │ ├── fcos_r101_fpn_gn-head-center-normbbox-centeronreg-giou_8xb8-amp-lsj-200e_coco.py │ └── fcos_r18_fpn_gn-head-center-normbbox-centeronreg-giou_8xb8-amp-lsj-200e_coco.py ├── gcnet │ ├── mask-rcnn_r50-syncbn_fpn_1x_coco.py │ ├── mask-rcnn_r101-syncbn_fpn_1x_coco.py │ ├── mask-rcnn_x101-32x4d-syncbn_fpn_1x_coco.py │ ├── cascade-mask-rcnn_x101-32x4d-syncbn_fpn_1x_coco.py │ ├── cascade-mask-rcnn_x101-32x4d-syncbn-dconv-c3-c5_fpn_1x_coco.py │ ├── mask-rcnn_r50-gcb-r4-c3-c5_fpn_1x_coco.py │ ├── mask-rcnn_r101-gcb-r16-c3-c5_fpn_1x_coco.py │ ├── mask-rcnn_r101-gcb-r4-c3-c5_fpn_1x_coco.py │ ├── mask-rcnn_r50-gcb-r16-c3-c5_fpn_1x_coco.py │ ├── mask-rcnn_r101-syncbn-gcb-r4-c3-c5_fpn_1x_coco.py │ ├── mask-rcnn_r50-syncbn-gcb-r16-c3-c5_fpn_1x_coco.py │ ├── mask-rcnn_r50-syncbn-gcb-r4-c3-c5_fpn_1x_coco.py │ ├── mask-rcnn_r101-syncbn-gcb-r16-c3-c5_fpn_1x_coco.py │ ├── mask-rcnn_x101-32x4d-syncbn-gcb-r16-c3-c5_fpn_1x_coco.py │ ├── mask-rcnn_x101-32x4d-syncbn-gcb-r4-c3-c5_fpn_1x_coco.py │ ├── cascade-mask-rcnn_x101-32x4d-syncbn-r16-gcb-c3-c5_fpn_1x_coco.py │ ├── cascade-mask-rcnn_x101-32x4d-syncbn-r4-gcb-c3-c5_fpn_1x_coco.py │ ├── cascade-mask-rcnn_x101-32x4d-syncbn-dconv-c3-c5-r16-gcb-c3-c5_fpn_1x_coco.py │ └── cascade-mask-rcnn_x101-32x4d-syncbn-dconv-c3-c5-r4-gcb-c3-c5_fpn_1x_coco.py ├── fpg │ ├── retinanet_r50_fpg-chn128_crop640_50e_coco.py │ ├── faster-rcnn_r50_fpg-chn128_crop640-50e_coco.py │ └── mask-rcnn_r50_fpg-chn128_crop640-50e_coco.py ├── rtmdet │ ├── classification │ │ ├── cspnext-l_8xb256-rsb-a1-600e_in1k.py │ │ ├── cspnext-m_8xb256-rsb-a1-600e_in1k.py │ │ ├── cspnext-x_8xb256-rsb-a1-600e_in1k.py │ │ └── cspnext-tiny_8xb256-rsb-a1-600e_in1k.py │ ├── rtmdet_m_8xb32-300e_coco.py │ ├── rtmdet-ins_m_8xb32-300e_coco.py │ └── rtmdet_x_8xb32-300e_coco.py ├── solov2 │ ├── solov2_r101_fpn_ms-3x_coco.py │ ├── solov2-light_r18_fpn_ms-3x_coco.py │ └── solov2-light_r34_fpn_ms-3x_coco.py ├── swin │ ├── mask-rcnn_swin-t-p4-w7_fpn_amp-ms-crop-3x_coco.py │ └── mask-rcnn_swin-s-p4-w7_fpn_amp-ms-crop-3x_coco.py ├── atss │ ├── atss_r101_fpn_1x_coco.py │ ├── atss_r101_fpn_8xb8-amp-lsj-200e_coco.py │ └── atss_r18_fpn_8xb8-amp-lsj-200e_coco.py ├── fsaf │ ├── fsaf_r101_fpn_1x_coco.py │ └── fsaf_x101-64x4d_fpn_1x_coco.py ├── htc │ ├── htc_r101_fpn_20e_coco.py │ ├── htc_x101-64x4d_fpn_16xb1-20e_coco.py │ └── htc_r50_fpn_20e_coco.py ├── paa │ ├── paa_r101_fpn_1x_coco.py │ ├── paa_r101_fpn_ms-3x_coco.py │ ├── paa_r101_fpn_2x_coco.py │ ├── paa_r50_fpn_1.5x_coco.py │ └── paa_r50_fpn_2x_coco.py ├── rpn │ ├── rpn_r101_fpn_1x_coco.py │ ├── rpn_r101_fpn_2x_coco.py │ ├── rpn_r101-caffe_fpn_1x_coco.py │ ├── rpn_r50-caffe-c4_1x_coco.py │ ├── rpn_x101-32x4d_fpn_1x_coco.py │ ├── rpn_x101-32x4d_fpn_2x_coco.py │ ├── rpn_x101-64x4d_fpn_1x_coco.py │ ├── rpn_x101-64x4d_fpn_2x_coco.py │ └── rpn_r50_fpn_2x_coco.py ├── scnet │ ├── scnet_r101_fpn_20e_coco.py │ ├── scnet_x101-64x4d_fpn_8xb1-20e_coco.py │ ├── scnet_r50_fpn_20e_coco.py │ └── scnet_x101-64x4d_fpn_20e_coco.py ├── vfnet │ ├── vfnet_r101_fpn_1x_coco.py │ ├── vfnet_r101_fpn_ms-2x_coco.py │ └── vfnet_r50-mdconv-c3-c5_fpn_ms-2x_coco.py ├── retinanet │ ├── retinanet_r50_fpn_ms-640-800-3x_coco.py │ ├── retinanet_r101_fpn_1x_coco.py │ ├── retinanet_r101_fpn_2x_coco.py │ ├── retinanet_r50_fpn_amp-1x_coco.py │ ├── retinanet_r101-caffe_fpn_1x_coco.py │ ├── retinanet_r101_fpn_8xb8-amp-lsj-200e_coco.py │ ├── retinanet_r18_fpn_8xb8-amp-lsj-200e_coco.py │ ├── retinanet_r101-caffe_fpn_ms-3x_coco.py │ ├── retinanet_r50_fpn_1x_coco.py │ ├── retinanet_r101_fpn_ms-640-800-3x_coco.py │ ├── retinanet_x101-64x4d_fpn_ms-640-800-3x_coco.py │ ├── retinanet_r50-caffe_fpn_ms-2x_coco.py │ ├── retinanet_r50-caffe_fpn_ms-3x_coco.py │ ├── retinanet_x101-32x4d_fpn_1x_coco.py │ ├── retinanet_x101-32x4d_fpn_2x_coco.py │ ├── retinanet_x101-64x4d_fpn_1x_coco.py │ └── retinanet_x101-64x4d_fpn_2x_coco.py ├── detr │ ├── detr_r101_8xb2-500e_coco.py │ └── detr_r18_8xb2-500e_coco.py ├── fast_rcnn │ ├── fast-rcnn_r101_fpn_1x_coco.py │ ├── fast-rcnn_r101_fpn_2x_coco.py │ ├── fast-rcnn_r101-caffe_fpn_1x_coco.py │ └── fast-rcnn_r50_fpn_2x_coco.py ├── yolact │ └── yolact_r101_1xb8-55e_coco.py ├── foveabox │ ├── fovea_r101_fpn_4xb4-1x_coco.py │ ├── fovea_r101_fpn_4xb4-2x_coco.py │ └── fovea_r50_fpn_4xb4-2x_coco.py ├── free_anchor │ ├── freeanchor_r101_fpn_1x_coco.py │ └── freeanchor_x101-32x4d_fpn_1x_coco.py ├── ghm │ ├── retinanet_r101_fpn_ghm-1x_coco.py │ ├── retinanet_x101-32x4d_fpn_ghm-1x_coco.py │ └── retinanet_x101-64x4d_fpn_ghm-1x_coco.py ├── openimages │ ├── faster-rcnn_r50_fpn_32xb2-cas-1x_openimages.py │ └── faster-rcnn_r50_fpn_32xb2-cas-1x_openimages-challenge.py ├── pafpn │ └── faster-rcnn_r50_pafpn_1x_coco.py ├── panoptic_fpn │ ├── panoptic-fpn_r101_fpn_1x_coco.py │ └── panoptic-fpn_r101_fpn_ms-3x_coco.py ├── dcn │ ├── mask-rcnn_r50-dconv-c3-c5_fpn_1x_coco.py │ ├── faster-rcnn_r50-dconv-c3-c5_fpn_1x_coco.py │ ├── mask-rcnn_r101-dconv-c3-c5_fpn_1x_coco.py │ ├── cascade-rcnn_r101-dconv-c3-c5_fpn_1x_coco.py │ ├── cascade-rcnn_r50-dconv-c3-c5_fpn_1x_coco.py │ ├── faster-rcnn_r101-dconv-c3-c5_fpn_1x_coco.py │ ├── cascade-mask-rcnn_r101-dconv-c3-c5_fpn_1x_coco.py │ ├── cascade-mask-rcnn_r50-dconv-c3-c5_fpn_1x_coco.py │ ├── cascade-mask-rcnn_x101-32x4d-dconv-c3-c5_fpn_1x_coco.py │ ├── mask-rcnn_r50-dconv-c3-c5_fpn_amp-1x_coco.py │ └── faster-rcnn_r50_fpn_dpool_1x_coco.py ├── solo │ ├── solo_r101_fpn_8xb8-lsj-200e_coco.py │ └── solo_r18_fpn_8xb8-lsj-200e_coco.py ├── dcnv2 │ ├── mask-rcnn_r50-mdconv-c3-c5_fpn_1x_coco.py │ ├── faster-rcnn_r50-mdconv-c3-c5_fpn_1x_coco.py │ ├── faster-rcnn_r50-mdconv-group4-c3-c5_fpn_1x_coco.py │ ├── mask-rcnn_r50-mdconv-c3-c5_fpn_amp-1x_coco.py │ └── faster-rcnn_r50_fpn_mdpool_1x_coco.py ├── gn+ws │ ├── faster-rcnn_r101_fpn_gn-ws-all_1x_coco.py │ ├── mask-rcnn_r101_fpn_gn-ws-all_2x_coco.py │ ├── mask-rcnn_r101_fpn_gn-ws-all_20-23-24e_coco.py │ ├── mask-rcnn_r50_fpn_gn-ws-all_20-23-24e_coco.py │ └── mask-rcnn_x50-32x4d_fpn_gn-ws-all_20-23-24e_coco.py ├── libra_rcnn │ ├── libra-faster-rcnn_r101_fpn_1x_coco.py │ └── libra-faster-rcnn_x101-64x4d_fpn_1x_coco.py ├── pisa │ ├── ssd300_pisa_coco.py │ ├── ssd512_pisa_coco.py │ ├── retinanet-r50_fpn_pisa_1x_coco.py │ └── retinanet_x101-32x4d_fpn_pisa_1x_coco.py ├── grid_rcnn │ ├── grid-rcnn_r101_fpn_gn-head_2x_coco.py │ ├── grid-rcnn_x101-32x4d_fpn_gn-head_2x_coco.py │ └── grid-rcnn_x101-64x4d_fpn_gn-head_2x_coco.py ├── instaboost │ ├── mask-rcnn_r101_fpn_instaboost-4x_coco.py │ └── cascade-mask-rcnn_r101_fpn_instaboost-4x_coco.py ├── mask2former │ ├── mask2former_r101_8xb2-lsj-50e_coco.py │ ├── mask2former_r101_8xb2-lsj-50e_coco-panoptic.py │ └── mask2former_swin-b-p4-w12-384-in21k_8xb2-lsj-50e_coco-panoptic.py ├── boxinst │ └── boxinst_r101_fpn_ms-90k_coco.py ├── gn │ ├── mask-rcnn_r101_fpn_gn-all_2x_coco.py │ ├── mask-rcnn_r101_fpn_gn-all_3x_coco.py │ ├── mask-rcnn_r50_fpn_gn-all_3x_coco.py │ └── mask-rcnn_r50-contrib_fpn_gn-all_3x_coco.py ├── lvis │ ├── mask-rcnn_r101_fpn_sample1e-3_ms-1x_lvis-v1.py │ ├── mask-rcnn_r101_fpn_sample1e-3_ms-2x_lvis-v0.5.py │ ├── mask-rcnn_r50_fpn_sample1e-3_ms-1x_lvis-v1.py │ └── mask-rcnn_r50_fpn_sample1e-3_ms-2x_lvis-v0.5.py ├── ms_rcnn │ ├── ms-rcnn_r101-caffe_fpn_1x_coco.py │ ├── ms-rcnn_x101-32x4d_fpn_1x_coco.py │ └── ms-rcnn_x101-64x4d_fpn_1x_coco.py ├── queryinst │ ├── queryinst_r101_fpn_ms-480-800-3x_coco.py │ └── queryinst_r101_fpn_300-proposals_crop-ms-480-800-3x_coco.py ├── strong_baselines │ ├── mask-rcnn_r50_fpn_rpn-2conv_4conv1fc_syncbn-all_amp-lsj-100e_coco.py │ ├── mask-rcnn_r50-caffe_fpn_rpn-2conv_4conv1fc_syncbn-all_amp-lsj-100e_coco.py │ └── mask-rcnn_r50_fpn_rpn-2conv_4conv1fc_syncbn-all_lsj-50e_coco.py ├── pvt │ ├── retinanet_pvt-s_fpn_1x_coco.py │ ├── retinanet_pvt-m_fpn_1x_coco.py │ ├── retinanet_pvtv2-b1_fpn_1x_coco.py │ ├── retinanet_pvtv2-b2_fpn_1x_coco.py │ ├── retinanet_pvtv2-b3_fpn_1x_coco.py │ └── retinanet_pvt-l_fpn_1x_coco.py ├── seesaw_loss │ ├── mask-rcnn_r50_fpn_seesaw-loss-normed-mask_random-ms-2x_lvis-v1.py │ ├── mask-rcnn_r50_fpn_seesaw-loss-normed-mask_sample1e-3-ms-2x_lvis-v1.py │ ├── mask-rcnn_r101_fpn_seesaw-loss_random-ms-2x_lvis-v1.py │ ├── mask-rcnn_r101_fpn_seesaw-loss_sample1e-3-ms-2x_lvis-v1.py │ ├── cascade-mask-rcnn_r101_fpn_seesaw-loss-normed-mask_random-ms-2x_lvis-v1.py │ ├── cascade-mask-rcnn_r101_fpn_seesaw-loss-normed-mask_sample1e-3-ms-2x_lvis-v1.py │ ├── mask-rcnn_r101_fpn_seesaw-loss-normed-mask_random-ms-2x_lvis-v1.py │ └── mask-rcnn_r101_fpn_seesaw-loss-normed-mask_sample1e-3-ms-2x_lvis-v1.py ├── sparse_rcnn │ ├── sparse-rcnn_r101_fpn_ms-480-800-3x_coco.py │ └── sparse-rcnn_r101_fpn_300-proposals_crop-ms-480-800-3x_coco.py ├── bytetrack │ ├── yolox_x_8xb4-amp-80e_crowdhuman-mot17halftrain_test-mot17halfval.py │ ├── bytetrack_yolox_x_8xb4-amp-80e_crowdhuman-mot20train_test-mot20test.py │ └── bytetrack_yolox_x_8xb4-amp-80e_crowdhuman-mot17halftrain_test-mot17halfval.py ├── detectors │ ├── htc_r50-sac_1x_coco.py │ └── cascade-rcnn_r50-sac_1x_coco.py ├── guided_anchoring │ ├── ga-retinanet_r101-caffe_fpn_1x_coco.py │ ├── ga-faster-rcnn_r101-caffe_fpn_1x_coco.py │ ├── ga-rpn_r101-caffe_fpn_1x_coco.py │ ├── ga-rpn_x101-32x4d_fpn_1x_coco.py │ ├── ga-rpn_x101-64x4d_fpn_1x_coco.py │ ├── ga-retinanet_x101-32x4d_fpn_1x_coco.py │ ├── ga-retinanet_x101-64x4d_fpn_1x_coco.py │ ├── ga-faster-rcnn_x101-32x4d_fpn_1x_coco.py │ └── ga-faster-rcnn_x101-64x4d_fpn_1x_coco.py ├── yolox │ ├── yolox_m_8xb8-300e_coco.py │ ├── yolox_l_8xb8-300e_coco.py │ ├── yolox_x_8xb8-300e_coco.py │ └── yolox_nano_8xb8-300e_coco.py ├── resnest │ ├── mask-rcnn_s101_fpn_syncbn-backbone+head_ms-1x_coco.py │ ├── cascade-mask-rcnn_s101_fpn_syncbn-backbone+head_ms-1x_coco.py │ ├── cascade-rcnn_s101_fpn_syncbn-backbone+head_ms-range-1x_coco.py │ └── faster-rcnn_s101_fpn_syncbn-backbone+head_ms-range-1x_coco.py ├── reid │ ├── reid_r50_8xb32-6e_mot15train80_test-mot15val20.py │ ├── reid_r50_8xb32-6e_mot16train80_test-mot16val20.py │ └── reid_r50_8xb32-6e_mot20train80_test-mot20val20.py ├── res2net │ ├── htc_res2net-101_fpn_20e_coco.py │ ├── mask-rcnn_res2net-101_fpn_2x_coco.py │ ├── faster-rcnn_res2net-101_fpn_2x_coco.py │ ├── cascade-rcnn_res2net-101_fpn_20e_coco.py │ └── cascade-mask-rcnn_res2net-101_fpn_20e_coco.py ├── cornernet │ ├── cornernet_hourglass104_32xb3-210e-mstest_coco.py │ └── cornernet_hourglass104_10xb5-crop511-210e-mstest_coco.py ├── regnet │ ├── mask-rcnn_regnetx-3.2GF-mdconv-c3-c5_fpn_1x_coco.py │ └── faster-rcnn_regnetx-3.2GF_fpn_2x_coco.py ├── dino │ ├── dino-4scale_r50_8xb2-24e_coco.py │ ├── dino-4scale_r50_8xb2-36e_coco.py │ └── dino-5scale_swin-l_8xb2-36e_coco.py ├── wider_face │ └── retinanet_r50_fpn_1x_widerface.py ├── hrnet │ ├── htc_hrnetv2p-w40_28e_coco.py │ ├── mask-rcnn_hrnetv2p-w18-2x_coco.py │ ├── mask-rcnn_hrnetv2p-w32-2x_coco.py │ ├── mask-rcnn_hrnetv2p-w40-2x_coco.py │ ├── faster-rcnn_hrnetv2p-w18-2x_coco.py │ ├── faster-rcnn_hrnetv2p-w32_2x_coco.py │ ├── faster-rcnn_hrnetv2p-w40_2x_coco.py │ ├── htc_x101-64x4d_fpn_16xb1-28e_coco.py │ ├── fcos_hrnetv2p-w18-gn-head_4xb4-2x_coco.py │ ├── fcos_hrnetv2p-w32-gn-head_4xb4-2x_coco.py │ ├── htc_hrnetv2p-w18_20e_coco.py │ ├── mask-rcnn_hrnetv2p-w18-1x_coco.py │ ├── fcos_hrnetv2p-w18-gn-head_4xb4-1x_coco.py │ ├── htc_hrnetv2p-w40_20e_coco.py │ └── faster-rcnn_hrnetv2p-w18-1x_coco.py ├── gfl │ └── gfl_r101_fpn_ms-2x_coco.py ├── common │ ├── lsj-200e_coco-detection.py │ └── lsj-200e_coco-instance.py ├── empirical_attention │ ├── faster-rcnn_r50-attn0010_fpn_1x_coco.py │ └── faster-rcnn_r50-attn1111_fpn_1x_coco.py ├── qdtrack │ └── qdtrack_faster-rcnn_r50_fpn_8xb2-4e_mot17halftrain_test-mot17halfval.py ├── point_rend │ └── point-rend_r50-caffe_fpn_ms-3x_coco.py ├── selfsup_pretrain │ ├── mask-rcnn_r50-mocov2-pre_fpn_1x_coco.py │ └── mask-rcnn_r50-swav-pre_fpn_1x_coco.py └── sort │ └── faster-rcnn_r50_fpn_8xb2-4e_mot17train_test-mot17train.py ├── mmdet ├── configs │ ├── mask_rcnn │ │ ├── mask_rcnn_r50_fpn_8xb8_amp_lsj_200e_coco.py │ │ └── mask_rcnn_r50_fpn_ms_poly_-3x_coco.py │ ├── dino │ │ ├── dino_4scale_r50_8xb2_24e_coco.py │ │ ├── dino_4scale_r50_8xb2_36e_coco.py │ │ └── dino_5scale_swin_l_8xb2_36e_coco.py │ ├── detr │ │ ├── detr_r101_8xb2_500e_coco.py │ │ └── detr_r18_8xb2_500e_coco.py │ ├── panoptic_fpn │ │ ├── panoptic_fpn_r101_fpn_1x_coco.py │ │ └── panoptic_fpn_r101_fpn_ms_3x_coco.py │ └── deformable_detr │ │ ├── deformable_detr_refine_r50_16xb2_50e_coco.py │ │ └── deformable_detr_refine_twostage_r50_16xb2_50e_coco.py ├── models │ ├── language_models │ │ └── __init__.py │ ├── roi_heads │ │ ├── shared_heads │ │ │ └── __init__.py │ │ └── roi_extractors │ │ │ └── __init__.py │ ├── seg_heads │ │ ├── __init__.py │ │ └── panoptic_fusion_heads │ │ │ └── __init__.py │ ├── vis │ │ └── __init__.py │ ├── reid │ │ └── __init__.py │ ├── detectors │ │ └── scnet.py │ ├── mot │ │ └── __init__.py │ ├── test_time_augs │ │ └── __init__.py │ ├── task_modules │ │ └── tracking │ │ │ └── __init__.py │ └── tracking_heads │ │ └── __init__.py ├── engine │ ├── runner │ │ └── __init__.py │ ├── optimizers │ │ └── __init__.py │ ├── __init__.py │ └── schedulers │ │ └── __init__.py ├── evaluation │ ├── evaluator │ │ └── __init__.py │ └── __init__.py ├── datasets │ └── api_wrappers │ │ └── __init__.py ├── visualization │ └── __init__.py ├── apis │ └── __init__.py └── structures │ └── __init__.py ├── .dev_scripts ├── linter.sh └── covignore.cfg ├── projects ├── HDINO │ └── __init__.py ├── XDecoder │ ├── configs │ │ ├── _base_ │ │ │ ├── xdecoder-tiny_caption.py │ │ │ ├── xdecoder-tiny_ref-seg.py │ │ │ ├── xdecoder-tiny_open-vocab-instance.py │ │ │ └── xdecoder-tiny_open-vocab-panoptic.py │ │ ├── xdecoder-tiny_zeroshot_open-vocab-ref-seg_refcoco.py │ │ ├── xdecoder-tiny_zeroshot_open-vocab-ref-seg_refcoco+.py │ │ └── xdecoder-tiny_zeroshot_open-vocab-ref-seg_refcocog.py │ └── xdecoder │ │ ├── inference │ │ └── __init__.py │ │ └── __init__.py ├── example_project │ ├── dummy │ │ ├── __init__.py │ │ └── dummy_resnet.py │ └── configs │ │ └── faster-rcnn_dummy-resnet_fpn_1x_coco.py ├── RF100-Benchmark │ └── __init__.py ├── example_largemodel │ └── __init__.py ├── Detic_new │ └── configs │ │ ├── detic_centernet2_swin-b_fpn_4x_lvis_coco_in21k.py │ │ ├── detic_centernet2_r50_fpn_4x_lvis-base_boxsup.py │ │ └── detic_centernet2_swin-b_fpn_4x_lvis-base_boxsup.py ├── LabelStudio │ └── readme.md ├── CO-DETR │ └── configs │ │ └── codino │ │ ├── co_dino_5scale_r50_lsj_8xb2_3x_coco.py │ │ ├── co_dino_5scale_swin_l_16xb1_3x_coco.py │ │ └── co_dino_5scale_swin_l_lsj_16xb1_3x_coco.py ├── EfficientDet │ └── efficientdet │ │ └── tensorflow │ │ └── api_wrappers │ │ └── __init__.py ├── AlignDETR │ └── align_detr │ │ └── __init__.py ├── iSAID │ └── configs │ │ └── mask_rcnn_r50_fpn_1x_isaid.py ├── ViTDet │ └── vitdet │ │ └── __init__.py ├── Detic │ └── detic │ │ └── __init__.py ├── SparseInst │ └── sparseinst │ │ └── __init__.py └── DiffusionDet │ └── diffusiondet │ └── __init__.py ├── .github ├── ISSUE_TEMPLATE │ ├── general_questions.md │ └── config.yml └── CONTRIBUTING.md ├── docker └── serve │ ├── config.properties │ └── entrypoint.sh ├── .readthedocs.yml ├── MANIFEST.in ├── .owners.yml ├── CITATION.cff ├── pytest.ini └── tools ├── analysis_tools └── mot │ └── dist_mot_search.sh ├── dataset_converters └── scripts │ ├── preprocess_voc2012.sh │ └── preprocess_voc2007.sh └── dist_train.sh /tests/test_engine/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/test_structures/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/en/migration.md: -------------------------------------------------------------------------------- 1 | # Migration 2 | -------------------------------------------------------------------------------- /docs/en/dataset_zoo.md: -------------------------------------------------------------------------------- 1 | # Dataset Zoo 2 | -------------------------------------------------------------------------------- /tests/test_models/test_layers/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/test_structures/test_bbox/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/en/advanced_guides/engine.md: -------------------------------------------------------------------------------- 1 | # Engine 2 | -------------------------------------------------------------------------------- /docs/en/advanced_guides/models.md: -------------------------------------------------------------------------------- 1 | # Models 2 | -------------------------------------------------------------------------------- /tests/data/custom_dataset/test.txt: -------------------------------------------------------------------------------- 1 | 000001 2 | -------------------------------------------------------------------------------- /tests/test_engine/test_optimizers/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/test_evaluation/test_metrics/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/test_models/test_task_modules/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/en/advanced_guides/data_flow.md: -------------------------------------------------------------------------------- 1 | # Data Flow 2 | -------------------------------------------------------------------------------- /docs/en/advanced_guides/datasets.md: -------------------------------------------------------------------------------- 1 | # Datasets 2 | -------------------------------------------------------------------------------- /docs/zh_cn/advanced_guides/datasets.md: -------------------------------------------------------------------------------- 1 | # 数据集(待更新) 2 | -------------------------------------------------------------------------------- /docs/zh_cn/advanced_guides/engine.md: -------------------------------------------------------------------------------- 1 | # 执行引擎(待更新) 2 | -------------------------------------------------------------------------------- /docs/zh_cn/advanced_guides/models.md: -------------------------------------------------------------------------------- 1 | # 模型(待更新) 2 | -------------------------------------------------------------------------------- /docs/zh_cn/migration/migration_faq.md: -------------------------------------------------------------------------------- 1 | # 迁移 FAQ 2 | -------------------------------------------------------------------------------- /tests/data/WIDERFace/WIDER_train/0--Parade/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/custom_dataset/trainval.txt: -------------------------------------------------------------------------------- 1 | 000001 2 | -------------------------------------------------------------------------------- /docs/en/advanced_guides/evaluation.md: -------------------------------------------------------------------------------- 1 | # Evaluation 2 | -------------------------------------------------------------------------------- /docs/en/advanced_guides/structures.md: -------------------------------------------------------------------------------- 1 | # Structures 2 | -------------------------------------------------------------------------------- /docs/en/migration/migration_faq.md: -------------------------------------------------------------------------------- 1 | # Migration FAQ 2 | -------------------------------------------------------------------------------- /docs/en/notes/contribution_guide.md: -------------------------------------------------------------------------------- 1 | # Contribution 2 | -------------------------------------------------------------------------------- /docs/zh_cn/advanced_guides/data_flow.md: -------------------------------------------------------------------------------- 1 | # 数据流(待更新) 2 | -------------------------------------------------------------------------------- /docs/zh_cn/advanced_guides/evaluation.md: -------------------------------------------------------------------------------- 1 | # 精度评测(待更新) 2 | -------------------------------------------------------------------------------- /docs/zh_cn/advanced_guides/structures.md: -------------------------------------------------------------------------------- 1 | # 数据结构(待更新) 2 | -------------------------------------------------------------------------------- /tests/data/VOCdevkit/VOC2007/ImageSets/Main/test.txt: -------------------------------------------------------------------------------- 1 | 000001 2 | -------------------------------------------------------------------------------- /tests/data/VOCdevkit/VOC2012/ImageSets/Main/test.txt: -------------------------------------------------------------------------------- 1 | 000001 2 | -------------------------------------------------------------------------------- /tests/data/WIDERFace/train.txt: -------------------------------------------------------------------------------- 1 | 0_Parade_marchingband_1_5 2 | -------------------------------------------------------------------------------- /tests/data/VOCdevkit/VOC2007/ImageSets/Main/trainval.txt: -------------------------------------------------------------------------------- 1 | 000001 2 | -------------------------------------------------------------------------------- /tests/data/VOCdevkit/VOC2012/ImageSets/Main/trainval.txt: -------------------------------------------------------------------------------- 1 | 000001 2 | -------------------------------------------------------------------------------- /docs/zh_cn/migration/dataset_migration.md: -------------------------------------------------------------------------------- 1 | # 将数据集从 MMDetection 2.x 迁移至 3.x 2 | -------------------------------------------------------------------------------- /docs/zh_cn/migration/model_migration.md: -------------------------------------------------------------------------------- 1 | # 将模型从 MMDetection 2.x 迁移至 3.x 2 | -------------------------------------------------------------------------------- /requirements/albu.txt: -------------------------------------------------------------------------------- 1 | albumentations>=0.3.2 --no-binary qudida,albumentations 2 | -------------------------------------------------------------------------------- /requirements/mminstall.txt: -------------------------------------------------------------------------------- 1 | mmcv>=2.0.0rc4,<2.2.0 2 | mmengine>=0.7.1,<1.0.0 3 | -------------------------------------------------------------------------------- /demo/demo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmdetection/HEAD/demo/demo.jpg -------------------------------------------------------------------------------- /demo/demo.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmdetection/HEAD/demo/demo.mp4 -------------------------------------------------------------------------------- /docs/en/migration/dataset_migration.md: -------------------------------------------------------------------------------- 1 | # Migrate dataset from MMDetection 2.x to 3.x 2 | -------------------------------------------------------------------------------- /docs/en/migration/model_migration.md: -------------------------------------------------------------------------------- 1 | # Migrate models from MMDetection 2.x to 3.x 2 | -------------------------------------------------------------------------------- /tests/data/OpenImages/annotations/class-descriptions-boxable.csv: -------------------------------------------------------------------------------- 1 | /m/0cmf2,Airplane 2 | -------------------------------------------------------------------------------- /tests/data/OpenImages/challenge2019/cls-label-description.csv: -------------------------------------------------------------------------------- 1 | /m/0cmf2,Airplane,86 2 | -------------------------------------------------------------------------------- /demo/demo_mot.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmdetection/HEAD/demo/demo_mot.mp4 -------------------------------------------------------------------------------- /docs/zh_cn/migration/api_and_registry_migration.md: -------------------------------------------------------------------------------- 1 | # 将 API 和注册器从 MMDetection 2.x 迁移至 3.x 2 | -------------------------------------------------------------------------------- /demo/large_image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmdetection/HEAD/demo/large_image.jpg -------------------------------------------------------------------------------- /tests/data/color.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmdetection/HEAD/tests/data/color.jpg -------------------------------------------------------------------------------- /tests/data/gray.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmdetection/HEAD/tests/data/gray.jpg -------------------------------------------------------------------------------- /tests/test_models/test_task_modules/test_samplers/test_pesudo_sampler.py: -------------------------------------------------------------------------------- 1 | # TODO: follow up 2 | -------------------------------------------------------------------------------- /requirements/build.txt: -------------------------------------------------------------------------------- 1 | # These must be installed before building mmdetection 2 | cython 3 | numpy 4 | -------------------------------------------------------------------------------- /requirements/multimodal.txt: -------------------------------------------------------------------------------- 1 | fairscale 2 | jsonlines 3 | nltk 4 | pycocoevalcap 5 | transformers 6 | -------------------------------------------------------------------------------- /requirements/tracking.txt: -------------------------------------------------------------------------------- 1 | mmpretrain 2 | motmetrics 3 | numpy<1.24.0 4 | scikit-learn 5 | seaborn 6 | -------------------------------------------------------------------------------- /docs/en/migration/api_and_registry_migration.md: -------------------------------------------------------------------------------- 1 | # Migrate API and Registry from MMDetection 2.x to 3.x 2 | -------------------------------------------------------------------------------- /resources/loss_curve.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmdetection/HEAD/resources/loss_curve.png -------------------------------------------------------------------------------- /resources/mmdet-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmdetection/HEAD/resources/mmdet-logo.png -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | -r requirements/build.txt 2 | -r requirements/optional.txt 3 | -r requirements/runtime.txt 4 | -------------------------------------------------------------------------------- /requirements/optional.txt: -------------------------------------------------------------------------------- 1 | cityscapesscripts 2 | emoji 3 | fairscale 4 | imagecorruptions 5 | scikit-learn 6 | -------------------------------------------------------------------------------- /resources/data_pipeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmdetection/HEAD/resources/data_pipeline.png -------------------------------------------------------------------------------- /resources/zhihu_qrcode.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmdetection/HEAD/resources/zhihu_qrcode.jpg -------------------------------------------------------------------------------- /configs/v3det/v3det_icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmdetection/HEAD/configs/v3det/v3det_icon.jpg -------------------------------------------------------------------------------- /resources/coco_test_12510.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmdetection/HEAD/resources/coco_test_12510.jpg -------------------------------------------------------------------------------- /resources/miaomiao_qrcode.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmdetection/HEAD/resources/miaomiao_qrcode.jpg -------------------------------------------------------------------------------- /configs/reppoints/reppoints.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmdetection/HEAD/configs/reppoints/reppoints.png -------------------------------------------------------------------------------- /mmdet/configs/mask_rcnn/mask_rcnn_r50_fpn_8xb8_amp_lsj_200e_coco.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | -------------------------------------------------------------------------------- /requirements/runtime.txt: -------------------------------------------------------------------------------- 1 | matplotlib 2 | numpy 3 | pycocotools 4 | scipy 5 | shapely 6 | six 7 | terminaltables 8 | tqdm 9 | -------------------------------------------------------------------------------- /resources/corruptions_sev_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmdetection/HEAD/resources/corruptions_sev_3.png -------------------------------------------------------------------------------- /tests/data/dsdl_det/config.py: -------------------------------------------------------------------------------- 1 | local = dict( 2 | type='LocalFileReader', 3 | working_dir='local path', 4 | ) 5 | -------------------------------------------------------------------------------- /.dev_scripts/linter.sh: -------------------------------------------------------------------------------- 1 | yapf -r -i mmdet/ configs/ tests/ tools/ 2 | isort -rc mmdet/ configs/ tests/ tools/ 3 | flake8 . 4 | -------------------------------------------------------------------------------- /configs/glip/glip_atss_swin-t_c_fpn_dyhead_pretrain_obj365-goldg.py: -------------------------------------------------------------------------------- 1 | _base_ = './glip_atss_swin-t_b_fpn_dyhead_pretrain_obj365.py' 2 | -------------------------------------------------------------------------------- /docs/en/_static/image/mmdet-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmdetection/HEAD/docs/en/_static/image/mmdet-logo.png -------------------------------------------------------------------------------- /configs/faster_rcnn/faster-rcnn_r50_fpn_ms-3x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = ['../common/ms_3x_coco.py', '../_base_/models/faster-rcnn_r50_fpn.py'] 2 | -------------------------------------------------------------------------------- /docs/zh_cn/_static/image/mmdet-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmdetection/HEAD/docs/zh_cn/_static/image/mmdet-logo.png -------------------------------------------------------------------------------- /requirements/readthedocs.txt: -------------------------------------------------------------------------------- 1 | mmcv>=2.0.0rc4,<2.2.0 2 | mmengine>=0.7.1,<1.0.0 3 | scipy 4 | torch 5 | torchvision 6 | urllib3<2.0.0 7 | -------------------------------------------------------------------------------- /configs/glip/glip_atss_swin-t_fpn_dyhead_pretrain_obj365-goldg-cc3m-sub.py: -------------------------------------------------------------------------------- 1 | _base_ = './glip_atss_swin-t_b_fpn_dyhead_pretrain_obj365.py' 2 | -------------------------------------------------------------------------------- /tests/data/crowdhuman_dataset/id_hw_train.json: -------------------------------------------------------------------------------- 1 | { 2 | "283554,35288000868e92d4": [ 3 | 1356, 4 | 2048 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /projects/HDINO/__init__.py: -------------------------------------------------------------------------------- 1 | from .h_dino import HDINO 2 | from .h_dino_head import HybridDINOHead 3 | 4 | __all__ = ['HDINO', 'HybridDINOHead'] 5 | -------------------------------------------------------------------------------- /tests/data/custom_dataset/images/000001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmdetection/HEAD/tests/data/custom_dataset/images/000001.jpg -------------------------------------------------------------------------------- /configs/tood/tood_r50_fpn_anchor-based_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './tood_r50_fpn_1x_coco.py' 2 | model = dict(bbox_head=dict(anchor_type='anchor_based')) 3 | -------------------------------------------------------------------------------- /mmdet/models/language_models/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .bert import BertModel 3 | 4 | __all__ = ['BertModel'] 5 | -------------------------------------------------------------------------------- /projects/XDecoder/configs/_base_/xdecoder-tiny_caption.py: -------------------------------------------------------------------------------- 1 | _base_ = 'xdecoder-tiny_open-vocab-semseg.py' 2 | 3 | model = dict(head=dict(task='caption')) 4 | -------------------------------------------------------------------------------- /projects/XDecoder/configs/_base_/xdecoder-tiny_ref-seg.py: -------------------------------------------------------------------------------- 1 | _base_ = 'xdecoder-tiny_open-vocab-semseg.py' 2 | 3 | model = dict(head=dict(task='ref-seg')) 4 | -------------------------------------------------------------------------------- /tests/data/OpenImages/annotations/image-metas.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmdetection/HEAD/tests/data/OpenImages/annotations/image-metas.pkl -------------------------------------------------------------------------------- /tests/data/VOCdevkit/VOC2007/JPEGImages/000001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmdetection/HEAD/tests/data/VOCdevkit/VOC2007/JPEGImages/000001.jpg -------------------------------------------------------------------------------- /tests/data/VOCdevkit/VOC2012/JPEGImages/000001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmdetection/HEAD/tests/data/VOCdevkit/VOC2012/JPEGImages/000001.jpg -------------------------------------------------------------------------------- /configs/deformable_detr/deformable-detr-refine_r50_16xb2-50e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = 'deformable-detr_r50_16xb2-50e_coco.py' 2 | model = dict(with_box_refine=True) 3 | -------------------------------------------------------------------------------- /tests/data/OpenImages/annotations/annotations-human-imagelabels-boxable.csv: -------------------------------------------------------------------------------- 1 | ImageID,Source,LabelName,Confidence 2 | 0001eeaf4aed83f9,verification,/m/0cmf2,1 3 | -------------------------------------------------------------------------------- /tests/data/OpenImages/challenge2019/annotations-human-imagelabels-boxable.csv: -------------------------------------------------------------------------------- 1 | ImageID,Source,LabelName,Confidence 2 | 0001eeaf4aed83f9,verification,/m/0cmf2,1 3 | -------------------------------------------------------------------------------- /mmdet/models/roi_heads/shared_heads/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .res_layer import ResLayer 3 | 4 | __all__ = ['ResLayer'] 5 | -------------------------------------------------------------------------------- /tests/data/OpenImages/challenge2019/class_label_tree.np: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-mmlab/mmdetection/HEAD/tests/data/OpenImages/challenge2019/class_label_tree.np -------------------------------------------------------------------------------- /configs/centernet/centernet_r18_8xb16-crop512-140e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './centernet_r18-dcnv2_8xb16-crop512-140e_coco.py' 2 | 3 | model = dict(neck=dict(use_dcn=False)) 4 | -------------------------------------------------------------------------------- /configs/deformable_detr/deformable-detr-refine-twostage_r50_16xb2-50e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = 'deformable-detr-refine_r50_16xb2-50e_coco.py' 2 | model = dict(as_two_stage=True) 3 | -------------------------------------------------------------------------------- /configs/mask_rcnn/mask-rcnn_r50_fpn_ms-poly-3x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../common/ms-poly_3x_coco-instance.py', 3 | '../_base_/models/mask-rcnn_r50_fpn.py' 4 | ] 5 | -------------------------------------------------------------------------------- /mmdet/engine/runner/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .loops import TeacherStudentValLoop 3 | 4 | __all__ = ['TeacherStudentValLoop'] 5 | -------------------------------------------------------------------------------- /projects/example_project/dummy/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .dummy_resnet import DummyResNet 3 | 4 | __all__ = ['DummyResNet'] 5 | -------------------------------------------------------------------------------- /projects/XDecoder/configs/xdecoder-tiny_zeroshot_open-vocab-ref-seg_refcoco.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '_base_/xdecoder-tiny_ref-seg.py', 'mmdet::_base_/datasets/refcoco.py' 3 | ] 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/general_questions.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: General questions 3 | about: Ask general questions to get help 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | --- 8 | -------------------------------------------------------------------------------- /configs/cascade_rcnn/cascade-mask-rcnn_r50_fpn_ms-3x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../common/ms_3x_coco-instance.py', 3 | '../_base_/models/cascade-mask-rcnn_r50_fpn.py' 4 | ] 5 | -------------------------------------------------------------------------------- /configs/faster_rcnn/faster-rcnn_r50_fpn_ohem_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './faster-rcnn_r50_fpn_1x_coco.py' 2 | model = dict(train_cfg=dict(rcnn=dict(sampler=dict(type='OHEMSampler')))) 3 | -------------------------------------------------------------------------------- /configs/glip/glip_atss_swin-t_b_fpn_dyhead_pretrain_obj365.py: -------------------------------------------------------------------------------- 1 | _base_ = './glip_atss_swin-t_a_fpn_dyhead_pretrain_obj365.py' 2 | 3 | model = dict(bbox_head=dict(early_fuse=True)) 4 | -------------------------------------------------------------------------------- /docs/en/switch_language.md: -------------------------------------------------------------------------------- 1 | ## English 2 | 3 | ## 简体中文 4 | -------------------------------------------------------------------------------- /projects/RF100-Benchmark/__init__.py: -------------------------------------------------------------------------------- 1 | from .coco import RF100CocoDataset 2 | from .coco_metric import RF100CocoMetric 3 | 4 | __all__ = ['RF100CocoDataset', 'RF100CocoMetric'] 5 | -------------------------------------------------------------------------------- /projects/XDecoder/configs/xdecoder-tiny_zeroshot_open-vocab-ref-seg_refcoco+.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '_base_/xdecoder-tiny_ref-seg.py', 'mmdet::_base_/datasets/refcoco+.py' 3 | ] 4 | -------------------------------------------------------------------------------- /projects/XDecoder/configs/xdecoder-tiny_zeroshot_open-vocab-ref-seg_refcocog.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '_base_/xdecoder-tiny_ref-seg.py', 'mmdet::_base_/datasets/refcocog.py' 3 | ] 4 | -------------------------------------------------------------------------------- /projects/example_largemodel/__init__.py: -------------------------------------------------------------------------------- 1 | from .fsdp_utils import checkpoint_check_fn, layer_auto_wrap_policy 2 | 3 | __all__ = ['checkpoint_check_fn', 'layer_auto_wrap_policy'] 4 | -------------------------------------------------------------------------------- /configs/reppoints/reppoints-minmax_r50_fpn-gn_head-gn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './reppoints-moment_r50_fpn-gn_head-gn_1x_coco.py' 2 | model = dict(bbox_head=dict(transform_method='minmax')) 3 | -------------------------------------------------------------------------------- /docs/zh_cn/switch_language.md: -------------------------------------------------------------------------------- 1 | ## English 2 | 3 | ## 简体中文 4 | -------------------------------------------------------------------------------- /projects/Detic_new/configs/detic_centernet2_swin-b_fpn_4x_lvis_coco_in21k.py: -------------------------------------------------------------------------------- 1 | # not support training, only for testing 2 | _base_ = './detic_centernet2_swin-b_fpn_4x_lvis_in21k-lvis.py' 3 | -------------------------------------------------------------------------------- /tests/data/OpenImages/challenge2019/challenge-2019-train-detection-bbox.txt: -------------------------------------------------------------------------------- 1 | validation/0001eeaf4aed83f9.jpg 2 | -1 3 | 1 4 | 86 0.022673031 0.07103825 0.9642004999999999 0.80054647 0 5 | -------------------------------------------------------------------------------- /.dev_scripts/covignore.cfg: -------------------------------------------------------------------------------- 1 | # Each line should be the relative path to the root directory 2 | # of this repo. Support regular expression as well. 3 | # For example: 4 | 5 | .*/__init__.py 6 | -------------------------------------------------------------------------------- /configs/glip/odinw/glip_atss_swin-t_bc_fpn_dyhead_pretrain_odinw13.py: -------------------------------------------------------------------------------- 1 | _base_ = './glip_atss_swin-t_a_fpn_dyhead_pretrain_odinw13.py' 2 | 3 | model = dict(bbox_head=dict(early_fuse=True)) 4 | -------------------------------------------------------------------------------- /configs/glip/odinw/glip_atss_swin-t_bc_fpn_dyhead_pretrain_odinw35.py: -------------------------------------------------------------------------------- 1 | _base_ = './glip_atss_swin-t_a_fpn_dyhead_pretrain_odinw35.py' 2 | 3 | model = dict(bbox_head=dict(early_fuse=True)) 4 | -------------------------------------------------------------------------------- /tests/data/OpenImages/annotations/bbox_labels_600_hierarchy.json: -------------------------------------------------------------------------------- 1 | { 2 | "LabelName": "/m/0bl9f", 3 | "Subcategory": [ 4 | { 5 | "LabelName": "/m/0cmf2" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /configs/yolo/yolov3_d53_8xb8-amp-ms-608-273e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './yolov3_d53_8xb8-ms-608-273e_coco.py' 2 | # fp16 settings 3 | optim_wrapper = dict(type='AmpOptimWrapper', loss_scale='dynamic') 4 | -------------------------------------------------------------------------------- /configs/crowddet/crowddet-rcnn_refine_r50_fpn_8xb2-30e_crowdhuman.py: -------------------------------------------------------------------------------- 1 | _base_ = './crowddet-rcnn_r50_fpn_8xb2-30e_crowdhuman.py' 2 | 3 | model = dict(roi_head=dict(bbox_head=dict(with_refine=True))) 4 | -------------------------------------------------------------------------------- /configs/glip/lvis/glip_atss_swin-t_bc_fpn_dyhead_pretrain_zeroshot_lvis.py: -------------------------------------------------------------------------------- 1 | _base_ = './glip_atss_swin-t_a_fpn_dyhead_pretrain_zeroshot_lvis.py' 2 | 3 | model = dict(bbox_head=dict(early_fuse=True)) 4 | -------------------------------------------------------------------------------- /docs/en/_static/css/readthedocs.css: -------------------------------------------------------------------------------- 1 | .header-logo { 2 | background-image: url("../image/mmdet-logo.png"); 3 | background-size: 156px 40px; 4 | height: 40px; 5 | width: 156px; 6 | } 7 | -------------------------------------------------------------------------------- /docs/zh_cn/_static/css/readthedocs.css: -------------------------------------------------------------------------------- 1 | .header-logo { 2 | background-image: url("../image/mmdet-logo.png"); 3 | background-size: 156px 40px; 4 | height: 40px; 5 | width: 156px; 6 | } 7 | -------------------------------------------------------------------------------- /mmdet/evaluation/evaluator/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .multi_datasets_evaluator import MultiDatasetsEvaluator 3 | 4 | __all__ = ['MultiDatasetsEvaluator'] 5 | -------------------------------------------------------------------------------- /projects/XDecoder/configs/_base_/xdecoder-tiny_open-vocab-instance.py: -------------------------------------------------------------------------------- 1 | _base_ = 'xdecoder-tiny_open-vocab-semseg.py' 2 | 3 | model = dict(head=dict(task='instance'), test_cfg=dict(max_per_img=100)) 4 | -------------------------------------------------------------------------------- /configs/grounding_dino/dod/grounding_dino_swin-b_pretrain_zeroshot_parallel_dod.py: -------------------------------------------------------------------------------- 1 | _base_ = 'grounding_dino_swin-b_pretrain_zeroshot_concat_dod.py' 2 | 3 | model = dict(test_cfg=dict(chunked_size=1)) 4 | -------------------------------------------------------------------------------- /configs/grounding_dino/dod/grounding_dino_swin-t_pretrain_zeroshot_parallel_dod.py: -------------------------------------------------------------------------------- 1 | _base_ = 'grounding_dino_swin-t_pretrain_zeroshot_concat_dod.py' 2 | 3 | model = dict(test_cfg=dict(chunked_size=1)) 4 | -------------------------------------------------------------------------------- /configs/mm_grounding_dino/dod/grounding_dino_swin-t_pretrain_zeroshot_parallel_dod.py: -------------------------------------------------------------------------------- 1 | _base_ = 'grounding_dino_swin-t_pretrain_zeroshot_concat_dod.py' 2 | 3 | model = dict(test_cfg=dict(chunked_size=1)) 4 | -------------------------------------------------------------------------------- /configs/reppoints/reppoints-partial-minmax_r50_fpn-gn_head-gn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './reppoints-moment_r50_fpn-gn_head-gn_1x_coco.py' 2 | model = dict(bbox_head=dict(transform_method='partial_minmax')) 3 | -------------------------------------------------------------------------------- /projects/LabelStudio/readme.md: -------------------------------------------------------------------------------- 1 | # Semi-automatic Object Detection Annotation with MMDetection and Label-Studio 2 | 3 | Please read the [Docs](../../docs/en/user_guides/label_studio.md) for more details. 4 | -------------------------------------------------------------------------------- /configs/glip/lvis/glip_atss_swin-t_bc_fpn_dyhead_pretrain_zeroshot_mini-lvis.py: -------------------------------------------------------------------------------- 1 | _base_ = './glip_atss_swin-t_a_fpn_dyhead_pretrain_zeroshot_mini-lvis.py' 2 | 3 | model = dict(bbox_head=dict(early_fuse=True)) 4 | -------------------------------------------------------------------------------- /projects/CO-DETR/configs/codino/co_dino_5scale_r50_lsj_8xb2_3x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = ['co_dino_5scale_r50_lsj_8xb2_1x_coco.py'] 2 | 3 | param_scheduler = [dict(milestones=[30])] 4 | train_cfg = dict(max_epochs=36) 5 | -------------------------------------------------------------------------------- /mmdet/models/seg_heads/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .panoptic_fpn_head import PanopticFPNHead # noqa: F401,F403 3 | from .panoptic_fusion_heads import * # noqa: F401,F403 4 | -------------------------------------------------------------------------------- /tests/test_models/test_backbones/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .utils import check_norm_state, is_block, is_norm 3 | 4 | __all__ = ['is_block', 'is_norm', 'check_norm_state'] 5 | -------------------------------------------------------------------------------- /configs/fcos/fcos_r50-caffe_fpn_gn-head-center_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './fcos_r50-caffe_fpn_gn-head_1x_coco.py' 2 | 3 | # model settings 4 | model = dict(bbox_head=dict(center_sampling=True, center_sample_radius=1.5)) 5 | -------------------------------------------------------------------------------- /configs/mask_rcnn/mask-rcnn_r50_fpn_amp-1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_r50_fpn_1x_coco.py' 2 | 3 | # Enable automatic-mixed-precision training with AmpOptimWrapper. 4 | optim_wrapper = dict(type='AmpOptimWrapper') 5 | -------------------------------------------------------------------------------- /configs/reppoints/reppoints-bbox_r50-center_fpn-gn_head-gn-grid_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './reppoints-moment_r50_fpn-gn_head-gn_1x_coco.py' 2 | model = dict(bbox_head=dict(transform_method='minmax', use_grid_points=True)) 3 | -------------------------------------------------------------------------------- /docker/serve/config.properties: -------------------------------------------------------------------------------- 1 | inference_address=http://0.0.0.0:8080 2 | management_address=http://0.0.0.0:8081 3 | metrics_address=http://0.0.0.0:8082 4 | model_store=/home/model-server/model-store 5 | load_models=all 6 | -------------------------------------------------------------------------------- /mmdet/evaluation/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .evaluator import * # noqa: F401,F403 3 | from .functional import * # noqa: F401,F403 4 | from .metrics import * # noqa: F401,F403 5 | -------------------------------------------------------------------------------- /configs/gcnet/mask-rcnn_r50-syncbn_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../mask_rcnn/mask-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | norm_cfg=dict(type='SyncBN', requires_grad=True), norm_eval=False)) 5 | -------------------------------------------------------------------------------- /projects/XDecoder/configs/_base_/xdecoder-tiny_open-vocab-panoptic.py: -------------------------------------------------------------------------------- 1 | _base_ = 'xdecoder-tiny_open-vocab-semseg.py' 2 | 3 | model = dict( 4 | head=dict(task='panoptic'), test_cfg=dict(mask_thr=0.8, overlap_thr=0.8)) 5 | -------------------------------------------------------------------------------- /configs/fpg/retinanet_r50_fpg-chn128_crop640_50e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = 'retinanet_r50_fpg_crop640_50e_coco.py' 2 | 3 | model = dict( 4 | neck=dict(out_channels=128, inter_channels=128), 5 | bbox_head=dict(in_channels=128)) 6 | -------------------------------------------------------------------------------- /configs/gcnet/mask-rcnn_r101-syncbn_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../mask_rcnn/mask-rcnn_r101_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | norm_cfg=dict(type='SyncBN', requires_grad=True), norm_eval=False)) 5 | -------------------------------------------------------------------------------- /mmdet/models/vis/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .mask2former_vis import Mask2FormerVideo 3 | from .masktrack_rcnn import MaskTrackRCNN 4 | 5 | __all__ = ['Mask2FormerVideo', 'MaskTrackRCNN'] 6 | -------------------------------------------------------------------------------- /projects/EfficientDet/efficientdet/tensorflow/api_wrappers/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .coco_api import COCO, COCOeval, COCOPanoptic 3 | 4 | __all__ = ['COCO', 'COCOeval', 'COCOPanoptic'] 5 | -------------------------------------------------------------------------------- /configs/rtmdet/classification/cspnext-l_8xb256-rsb-a1-600e_in1k.py: -------------------------------------------------------------------------------- 1 | _base_ = './cspnext-s_8xb256-rsb-a1-600e_in1k.py' 2 | 3 | model = dict( 4 | backbone=dict(deepen_factor=1, widen_factor=1), 5 | head=dict(in_channels=1024)) 6 | -------------------------------------------------------------------------------- /configs/solov2/solov2_r101_fpn_ms-3x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './solov2_r50_fpn_ms-3x_coco.py' 2 | 3 | # model settings 4 | model = dict( 5 | backbone=dict( 6 | depth=101, init_cfg=dict(checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | We appreciate all contributions to improve MMDetection. Please refer to [CONTRIBUTING.md](https://github.com/open-mmlab/mmcv/blob/master/CONTRIBUTING.md) in MMCV for more details about the contributing guideline. 2 | -------------------------------------------------------------------------------- /configs/gcnet/mask-rcnn_x101-32x4d-syncbn_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../mask_rcnn/mask-rcnn_x101-32x4d_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | norm_cfg=dict(type='SyncBN', requires_grad=True), norm_eval=False)) 5 | -------------------------------------------------------------------------------- /configs/mask_rcnn/mask-rcnn_r50_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/mask-rcnn_r50_fpn.py', 3 | '../_base_/datasets/coco_instance.py', 4 | '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py' 5 | ] 6 | -------------------------------------------------------------------------------- /configs/mask_rcnn/mask-rcnn_r50_fpn_2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/mask-rcnn_r50_fpn.py', 3 | '../_base_/datasets/coco_instance.py', 4 | '../_base_/schedules/schedule_2x.py', '../_base_/default_runtime.py' 5 | ] 6 | -------------------------------------------------------------------------------- /configs/rtmdet/classification/cspnext-m_8xb256-rsb-a1-600e_in1k.py: -------------------------------------------------------------------------------- 1 | _base_ = './cspnext-s_8xb256-rsb-a1-600e_in1k.py' 2 | 3 | model = dict( 4 | backbone=dict(deepen_factor=0.67, widen_factor=0.75), 5 | head=dict(in_channels=768)) 6 | -------------------------------------------------------------------------------- /configs/rtmdet/classification/cspnext-x_8xb256-rsb-a1-600e_in1k.py: -------------------------------------------------------------------------------- 1 | _base_ = './cspnext-s_8xb256-rsb-a1-600e_in1k.py' 2 | 3 | model = dict( 4 | backbone=dict(deepen_factor=1.33, widen_factor=1.25), 5 | head=dict(in_channels=1280)) 6 | -------------------------------------------------------------------------------- /configs/faster_rcnn/faster-rcnn_r50_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/faster-rcnn_r50_fpn.py', 3 | '../_base_/datasets/coco_detection.py', 4 | '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py' 5 | ] 6 | -------------------------------------------------------------------------------- /configs/faster_rcnn/faster-rcnn_r50_fpn_2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/faster-rcnn_r50_fpn.py', 3 | '../_base_/datasets/coco_detection.py', 4 | '../_base_/schedules/schedule_2x.py', '../_base_/default_runtime.py' 5 | ] 6 | -------------------------------------------------------------------------------- /configs/rtmdet/classification/cspnext-tiny_8xb256-rsb-a1-600e_in1k.py: -------------------------------------------------------------------------------- 1 | _base_ = './cspnext-s_8xb256-rsb-a1-600e_in1k.py' 2 | 3 | model = dict( 4 | backbone=dict(deepen_factor=0.167, widen_factor=0.375), 5 | head=dict(in_channels=384)) 6 | -------------------------------------------------------------------------------- /configs/swin/mask-rcnn_swin-t-p4-w7_fpn_amp-ms-crop-3x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_swin-t-p4-w7_fpn_ms-crop-3x_coco.py' 2 | # Enable automatic-mixed-precision training with AmpOptimWrapper. 3 | optim_wrapper = dict(type='AmpOptimWrapper') 4 | -------------------------------------------------------------------------------- /mmdet/engine/optimizers/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .layer_decay_optimizer_constructor import \ 3 | LearningRateDecayOptimizerConstructor 4 | 5 | __all__ = ['LearningRateDecayOptimizerConstructor'] 6 | -------------------------------------------------------------------------------- /configs/atss/atss_r101_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './atss_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /configs/cascade_rcnn/cascade-rcnn_r50_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/cascade-rcnn_r50_fpn.py', 3 | '../_base_/datasets/coco_detection.py', 4 | '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py' 5 | ] 6 | -------------------------------------------------------------------------------- /configs/cascade_rcnn/cascade-rcnn_r50_fpn_20e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/cascade-rcnn_r50_fpn.py', 3 | '../_base_/datasets/coco_detection.py', 4 | '../_base_/schedules/schedule_20e.py', '../_base_/default_runtime.py' 5 | ] 6 | -------------------------------------------------------------------------------- /configs/fsaf/fsaf_r101_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './fsaf_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /configs/htc/htc_r101_fpn_20e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './htc_r50_fpn_20e_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /configs/mask_rcnn/mask-rcnn_r50-caffe-c4_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/mask-rcnn_r50-caffe-c4.py', 3 | '../_base_/datasets/coco_instance.py', 4 | '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py' 5 | ] 6 | -------------------------------------------------------------------------------- /configs/paa/paa_r101_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './paa_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /configs/rpn/rpn_r101_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './rpn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /configs/rpn/rpn_r101_fpn_2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './rpn_r50_fpn_2x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /configs/faster_rcnn/faster-rcnn_r50-caffe_c4-1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/faster-rcnn_r50-caffe-c4.py', 3 | '../_base_/datasets/coco_detection.py', 4 | '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py' 5 | ] 6 | -------------------------------------------------------------------------------- /configs/glip/glip_atss_swin-t_fpn_dyhead_16xb2_ms-2x_funtune_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './glip_atss_swin-t_b_fpn_dyhead_16xb2_ms-2x_funtune_coco.py' 2 | 3 | load_from = 'https://download.openmmlab.com/mmdetection/v3.0/glip/glip_tiny_mmdet-c24ce662.pth' # noqa 4 | -------------------------------------------------------------------------------- /configs/paa/paa_r101_fpn_ms-3x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './paa_r50_fpn_ms-3x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /configs/scnet/scnet_r101_fpn_20e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './scnet_r50_fpn_20e_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /configs/vfnet/vfnet_r101_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './vfnet_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /mmdet/datasets/api_wrappers/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .coco_api import COCO, COCOeval, COCOPanoptic 3 | from .cocoeval_mp import COCOevalMP 4 | 5 | __all__ = ['COCO', 'COCOeval', 'COCOPanoptic', 'COCOevalMP'] 6 | -------------------------------------------------------------------------------- /configs/cascade_rcnn/cascade-mask-rcnn_r50_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/cascade-mask-rcnn_r50_fpn.py', 3 | '../_base_/datasets/coco_instance.py', 4 | '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py' 5 | ] 6 | -------------------------------------------------------------------------------- /configs/cascade_rcnn/cascade-mask-rcnn_r50_fpn_20e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/cascade-mask-rcnn_r50_fpn.py', 3 | '../_base_/datasets/coco_instance.py', 4 | '../_base_/schedules/schedule_20e.py', '../_base_/default_runtime.py' 5 | ] 6 | -------------------------------------------------------------------------------- /configs/faster_rcnn/faster-rcnn_r50-caffe-dc5_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/faster-rcnn_r50-caffe-dc5.py', 3 | '../_base_/datasets/coco_detection.py', 4 | '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py' 5 | ] 6 | -------------------------------------------------------------------------------- /configs/fcos/fcos_r50-caffe_fpn_gn-head_4xb4-1x_coco.py: -------------------------------------------------------------------------------- 1 | # TODO: Remove this config after benchmarking all related configs 2 | _base_ = 'fcos_r50-caffe_fpn_gn-head_1x_coco.py' 3 | 4 | # dataset settings 5 | train_dataloader = dict(batch_size=4, num_workers=4) 6 | -------------------------------------------------------------------------------- /configs/gcnet/cascade-mask-rcnn_x101-32x4d-syncbn_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../cascade_rcnn/cascade-mask-rcnn_x101-32x4d_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | norm_cfg=dict(type='SyncBN', requires_grad=True), norm_eval=False)) 5 | -------------------------------------------------------------------------------- /configs/glip/glip_atss_swin-t_c_fpn_dyhead_16xb2_ms-2x_funtune_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './glip_atss_swin-t_b_fpn_dyhead_16xb2_ms-2x_funtune_coco.py' 2 | 3 | load_from = 'https://download.openmmlab.com/mmdetection/v3.0/glip/glip_tiny_c_mmdet-2fc427dd.pth' # noqa 4 | -------------------------------------------------------------------------------- /configs/retinanet/retinanet_r50_fpn_ms-640-800-3x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = ['../_base_/models/retinanet_r50_fpn.py', '../common/ms_3x_coco.py'] 2 | # optimizer 3 | optim_wrapper = dict( 4 | optimizer=dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0001)) 5 | -------------------------------------------------------------------------------- /configs/vfnet/vfnet_r101_fpn_ms-2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './vfnet_r50_fpn_ms-2x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /requirements/docs.txt: -------------------------------------------------------------------------------- 1 | docutils==0.16.0 2 | myst-parser 3 | -e git+https://github.com/open-mmlab/pytorch_sphinx_theme.git#egg=pytorch_sphinx_theme 4 | sphinx==4.0.2 5 | sphinx-copybutton 6 | sphinx_markdown_tables 7 | sphinx_rtd_theme==0.5.2 8 | urllib3<2.0.0 9 | -------------------------------------------------------------------------------- /configs/detr/detr_r101_8xb2-500e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './detr_r50_8xb2-500e_coco.py' 2 | 3 | model = dict( 4 | backbone=dict( 5 | depth=101, 6 | init_cfg=dict(type='Pretrained', 7 | checkpoint='torchvision://resnet101'))) 8 | -------------------------------------------------------------------------------- /configs/fast_rcnn/fast-rcnn_r101_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './fast-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /configs/fast_rcnn/fast-rcnn_r101_fpn_2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './fast-rcnn_r50_fpn_2x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /configs/mask_rcnn/mask-rcnn_r101_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /configs/mask_rcnn/mask-rcnn_r101_fpn_2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_r50_fpn_2x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /configs/reppoints/reppoints-moment_r50_fpn-gn_head-gn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './reppoints-moment_r50_fpn_1x_coco.py' 2 | norm_cfg = dict(type='GN', num_groups=32, requires_grad=True) 3 | model = dict(neck=dict(norm_cfg=norm_cfg), bbox_head=dict(norm_cfg=norm_cfg)) 4 | -------------------------------------------------------------------------------- /configs/retinanet/retinanet_r101_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './retinanet_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /configs/retinanet/retinanet_r101_fpn_2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './retinanet_r50_fpn_2x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /configs/tood/tood_r101_fpn_ms-2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './tood_r50_fpn_ms-2x_coco.py' 2 | 3 | model = dict( 4 | backbone=dict( 5 | depth=101, 6 | init_cfg=dict(type='Pretrained', 7 | checkpoint='torchvision://resnet101'))) 8 | -------------------------------------------------------------------------------- /configs/yolact/yolact_r101_1xb8-55e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './yolact_r50_1xb8-55e_coco.py' 2 | 3 | model = dict( 4 | backbone=dict( 5 | depth=101, 6 | init_cfg=dict(type='Pretrained', 7 | checkpoint='torchvision://resnet101'))) 8 | -------------------------------------------------------------------------------- /mmdet/engine/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .hooks import * # noqa: F401, F403 3 | from .optimizers import * # noqa: F401, F403 4 | from .runner import * # noqa: F401, F403 5 | from .schedulers import * # noqa: F401, F403 6 | -------------------------------------------------------------------------------- /projects/AlignDETR/align_detr/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .align_detr_head import AlignDETRHead 3 | from .mixed_hungarian_assigner import MixedHungarianAssigner 4 | 5 | __all__ = ['AlignDETRHead', 'MixedHungarianAssigner'] 6 | -------------------------------------------------------------------------------- /configs/detr/detr_r18_8xb2-500e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './detr_r50_8xb2-500e_coco.py' 2 | 3 | model = dict( 4 | backbone=dict( 5 | depth=18, 6 | init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet18')), 7 | neck=dict(in_channels=[512])) 8 | -------------------------------------------------------------------------------- /configs/foveabox/fovea_r101_fpn_4xb4-1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './fovea_r50_fpn_4xb4-1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /configs/foveabox/fovea_r101_fpn_4xb4-2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './fovea_r50_fpn_4xb4-2x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /configs/free_anchor/freeanchor_r101_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './freeanchor_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /configs/ghm/retinanet_r101_fpn_ghm-1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './retinanet_r50_fpn_ghm-1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /configs/openimages/faster-rcnn_r50_fpn_32xb2-cas-1x_openimages.py: -------------------------------------------------------------------------------- 1 | _base_ = ['faster-rcnn_r50_fpn_32xb2-1x_openimages.py'] 2 | 3 | # Use ClassAwareSampler 4 | train_dataloader = dict( 5 | sampler=dict(_delete_=True, type='ClassAwareSampler', num_sample_class=1)) 6 | -------------------------------------------------------------------------------- /tests/data/OpenImages/annotations/oidv6-train-annotations-bbox.csv: -------------------------------------------------------------------------------- 1 | ImageID,Source,LabelName,Confidence,XMin,XMax,YMin,YMax,IsOccluded,IsTruncated,IsGroupOf,IsDepiction,IsInside 2 | 0001eeaf4aed83f9,xclick,/m/0cmf2,1,0.022673031,0.9642005,0.07103825,0.80054647,0,0,0,0,0 3 | -------------------------------------------------------------------------------- /tests/test_datasets/test_transforms/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .utils import construct_toy_data, create_full_masks, create_random_bboxes 3 | 4 | __all__ = ['create_random_bboxes', 'create_full_masks', 'construct_toy_data'] 5 | -------------------------------------------------------------------------------- /configs/cascade_rcnn/cascade-rcnn_r101_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './cascade-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /configs/faster_rcnn/faster-rcnn_r101_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './faster-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /configs/faster_rcnn/faster-rcnn_r101_fpn_2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './faster-rcnn_r50_fpn_2x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /configs/faster_rcnn/faster-rcnn_r50_fpn_iou_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './faster-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | roi_head=dict( 4 | bbox_head=dict( 5 | reg_decoded_bbox=True, 6 | loss_bbox=dict(type='IoULoss', loss_weight=10.0)))) 7 | -------------------------------------------------------------------------------- /configs/gcnet/cascade-mask-rcnn_x101-32x4d-syncbn-dconv-c3-c5_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../dcn/cascade-mask-rcnn_x101-32x4d-dconv-c3-c5_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | norm_cfg=dict(type='SyncBN', requires_grad=True), norm_eval=False)) 5 | -------------------------------------------------------------------------------- /configs/pafpn/faster-rcnn_r50_pafpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../faster_rcnn/faster-rcnn_r50_fpn_1x_coco.py' 2 | 3 | model = dict( 4 | neck=dict( 5 | type='PAFPN', 6 | in_channels=[256, 512, 1024, 2048], 7 | out_channels=256, 8 | num_outs=5)) 9 | -------------------------------------------------------------------------------- /configs/panoptic_fpn/panoptic-fpn_r101_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './panoptic-fpn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /projects/example_project/configs/faster-rcnn_dummy-resnet_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = ['../../../configs/faster_rcnn/faster-rcnn_r50_fpn_1x_coco.py'] 2 | 3 | custom_imports = dict(imports=['projects.example_project.dummy']) 4 | 5 | _base_.model.backbone.type = 'DummyResNet' 6 | -------------------------------------------------------------------------------- /.readthedocs.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | build: 4 | os: ubuntu-22.04 5 | tools: 6 | python: "3.8" 7 | 8 | formats: 9 | - epub 10 | 11 | python: 12 | install: 13 | - requirements: requirements/docs.txt 14 | - requirements: requirements/readthedocs.txt 15 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include requirements/*.txt 2 | include mmdet/VERSION 3 | include mmdet/.mim/model-index.yml 4 | include mmdet/.mim/dataset-index.yml 5 | include mmdet/.mim/demo/*/* 6 | recursive-include mmdet/.mim/configs *.py *.yml 7 | recursive-include mmdet/.mim/tools *.sh *.py 8 | -------------------------------------------------------------------------------- /configs/cascade_rcnn/cascade-rcnn_r101_fpn_20e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './cascade-rcnn_r50_fpn_20e_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /configs/dcn/mask-rcnn_r50-dconv-c3-c5_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../mask_rcnn/mask-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | dcn=dict(type='DCN', deform_groups=1, fallback_on_stride=False), 5 | stage_with_dcn=(False, True, True, True))) 6 | -------------------------------------------------------------------------------- /configs/faster_rcnn/faster-rcnn_r101_fpn_ms-3x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = 'faster-rcnn_r50_fpn_ms-3x_coco.py' 2 | 3 | model = dict( 4 | backbone=dict( 5 | depth=101, 6 | init_cfg=dict(type='Pretrained', 7 | checkpoint='torchvision://resnet101'))) 8 | -------------------------------------------------------------------------------- /configs/faster_rcnn/faster-rcnn_r50_fpn_ciou_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './faster-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | roi_head=dict( 4 | bbox_head=dict( 5 | reg_decoded_bbox=True, 6 | loss_bbox=dict(type='CIoULoss', loss_weight=12.0)))) 7 | -------------------------------------------------------------------------------- /configs/faster_rcnn/faster-rcnn_r50_fpn_giou_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './faster-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | roi_head=dict( 4 | bbox_head=dict( 5 | reg_decoded_bbox=True, 6 | loss_bbox=dict(type='GIoULoss', loss_weight=10.0)))) 7 | -------------------------------------------------------------------------------- /configs/panoptic_fpn/panoptic-fpn_r101_fpn_ms-3x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './panoptic-fpn_r50_fpn_ms-3x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /configs/solo/solo_r101_fpn_8xb8-lsj-200e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './solo_r50_fpn_8xb8-lsj-200e_coco.py' 2 | 3 | model = dict( 4 | backbone=dict( 5 | depth=101, 6 | init_cfg=dict(type='Pretrained', 7 | checkpoint='torchvision://resnet101'))) 8 | -------------------------------------------------------------------------------- /configs/atss/atss_r101_fpn_8xb8-amp-lsj-200e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './atss_r50_fpn_8xb8-amp-lsj-200e_coco.py' 2 | 3 | model = dict( 4 | backbone=dict( 5 | depth=101, 6 | init_cfg=dict(type='Pretrained', 7 | checkpoint='torchvision://resnet101'))) 8 | -------------------------------------------------------------------------------- /configs/cascade_rcnn/cascade-mask-rcnn_r101_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './cascade-mask-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /configs/dcn/faster-rcnn_r50-dconv-c3-c5_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../faster_rcnn/faster-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | dcn=dict(type='DCN', deform_groups=1, fallback_on_stride=False), 5 | stage_with_dcn=(False, True, True, True))) 6 | -------------------------------------------------------------------------------- /configs/dcn/mask-rcnn_r101-dconv-c3-c5_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../mask_rcnn/mask-rcnn_r101_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | dcn=dict(type='DCN', deform_groups=1, fallback_on_stride=False), 5 | stage_with_dcn=(False, True, True, True))) 6 | -------------------------------------------------------------------------------- /configs/dcnv2/mask-rcnn_r50-mdconv-c3-c5_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../mask_rcnn/mask-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | dcn=dict(type='DCNv2', deform_groups=1, fallback_on_stride=False), 5 | stage_with_dcn=(False, True, True, True))) 6 | -------------------------------------------------------------------------------- /configs/gn+ws/faster-rcnn_r101_fpn_gn-ws-all_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './faster-rcnn_r50_fpn_gn-ws-all_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict( 6 | type='Pretrained', checkpoint='open-mmlab://jhu/resnet101_gn_ws'))) 7 | -------------------------------------------------------------------------------- /configs/gn+ws/mask-rcnn_r101_fpn_gn-ws-all_2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_r50_fpn_gn-ws-all_2x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict( 6 | type='Pretrained', checkpoint='open-mmlab://jhu/resnet101_gn_ws'))) 7 | -------------------------------------------------------------------------------- /configs/libra_rcnn/libra-faster-rcnn_r101_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './libra-faster-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /configs/pisa/ssd300_pisa_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../ssd/ssd300_coco.py' 2 | 3 | model = dict( 4 | bbox_head=dict(type='PISASSDHead'), 5 | train_cfg=dict(isr=dict(k=2., bias=0.), carl=dict(k=1., bias=0.2))) 6 | 7 | optim_wrapper = dict(clip_grad=dict(max_norm=35, norm_type=2)) 8 | -------------------------------------------------------------------------------- /configs/pisa/ssd512_pisa_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../ssd/ssd512_coco.py' 2 | 3 | model = dict( 4 | bbox_head=dict(type='PISASSDHead'), 5 | train_cfg=dict(isr=dict(k=2., bias=0.), carl=dict(k=1., bias=0.2))) 6 | 7 | optim_wrapper = dict(clip_grad=dict(max_norm=35, norm_type=2)) 8 | -------------------------------------------------------------------------------- /configs/rpn/rpn_r101-caffe_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './rpn_r50-caffe_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict( 6 | type='Pretrained', 7 | checkpoint='open-mmlab://detectron2/resnet101_caffe'))) 8 | -------------------------------------------------------------------------------- /docker/serve/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | if [[ "$1" = "serve" ]]; then 5 | shift 1 6 | torchserve --start --ts-config /home/model-server/config.properties 7 | else 8 | eval "$@" 9 | fi 10 | 11 | # prevent docker exit 12 | tail -f /dev/null 13 | -------------------------------------------------------------------------------- /projects/CO-DETR/configs/codino/co_dino_5scale_swin_l_16xb1_3x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = ['co_dino_5scale_swin_l_16xb1_1x_coco.py'] 2 | # model settings 3 | model = dict(backbone=dict(drop_path_rate=0.6)) 4 | 5 | param_scheduler = [dict(milestones=[30])] 6 | train_cfg = dict(max_epochs=36) 7 | -------------------------------------------------------------------------------- /.owners.yml: -------------------------------------------------------------------------------- 1 | assign: 2 | strategy: 3 | # random 4 | daily-shift-based 5 | scedule: 6 | '*/1 * * * *' 7 | assignees: 8 | - Czm369 9 | - hhaAndroid 10 | - jbwang1997 11 | - RangiLyu 12 | - BIGWangYuDong 13 | - chhluo 14 | - ZwwWayne 15 | -------------------------------------------------------------------------------- /configs/cascade_rcnn/cascade-mask-rcnn_r101_fpn_20e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './cascade-mask-rcnn_r50_fpn_20e_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /configs/cascade_rcnn/cascade-mask-rcnn_r101_fpn_ms-3x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './cascade-mask-rcnn_r50_fpn_ms-3x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /configs/dcn/cascade-rcnn_r101-dconv-c3-c5_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../cascade_rcnn/cascade-rcnn_r101_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | dcn=dict(type='DCN', deform_groups=1, fallback_on_stride=False), 5 | stage_with_dcn=(False, True, True, True))) 6 | -------------------------------------------------------------------------------- /configs/dcn/cascade-rcnn_r50-dconv-c3-c5_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../cascade_rcnn/cascade-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | dcn=dict(type='DCN', deform_groups=1, fallback_on_stride=False), 5 | stage_with_dcn=(False, True, True, True))) 6 | -------------------------------------------------------------------------------- /configs/dcn/faster-rcnn_r101-dconv-c3-c5_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../faster_rcnn/faster-rcnn_r101_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | dcn=dict(type='DCN', deform_groups=1, fallback_on_stride=False), 5 | stage_with_dcn=(False, True, True, True))) 6 | -------------------------------------------------------------------------------- /configs/dcnv2/faster-rcnn_r50-mdconv-c3-c5_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../faster_rcnn/faster-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | dcn=dict(type='DCNv2', deform_groups=1, fallback_on_stride=False), 5 | stage_with_dcn=(False, True, True, True))) 6 | -------------------------------------------------------------------------------- /configs/faster_rcnn/faster-rcnn_r50_fpn_bounded-iou_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './faster-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | roi_head=dict( 4 | bbox_head=dict( 5 | reg_decoded_bbox=True, 6 | loss_bbox=dict(type='BoundedIoULoss', loss_weight=10.0)))) 7 | -------------------------------------------------------------------------------- /configs/grid_rcnn/grid-rcnn_r101_fpn_gn-head_2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './grid-rcnn_r50_fpn_gn-head_2x_coco.py' 2 | 3 | model = dict( 4 | backbone=dict( 5 | depth=101, 6 | init_cfg=dict(type='Pretrained', 7 | checkpoint='torchvision://resnet101'))) 8 | -------------------------------------------------------------------------------- /configs/instaboost/mask-rcnn_r101_fpn_instaboost-4x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_r50_fpn_instaboost-4x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /configs/mask2former/mask2former_r101_8xb2-lsj-50e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = ['./mask2former_r50_8xb2-lsj-50e_coco.py'] 2 | 3 | model = dict( 4 | backbone=dict( 5 | depth=101, 6 | init_cfg=dict(type='Pretrained', 7 | checkpoint='torchvision://resnet101'))) 8 | -------------------------------------------------------------------------------- /configs/openimages/faster-rcnn_r50_fpn_32xb2-cas-1x_openimages-challenge.py: -------------------------------------------------------------------------------- 1 | _base_ = ['faster-rcnn_r50_fpn_32xb2-1x_openimages-challenge.py'] 2 | 3 | # Use ClassAwareSampler 4 | train_dataloader = dict( 5 | sampler=dict(_delete_=True, type='ClassAwareSampler', num_sample_class=1)) 6 | -------------------------------------------------------------------------------- /configs/boxinst/boxinst_r101_fpn_ms-90k_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './boxinst_r50_fpn_ms-90k_coco.py' 2 | 3 | # model settings 4 | model = dict( 5 | backbone=dict( 6 | depth=101, 7 | init_cfg=dict(type='Pretrained', 8 | checkpoint='torchvision://resnet101'))) 9 | -------------------------------------------------------------------------------- /configs/gn/mask-rcnn_r101_fpn_gn-all_2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_r50_fpn_gn-all_2x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict( 6 | type='Pretrained', 7 | checkpoint='open-mmlab://detectron/resnet101_gn'))) 8 | -------------------------------------------------------------------------------- /configs/lvis/mask-rcnn_r101_fpn_sample1e-3_ms-1x_lvis-v1.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_r50_fpn_sample1e-3_ms-1x_lvis-v1.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /configs/ms_rcnn/ms-rcnn_r101-caffe_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './ms-rcnn_r50-caffe_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict( 6 | type='Pretrained', 7 | checkpoint='open-mmlab://detectron2/resnet101_caffe'))) 8 | -------------------------------------------------------------------------------- /configs/queryinst/queryinst_r101_fpn_ms-480-800-3x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './queryinst_r50_fpn_ms-480-800-3x_coco.py' 2 | 3 | model = dict( 4 | backbone=dict( 5 | depth=101, 6 | init_cfg=dict(type='Pretrained', 7 | checkpoint='torchvision://resnet101'))) 8 | -------------------------------------------------------------------------------- /configs/retinanet/retinanet_r50_fpn_amp-1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './retinanet_r50_fpn_1x_coco.py' 2 | 3 | # MMEngine support the following two ways, users can choose 4 | # according to convenience 5 | # optim_wrapper = dict(type='AmpOptimWrapper') 6 | _base_.optim_wrapper.type = 'AmpOptimWrapper' 7 | -------------------------------------------------------------------------------- /configs/solov2/solov2-light_r18_fpn_ms-3x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './solov2-light_r50_fpn_ms-3x_coco.py' 2 | 3 | # model settings 4 | model = dict( 5 | backbone=dict( 6 | depth=18, init_cfg=dict(checkpoint='torchvision://resnet18')), 7 | neck=dict(in_channels=[64, 128, 256, 512])) 8 | -------------------------------------------------------------------------------- /configs/solov2/solov2-light_r34_fpn_ms-3x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './solov2-light_r50_fpn_ms-3x_coco.py' 2 | 3 | # model settings 4 | model = dict( 5 | backbone=dict( 6 | depth=34, init_cfg=dict(checkpoint='torchvision://resnet34')), 7 | neck=dict(in_channels=[64, 128, 256, 512])) 8 | -------------------------------------------------------------------------------- /configs/strong_baselines/mask-rcnn_r50_fpn_rpn-2conv_4conv1fc_syncbn-all_amp-lsj-100e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = 'mask-rcnn_r50_fpn_rpn-2conv_4conv1fc_syncbn-all_lsj-100e_coco.py' 2 | 3 | # Enable automatic-mixed-precision training with AmpOptimWrapper. 4 | optim_wrapper = dict(type='AmpOptimWrapper') 5 | -------------------------------------------------------------------------------- /configs/dcn/cascade-mask-rcnn_r101-dconv-c3-c5_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../cascade_rcnn/cascade-mask-rcnn_r101_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | dcn=dict(type='DCN', deform_groups=1, fallback_on_stride=False), 5 | stage_with_dcn=(False, True, True, True))) 6 | -------------------------------------------------------------------------------- /configs/dcn/cascade-mask-rcnn_r50-dconv-c3-c5_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../cascade_rcnn/cascade-mask-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | dcn=dict(type='DCN', deform_groups=1, fallback_on_stride=False), 5 | stage_with_dcn=(False, True, True, True))) 6 | -------------------------------------------------------------------------------- /configs/dcnv2/faster-rcnn_r50-mdconv-group4-c3-c5_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../faster_rcnn/faster-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | dcn=dict(type='DCNv2', deform_groups=4, fallback_on_stride=False), 5 | stage_with_dcn=(False, True, True, True))) 6 | -------------------------------------------------------------------------------- /configs/fast_rcnn/fast-rcnn_r101-caffe_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './fast-rcnn_r50-caffe_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict( 6 | type='Pretrained', 7 | checkpoint='open-mmlab://detectron2/resnet101_caffe'))) 8 | -------------------------------------------------------------------------------- /configs/faster_rcnn/faster-rcnn_r50_fpn_amp-1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './faster-rcnn_r50_fpn_1x_coco.py' 2 | 3 | # MMEngine support the following two ways, users can choose 4 | # according to convenience 5 | # optim_wrapper = dict(type='AmpOptimWrapper') 6 | _base_.optim_wrapper.type = 'AmpOptimWrapper' 7 | -------------------------------------------------------------------------------- /configs/htc/htc_x101-64x4d_fpn_16xb1-20e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './htc_x101-32x4d_fpn_16xb1-20e_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | groups=64, 6 | init_cfg=dict( 7 | type='Pretrained', checkpoint='open-mmlab://resnext101_64x4d'))) 8 | -------------------------------------------------------------------------------- /configs/lvis/mask-rcnn_r101_fpn_sample1e-3_ms-2x_lvis-v0.5.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_r50_fpn_sample1e-3_ms-2x_lvis-v0.5.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /configs/mask_rcnn/mask-rcnn_r101-caffe_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_r50-caffe_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict( 6 | type='Pretrained', 7 | checkpoint='open-mmlab://detectron2/resnet101_caffe'))) 8 | -------------------------------------------------------------------------------- /configs/mask_rcnn/mask-rcnn_r101_fpn_8xb8-amp-lsj-200e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_r50_fpn_8xb8-amp-lsj-200e_coco.py' 2 | 3 | model = dict( 4 | backbone=dict( 5 | depth=101, 6 | init_cfg=dict(type='Pretrained', 7 | checkpoint='torchvision://resnet101'))) 8 | -------------------------------------------------------------------------------- /configs/pvt/retinanet_pvt-s_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = 'retinanet_pvt-t_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | num_layers=[3, 4, 6, 3], 5 | init_cfg=dict(checkpoint='https://github.com/whai362/PVT/' 6 | 'releases/download/v2/pvt_small.pth'))) 7 | -------------------------------------------------------------------------------- /configs/retinanet/retinanet_r101-caffe_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './retinanet_r50-caffe_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict( 6 | type='Pretrained', 7 | checkpoint='open-mmlab://detectron2/resnet101_caffe'))) 8 | -------------------------------------------------------------------------------- /configs/retinanet/retinanet_r101_fpn_8xb8-amp-lsj-200e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './retinanet_r50_fpn_8xb8-amp-lsj-200e_coco.py' 2 | 3 | model = dict( 4 | backbone=dict( 5 | depth=101, 6 | init_cfg=dict(type='Pretrained', 7 | checkpoint='torchvision://resnet101'))) 8 | -------------------------------------------------------------------------------- /configs/seesaw_loss/mask-rcnn_r50_fpn_seesaw-loss-normed-mask_random-ms-2x_lvis-v1.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_r50_fpn_seesaw-loss_random-ms-2x_lvis-v1.py' 2 | model = dict( 3 | roi_head=dict( 4 | mask_head=dict( 5 | predictor_cfg=dict(type='NormedConv2d', tempearture=20)))) 6 | -------------------------------------------------------------------------------- /configs/solo/solo_r18_fpn_8xb8-lsj-200e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './solo_r50_fpn_8xb8-lsj-200e_coco.py' 2 | 3 | model = dict( 4 | backbone=dict( 5 | depth=18, 6 | init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet18')), 7 | neck=dict(in_channels=[64, 128, 256, 512])) 8 | -------------------------------------------------------------------------------- /configs/sparse_rcnn/sparse-rcnn_r101_fpn_ms-480-800-3x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './sparse-rcnn_r50_fpn_ms-480-800-3x_coco.py' 2 | 3 | model = dict( 4 | backbone=dict( 5 | depth=101, 6 | init_cfg=dict(type='Pretrained', 7 | checkpoint='torchvision://resnet101'))) 8 | -------------------------------------------------------------------------------- /projects/CO-DETR/configs/codino/co_dino_5scale_swin_l_lsj_16xb1_3x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = ['co_dino_5scale_swin_l_lsj_16xb1_1x_coco.py'] 2 | 3 | model = dict(backbone=dict(drop_path_rate=0.5)) 4 | 5 | param_scheduler = [dict(type='MultiStepLR', milestones=[30])] 6 | 7 | train_cfg = dict(max_epochs=36) 8 | -------------------------------------------------------------------------------- /configs/bytetrack/yolox_x_8xb4-amp-80e_crowdhuman-mot17halftrain_test-mot17halfval.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../strongsort/yolox_x_8xb4-80e_crowdhuman-mot17halftrain_test-mot17halfval.py' # noqa: E501 3 | ] 4 | 5 | # fp16 settings 6 | optim_wrapper = dict(type='AmpOptimWrapper', loss_scale='dynamic') 7 | -------------------------------------------------------------------------------- /configs/pvt/retinanet_pvt-m_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = 'retinanet_pvt-t_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | num_layers=[3, 4, 18, 3], 5 | init_cfg=dict(checkpoint='https://github.com/whai362/PVT/' 6 | 'releases/download/v2/pvt_medium.pth'))) 7 | -------------------------------------------------------------------------------- /configs/reppoints/reppoints-moment_r101_fpn-gn_head-gn_2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './reppoints-moment_r50_fpn-gn_head-gn_2x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /configs/seesaw_loss/mask-rcnn_r50_fpn_seesaw-loss-normed-mask_sample1e-3-ms-2x_lvis-v1.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_r50_fpn_seesaw-loss_sample1e-3-ms-2x_lvis-v1.py' 2 | model = dict( 3 | roi_head=dict( 4 | mask_head=dict( 5 | predictor_cfg=dict(type='NormedConv2d', tempearture=20)))) 6 | -------------------------------------------------------------------------------- /configs/atss/atss_r18_fpn_8xb8-amp-lsj-200e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './atss_r50_fpn_8xb8-amp-lsj-200e_coco.py' 2 | 3 | model = dict( 4 | backbone=dict( 5 | depth=18, 6 | init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet18')), 7 | neck=dict(in_channels=[64, 128, 256, 512])) 8 | -------------------------------------------------------------------------------- /configs/cascade_rcnn/cascade-rcnn_r101-caffe_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './cascade-rcnn_r50-caffe_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict( 6 | type='Pretrained', 7 | checkpoint='open-mmlab://detectron2/resnet101_caffe'))) 8 | -------------------------------------------------------------------------------- /configs/cascade_rcnn/cascade-rcnn_r101_fpn_8xb8-amp-lsj-200e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './cascade-rcnn_r50_fpn_8xb8-amp-lsj-200e_coco.py' 2 | 3 | model = dict( 4 | backbone=dict( 5 | depth=101, 6 | init_cfg=dict(type='Pretrained', 7 | checkpoint='torchvision://resnet101'))) 8 | -------------------------------------------------------------------------------- /configs/faster_rcnn/faster-rcnn_r101-caffe_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './faster-rcnn_r50-caffe_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict( 6 | type='Pretrained', 7 | checkpoint='open-mmlab://detectron2/resnet101_caffe'))) 8 | -------------------------------------------------------------------------------- /configs/faster_rcnn/faster-rcnn_r101_fpn_8xb8-amp-lsj-200e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './faster-rcnn_r50_fpn_8xb8-amp-lsj-200e_coco.py' 2 | 3 | model = dict( 4 | backbone=dict( 5 | depth=101, 6 | init_cfg=dict(type='Pretrained', 7 | checkpoint='torchvision://resnet101'))) 8 | -------------------------------------------------------------------------------- /configs/instaboost/cascade-mask-rcnn_r101_fpn_instaboost-4x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './cascade-mask-rcnn_r50_fpn_instaboost-4x_coco.py' 2 | 3 | model = dict( 4 | backbone=dict( 5 | depth=101, 6 | init_cfg=dict(type='Pretrained', 7 | checkpoint='torchvision://resnet101'))) 8 | -------------------------------------------------------------------------------- /configs/mask2former/mask2former_r101_8xb2-lsj-50e_coco-panoptic.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask2former_r50_8xb2-lsj-50e_coco-panoptic.py' 2 | 3 | model = dict( 4 | backbone=dict( 5 | depth=101, 6 | init_cfg=dict(type='Pretrained', 7 | checkpoint='torchvision://resnet101'))) 8 | -------------------------------------------------------------------------------- /projects/iSAID/configs/mask_rcnn_r50_fpn_1x_isaid.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../../../configs/_base_/models/mask-rcnn_r50_fpn.py', 3 | '../../../configs/_base_/datasets/isaid_instance.py', 4 | '../../../configs/_base_/schedules/schedule_1x.py', 5 | '../../../configs/_base_/default_runtime.py' 6 | ] 7 | -------------------------------------------------------------------------------- /CITATION.cff: -------------------------------------------------------------------------------- 1 | cff-version: 1.2.0 2 | message: "If you use this software, please cite it as below." 3 | authors: 4 | - name: "MMDetection Contributors" 5 | title: "OpenMMLab Detection Toolbox and Benchmark" 6 | date-released: 2018-08-22 7 | url: "https://github.com/open-mmlab/mmdetection" 8 | license: Apache-2.0 9 | -------------------------------------------------------------------------------- /configs/centernet/centernet-update_r101_fpn_8xb8-amp-lsj-200e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './centernet-update_r50_fpn_8xb8-amp-lsj-200e_coco.py' 2 | 3 | model = dict( 4 | backbone=dict( 5 | depth=101, 6 | init_cfg=dict(type='Pretrained', 7 | checkpoint='torchvision://resnet101'))) 8 | -------------------------------------------------------------------------------- /configs/dcn/cascade-mask-rcnn_x101-32x4d-dconv-c3-c5_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../cascade_rcnn/cascade-mask-rcnn_x101-32x4d_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | dcn=dict(type='DCN', deform_groups=1, fallback_on_stride=False), 5 | stage_with_dcn=(False, True, True, True))) 6 | -------------------------------------------------------------------------------- /configs/detectors/htc_r50-sac_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../htc/htc_r50_fpn_1x_coco.py' 2 | 3 | model = dict( 4 | backbone=dict( 5 | type='DetectoRS_ResNet', 6 | conv_cfg=dict(type='ConvAWS'), 7 | sac=dict(type='SAC', use_deform=True), 8 | stage_with_sac=(False, True, True, True))) 9 | -------------------------------------------------------------------------------- /configs/guided_anchoring/ga-retinanet_r101-caffe_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './ga-retinanet_r50-caffe_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict( 6 | type='Pretrained', 7 | checkpoint='open-mmlab://detectron2/resnet101_caffe'))) 8 | -------------------------------------------------------------------------------- /configs/rtmdet/rtmdet_m_8xb32-300e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './rtmdet_l_8xb32-300e_coco.py' 2 | 3 | model = dict( 4 | backbone=dict(deepen_factor=0.67, widen_factor=0.75), 5 | neck=dict(in_channels=[192, 384, 768], out_channels=192, num_csp_blocks=2), 6 | bbox_head=dict(in_channels=192, feat_channels=192)) 7 | -------------------------------------------------------------------------------- /configs/strong_baselines/mask-rcnn_r50-caffe_fpn_rpn-2conv_4conv1fc_syncbn-all_amp-lsj-100e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = 'mask-rcnn_r50-caffe_fpn_rpn-2conv_4conv1fc_syncbn-all_lsj-100e_coco.py' # noqa 2 | 3 | # Enable automatic-mixed-precision training with AmpOptimWrapper. 4 | optim_wrapper = dict(type='AmpOptimWrapper') 5 | -------------------------------------------------------------------------------- /configs/tood/tood_r101-dconv-c3-c5_fpn_ms-2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './tood_r101_fpn_ms-2x_coco.py' 2 | 3 | model = dict( 4 | backbone=dict( 5 | dcn=dict(type='DCNv2', deformable_groups=1, fallback_on_stride=False), 6 | stage_with_dcn=(False, True, True, True)), 7 | bbox_head=dict(num_dcn=2)) 8 | -------------------------------------------------------------------------------- /configs/cascade_rcnn/cascade-mask-rcnn_r101-caffe_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './cascade-mask-rcnn_r50-caffe_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict( 6 | type='Pretrained', 7 | checkpoint='open-mmlab://detectron2/resnet101_caffe'))) 8 | -------------------------------------------------------------------------------- /configs/guided_anchoring/ga-faster-rcnn_r101-caffe_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './ga-faster-rcnn_r50-caffe_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict( 6 | type='Pretrained', 7 | checkpoint='open-mmlab://detectron2/resnet101_caffe'))) 8 | -------------------------------------------------------------------------------- /configs/rpn/rpn_r50-caffe-c4_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/rpn_r50-caffe-c4.py', 3 | '../_base_/datasets/coco_detection.py', 4 | '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py' 5 | ] 6 | 7 | val_evaluator = dict(metric='proposal_fast') 8 | test_evaluator = val_evaluator 9 | -------------------------------------------------------------------------------- /configs/seesaw_loss/mask-rcnn_r101_fpn_seesaw-loss_random-ms-2x_lvis-v1.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_r50_fpn_seesaw-loss_random-ms-2x_lvis-v1.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /configs/vfnet/vfnet_r50-mdconv-c3-c5_fpn_ms-2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './vfnet_r50_fpn_ms-2x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | dcn=dict(type='DCNv2', deform_groups=1, fallback_on_stride=False), 5 | stage_with_dcn=(False, True, True, True)), 6 | bbox_head=dict(dcn_on_last_conv=True)) 7 | -------------------------------------------------------------------------------- /configs/cascade_rcnn/cascade-mask-rcnn_r101-caffe_fpn_ms-3x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './cascade-mask-rcnn_r50-caffe_fpn_ms-3x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict( 6 | type='Pretrained', 7 | checkpoint='open-mmlab://detectron2/resnet101_caffe'))) 8 | -------------------------------------------------------------------------------- /configs/guided_anchoring/ga-rpn_r101-caffe_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './ga-rpn_r50-caffe_fpn_1x_coco.py' 2 | # model settings 3 | model = dict( 4 | backbone=dict( 5 | depth=101, 6 | init_cfg=dict( 7 | type='Pretrained', 8 | checkpoint='open-mmlab://detectron2/resnet101_caffe'))) 9 | -------------------------------------------------------------------------------- /configs/mask_rcnn/mask-rcnn_r18_fpn_8xb8-amp-lsj-200e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_r50_fpn_8xb8-amp-lsj-200e_coco.py' 2 | 3 | model = dict( 4 | backbone=dict( 5 | depth=18, 6 | init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet18')), 7 | neck=dict(in_channels=[64, 128, 256, 512])) 8 | -------------------------------------------------------------------------------- /configs/retinanet/retinanet_r18_fpn_8xb8-amp-lsj-200e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './retinanet_r50_fpn_8xb8-amp-lsj-200e_coco.py' 2 | 3 | model = dict( 4 | backbone=dict( 5 | depth=18, 6 | init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet18')), 7 | neck=dict(in_channels=[64, 128, 256, 512])) 8 | -------------------------------------------------------------------------------- /configs/rtmdet/rtmdet-ins_m_8xb32-300e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './rtmdet-ins_l_8xb32-300e_coco.py' 2 | 3 | model = dict( 4 | backbone=dict(deepen_factor=0.67, widen_factor=0.75), 5 | neck=dict(in_channels=[192, 384, 768], out_channels=192, num_csp_blocks=2), 6 | bbox_head=dict(in_channels=192, feat_channels=192)) 7 | -------------------------------------------------------------------------------- /configs/seesaw_loss/mask-rcnn_r101_fpn_seesaw-loss_sample1e-3-ms-2x_lvis-v1.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_r50_fpn_seesaw-loss_sample1e-3-ms-2x_lvis-v1.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /configs/faster_rcnn/faster-rcnn_r18_fpn_8xb8-amp-lsj-200e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './faster-rcnn_r50_fpn_8xb8-amp-lsj-200e_coco.py' 2 | 3 | model = dict( 4 | backbone=dict( 5 | depth=18, 6 | init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet18')), 7 | neck=dict(in_channels=[64, 128, 256, 512])) 8 | -------------------------------------------------------------------------------- /configs/queryinst/queryinst_r101_fpn_300-proposals_crop-ms-480-800-3x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './queryinst_r50_fpn_300-proposals_crop-ms-480-800-3x_coco.py' 2 | 3 | model = dict( 4 | backbone=dict( 5 | depth=101, 6 | init_cfg=dict(type='Pretrained', 7 | checkpoint='torchvision://resnet101'))) 8 | -------------------------------------------------------------------------------- /configs/retinanet/retinanet_r101-caffe_fpn_ms-3x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './retinanet_r50-caffe_fpn_ms-3x_coco.py' 2 | # learning policy 3 | model = dict( 4 | backbone=dict( 5 | depth=101, 6 | init_cfg=dict( 7 | type='Pretrained', 8 | checkpoint='open-mmlab://detectron2/resnet101_caffe'))) 9 | -------------------------------------------------------------------------------- /configs/rtmdet/rtmdet_x_8xb32-300e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './rtmdet_l_8xb32-300e_coco.py' 2 | 3 | model = dict( 4 | backbone=dict(deepen_factor=1.33, widen_factor=1.25), 5 | neck=dict( 6 | in_channels=[320, 640, 1280], out_channels=320, num_csp_blocks=4), 7 | bbox_head=dict(in_channels=320, feat_channels=320)) 8 | -------------------------------------------------------------------------------- /configs/seesaw_loss/cascade-mask-rcnn_r101_fpn_seesaw-loss-normed-mask_random-ms-2x_lvis-v1.py: -------------------------------------------------------------------------------- 1 | _base_ = './cascade-mask-rcnn_r101_fpn_seesaw-loss_random-ms-2x_lvis-v1.py' # noqa: E501 2 | model = dict( 3 | roi_head=dict( 4 | mask_head=dict( 5 | predictor_cfg=dict(type='NormedConv2d', tempearture=20)))) 6 | -------------------------------------------------------------------------------- /mmdet/models/reid/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .base_reid import BaseReID 3 | from .fc_module import FcModule 4 | from .gap import GlobalAveragePooling 5 | from .linear_reid_head import LinearReIDHead 6 | 7 | __all__ = ['BaseReID', 'GlobalAveragePooling', 'LinearReIDHead', 'FcModule'] 8 | -------------------------------------------------------------------------------- /pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | addopts = --xdoctest --xdoctest-style=auto 3 | norecursedirs = .git ignore build __pycache__ data docker docs .eggs 4 | 5 | filterwarnings= default 6 | ignore:.*No cfgstr given in Cacher constructor or call.*:Warning 7 | ignore:.*Define the __nice__ method for.*:Warning 8 | -------------------------------------------------------------------------------- /configs/cascade_rcnn/cascade-rcnn_r18_fpn_8xb8-amp-lsj-200e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './cascade-rcnn_r50_fpn_8xb8-amp-lsj-200e_coco.py' 2 | 3 | model = dict( 4 | backbone=dict( 5 | depth=18, 6 | init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet18')), 7 | neck=dict(in_channels=[64, 128, 256, 512])) 8 | -------------------------------------------------------------------------------- /configs/tood/tood_x101-64x4d-dconv-c4-c5_fpn_ms-2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './tood_x101-64x4d_fpn_ms-2x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | dcn=dict(type='DCNv2', deformable_groups=1, fallback_on_stride=False), 5 | stage_with_dcn=(False, False, True, True), 6 | ), 7 | bbox_head=dict(num_dcn=2)) 8 | -------------------------------------------------------------------------------- /configs/yolox/yolox_m_8xb8-300e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './yolox_s_8xb8-300e_coco.py' 2 | 3 | # model settings 4 | model = dict( 5 | backbone=dict(deepen_factor=0.67, widen_factor=0.75), 6 | neck=dict(in_channels=[192, 384, 768], out_channels=192, num_csp_blocks=2), 7 | bbox_head=dict(in_channels=192, feat_channels=192), 8 | ) 9 | -------------------------------------------------------------------------------- /configs/centernet/centernet-update_r18_fpn_8xb8-amp-lsj-200e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './centernet-update_r50_fpn_8xb8-amp-lsj-200e_coco.py' 2 | 3 | model = dict( 4 | backbone=dict( 5 | depth=18, 6 | init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet18')), 7 | neck=dict(in_channels=[64, 128, 256, 512])) 8 | -------------------------------------------------------------------------------- /configs/fcos/fcos_r101-caffe_fpn_gn-head-1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './fcos_r50-caffe_fpn_gn-head_1x_coco.py' 2 | 3 | # model settings 4 | model = dict( 5 | backbone=dict( 6 | depth=101, 7 | init_cfg=dict( 8 | type='Pretrained', 9 | checkpoint='open-mmlab://detectron/resnet101_caffe'))) 10 | -------------------------------------------------------------------------------- /configs/gcnet/mask-rcnn_r50-gcb-r4-c3-c5_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../mask_rcnn/mask-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict(plugins=[ 4 | dict( 5 | cfg=dict(type='ContextBlock', ratio=1. / 4), 6 | stages=(False, True, True, True), 7 | position='after_conv3') 8 | ])) 9 | -------------------------------------------------------------------------------- /configs/pisa/retinanet-r50_fpn_pisa_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../retinanet/retinanet_r50_fpn_1x_coco.py' 2 | 3 | model = dict( 4 | bbox_head=dict( 5 | type='PISARetinaHead', 6 | loss_bbox=dict(type='SmoothL1Loss', beta=0.11, loss_weight=1.0)), 7 | train_cfg=dict(isr=dict(k=2., bias=0.), carl=dict(k=1., bias=0.2))) 8 | -------------------------------------------------------------------------------- /configs/seesaw_loss/cascade-mask-rcnn_r101_fpn_seesaw-loss-normed-mask_sample1e-3-ms-2x_lvis-v1.py: -------------------------------------------------------------------------------- 1 | _base_ = './cascade-mask-rcnn_r101_fpn_seesaw-loss_sample1e-3-ms-2x_lvis-v1.py' # noqa: E501 2 | model = dict( 3 | roi_head=dict( 4 | mask_head=dict( 5 | predictor_cfg=dict(type='NormedConv2d', tempearture=20)))) 6 | -------------------------------------------------------------------------------- /configs/sparse_rcnn/sparse-rcnn_r101_fpn_300-proposals_crop-ms-480-800-3x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './sparse-rcnn_r50_fpn_300-proposals_crop-ms-480-800-3x_coco.py' 2 | 3 | model = dict( 4 | backbone=dict( 5 | depth=101, 6 | init_cfg=dict(type='Pretrained', 7 | checkpoint='torchvision://resnet101'))) 8 | -------------------------------------------------------------------------------- /configs/strong_baselines/mask-rcnn_r50_fpn_rpn-2conv_4conv1fc_syncbn-all_lsj-50e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = 'mask-rcnn_r50_fpn_rpn-2conv_4conv1fc_syncbn-all_lsj-100e_coco.py' 2 | 3 | # Use RepeatDataset to speed up training 4 | # change repeat time from 4 (for 100 epochs) to 2 (for 50 epochs) 5 | train_dataloader = dict(dataset=dict(times=2)) 6 | -------------------------------------------------------------------------------- /configs/gcnet/mask-rcnn_r101-gcb-r16-c3-c5_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../mask_rcnn/mask-rcnn_r101_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict(plugins=[ 4 | dict( 5 | cfg=dict(type='ContextBlock', ratio=1. / 16), 6 | stages=(False, True, True, True), 7 | position='after_conv3') 8 | ])) 9 | -------------------------------------------------------------------------------- /configs/gcnet/mask-rcnn_r101-gcb-r4-c3-c5_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../mask_rcnn/mask-rcnn_r101_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict(plugins=[ 4 | dict( 5 | cfg=dict(type='ContextBlock', ratio=1. / 4), 6 | stages=(False, True, True, True), 7 | position='after_conv3') 8 | ])) 9 | -------------------------------------------------------------------------------- /configs/gcnet/mask-rcnn_r50-gcb-r16-c3-c5_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../mask_rcnn/mask-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict(plugins=[ 4 | dict( 5 | cfg=dict(type='ContextBlock', ratio=1. / 16), 6 | stages=(False, True, True, True), 7 | position='after_conv3') 8 | ])) 9 | -------------------------------------------------------------------------------- /configs/resnest/mask-rcnn_s101_fpn_syncbn-backbone+head_ms-1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_s50_fpn_syncbn-backbone+head_ms-1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | stem_channels=128, 5 | depth=101, 6 | init_cfg=dict(type='Pretrained', 7 | checkpoint='open-mmlab://resnest101'))) 8 | -------------------------------------------------------------------------------- /configs/yolox/yolox_l_8xb8-300e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './yolox_s_8xb8-300e_coco.py' 2 | 3 | # model settings 4 | model = dict( 5 | backbone=dict(deepen_factor=1.0, widen_factor=1.0), 6 | neck=dict( 7 | in_channels=[256, 512, 1024], out_channels=256, num_csp_blocks=3), 8 | bbox_head=dict(in_channels=256, feat_channels=256)) 9 | -------------------------------------------------------------------------------- /configs/yolox/yolox_x_8xb8-300e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './yolox_s_8xb8-300e_coco.py' 2 | 3 | # model settings 4 | model = dict( 5 | backbone=dict(deepen_factor=1.33, widen_factor=1.25), 6 | neck=dict( 7 | in_channels=[320, 640, 1280], out_channels=320, num_csp_blocks=4), 8 | bbox_head=dict(in_channels=320, feat_channels=320)) 9 | -------------------------------------------------------------------------------- /tools/analysis_tools/mot/dist_mot_search.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CONFIG=$1 4 | GPUS=$2 5 | PORT=${PORT:-29500} 6 | 7 | PYTHONPATH="$(dirname $0)/..":$PYTHONPATH \ 8 | python -m torch.distributed.launch --nproc_per_node=$GPUS --master_port=$PORT \ 9 | $(dirname "$0")/mot_param_search.py $CONFIG --launcher pytorch ${@:3} 10 | -------------------------------------------------------------------------------- /configs/pisa/retinanet_x101-32x4d_fpn_pisa_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../retinanet/retinanet_x101-32x4d_fpn_1x_coco.py' 2 | 3 | model = dict( 4 | bbox_head=dict( 5 | type='PISARetinaHead', 6 | loss_bbox=dict(type='SmoothL1Loss', beta=0.11, loss_weight=1.0)), 7 | train_cfg=dict(isr=dict(k=2., bias=0.), carl=dict(k=1., bias=0.2))) 8 | -------------------------------------------------------------------------------- /configs/pvt/retinanet_pvtv2-b1_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = 'retinanet_pvtv2-b0_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | embed_dims=64, 5 | init_cfg=dict(checkpoint='https://github.com/whai362/PVT/' 6 | 'releases/download/v2/pvt_v2_b1.pth')), 7 | neck=dict(in_channels=[64, 128, 320, 512])) 8 | -------------------------------------------------------------------------------- /configs/seesaw_loss/mask-rcnn_r101_fpn_seesaw-loss-normed-mask_random-ms-2x_lvis-v1.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_r50_fpn_seesaw-loss-normed-mask_random-ms-2x_lvis-v1.py' # noqa: E501 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /mmdet/engine/schedulers/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .quadratic_warmup import (QuadraticWarmupLR, QuadraticWarmupMomentum, 3 | QuadraticWarmupParamScheduler) 4 | 5 | __all__ = [ 6 | 'QuadraticWarmupParamScheduler', 'QuadraticWarmupMomentum', 7 | 'QuadraticWarmupLR' 8 | ] 9 | -------------------------------------------------------------------------------- /mmdet/visualization/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .local_visualizer import DetLocalVisualizer, TrackLocalVisualizer 3 | from .palette import get_palette, jitter_color, palette_val 4 | 5 | __all__ = [ 6 | 'palette_val', 'get_palette', 'DetLocalVisualizer', 'jitter_color', 7 | 'TrackLocalVisualizer' 8 | ] 9 | -------------------------------------------------------------------------------- /configs/resnest/cascade-mask-rcnn_s101_fpn_syncbn-backbone+head_ms-1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './cascade-mask-rcnn_s50_fpn_syncbn-backbone+head_ms-1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | stem_channels=128, 5 | depth=101, 6 | init_cfg=dict(type='Pretrained', 7 | checkpoint='open-mmlab://resnest101'))) 8 | -------------------------------------------------------------------------------- /configs/resnest/cascade-rcnn_s101_fpn_syncbn-backbone+head_ms-range-1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './cascade-rcnn_s50_fpn_syncbn-backbone+head_ms-range-1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | stem_channels=128, 5 | depth=101, 6 | init_cfg=dict(type='Pretrained', 7 | checkpoint='open-mmlab://resnest101'))) 8 | -------------------------------------------------------------------------------- /configs/resnest/faster-rcnn_s101_fpn_syncbn-backbone+head_ms-range-1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './faster-rcnn_s50_fpn_syncbn-backbone+head_ms-range-1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | stem_channels=128, 5 | depth=101, 6 | init_cfg=dict(type='Pretrained', 7 | checkpoint='open-mmlab://resnest101'))) 8 | -------------------------------------------------------------------------------- /mmdet/models/roi_heads/roi_extractors/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .base_roi_extractor import BaseRoIExtractor 3 | from .generic_roi_extractor import GenericRoIExtractor 4 | from .single_level_roi_extractor import SingleRoIExtractor 5 | 6 | __all__ = ['BaseRoIExtractor', 'SingleRoIExtractor', 'GenericRoIExtractor'] 7 | -------------------------------------------------------------------------------- /mmdet/models/seg_heads/panoptic_fusion_heads/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .base_panoptic_fusion_head import \ 3 | BasePanopticFusionHead # noqa: F401,F403 4 | from .heuristic_fusion_head import HeuristicFusionHead # noqa: F401,F403 5 | from .maskformer_fusion_head import MaskFormerFusionHead # noqa: F401,F403 6 | -------------------------------------------------------------------------------- /configs/mask_rcnn/mask-rcnn_r101_fpn_ms-poly-3x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../common/ms-poly_3x_coco-instance.py', 3 | '../_base_/models/mask-rcnn_r50_fpn.py' 4 | ] 5 | 6 | model = dict( 7 | backbone=dict( 8 | depth=101, 9 | init_cfg=dict(type='Pretrained', 10 | checkpoint='torchvision://resnet101'))) 11 | -------------------------------------------------------------------------------- /configs/seesaw_loss/mask-rcnn_r101_fpn_seesaw-loss-normed-mask_sample1e-3-ms-2x_lvis-v1.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_r50_fpn_seesaw-loss-normed-mask_sample1e-3-ms-2x_lvis-v1.py' # noqa: E501 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | init_cfg=dict(type='Pretrained', 6 | checkpoint='torchvision://resnet101'))) 7 | -------------------------------------------------------------------------------- /tests/test_models/test_task_modules/test_track/test_similarity.py: -------------------------------------------------------------------------------- 1 | import torch 2 | 3 | from mmdet.models.task_modules import embed_similarity 4 | 5 | 6 | def test_embed_similarity(): 7 | """Test embed similarity.""" 8 | embeds = torch.rand(2, 3) 9 | similarity = embed_similarity(embeds, embeds) 10 | assert similarity.shape == (2, 2) 11 | -------------------------------------------------------------------------------- /projects/XDecoder/xdecoder/inference/__init__.py: -------------------------------------------------------------------------------- 1 | from .image_caption import ImageCaptionInferencer, RefImageCaptionInferencer 2 | from .texttoimage_regionretrieval_inferencer import \ 3 | TextToImageRegionRetrievalInferencer 4 | 5 | __all__ = [ 6 | 'ImageCaptionInferencer', 'RefImageCaptionInferencer', 7 | 'TextToImageRegionRetrievalInferencer' 8 | ] 9 | -------------------------------------------------------------------------------- /tools/dataset_converters/scripts/preprocess_voc2012.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | DOWNLOAD_DIR=$1 4 | DATA_ROOT=$2 5 | 6 | tar -xvf $DOWNLOAD_DIR/OpenDataLab___PASCAL_VOC2012/raw/VOCtrainval_11-May-2012.tar -C $DATA_ROOT 7 | tar -xvf $DOWNLOAD_DIR/OpenDataLab___PASCAL_VOC2012/raw/VOC2012test.tar -C $DATA_ROOT 8 | rm -rf $DOWNLOAD_DIR/OpenDataLab___PASCAL_VOC2012 9 | -------------------------------------------------------------------------------- /configs/bytetrack/bytetrack_yolox_x_8xb4-amp-80e_crowdhuman-mot20train_test-mot20test.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | './bytetrack_yolox_x_8xb4-80e_crowdhuman-mot20train_test-mot20test.py' 3 | ] 4 | 5 | # fp16 settings 6 | optim_wrapper = dict(type='AmpOptimWrapper', loss_scale='dynamic') 7 | val_cfg = dict(type='ValLoop', fp16=True) 8 | test_cfg = dict(type='TestLoop', fp16=True) 9 | -------------------------------------------------------------------------------- /configs/fcos/fcos_r101_fpn_gn-head-center-normbbox-centeronreg-giou_8xb8-amp-lsj-200e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './fcos_r50_fpn_gn-head-center-normbbox-centeronreg-giou_8xb8-amp-lsj-200e_coco.py' # noqa 2 | 3 | model = dict( 4 | backbone=dict( 5 | depth=101, 6 | init_cfg=dict(type='Pretrained', 7 | checkpoint='torchvision://resnet101'))) 8 | -------------------------------------------------------------------------------- /configs/reid/reid_r50_8xb32-6e_mot15train80_test-mot15val20.py: -------------------------------------------------------------------------------- 1 | _base_ = ['./reid_r50_8xb32-6e_mot17train80_test-mot17val20.py'] 2 | model = dict(head=dict(num_classes=368)) 3 | # data 4 | data_root = 'data/MOT15/' 5 | train_dataloader = dict(dataset=dict(data_root=data_root)) 6 | val_dataloader = dict(dataset=dict(data_root=data_root)) 7 | test_dataloader = val_dataloader 8 | -------------------------------------------------------------------------------- /configs/reid/reid_r50_8xb32-6e_mot16train80_test-mot16val20.py: -------------------------------------------------------------------------------- 1 | _base_ = ['./reid_r50_8xb32-6e_mot17train80_test-mot17val20.py'] 2 | model = dict(head=dict(num_classes=371)) 3 | # data 4 | data_root = 'data/MOT16/' 5 | train_dataloader = dict(dataset=dict(data_root=data_root)) 6 | val_dataloader = dict(dataset=dict(data_root=data_root)) 7 | test_dataloader = val_dataloader 8 | -------------------------------------------------------------------------------- /configs/res2net/htc_res2net-101_fpn_20e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../htc/htc_r50_fpn_20e_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='Res2Net', 5 | depth=101, 6 | scales=4, 7 | base_width=26, 8 | init_cfg=dict( 9 | type='Pretrained', 10 | checkpoint='open-mmlab://res2net101_v1d_26w_4s'))) 11 | -------------------------------------------------------------------------------- /projects/ViTDet/vitdet/__init__.py: -------------------------------------------------------------------------------- 1 | from .fp16_compression_hook import Fp16CompresssionHook 2 | from .layer_decay_optimizer_constructor import LayerDecayOptimizerConstructor 3 | from .simple_fpn import SimpleFPN 4 | from .vit import LN2d, ViT 5 | 6 | __all__ = [ 7 | 'LayerDecayOptimizerConstructor', 'ViT', 'SimpleFPN', 'LN2d', 8 | 'Fp16CompresssionHook' 9 | ] 10 | -------------------------------------------------------------------------------- /configs/cornernet/cornernet_hourglass104_32xb3-210e-mstest_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './cornernet_hourglass104_8xb6-210e-mstest_coco.py' 2 | 3 | train_dataloader = dict(batch_size=3) 4 | 5 | # NOTE: `auto_scale_lr` is for automatically scaling LR, 6 | # USER SHOULD NOT CHANGE ITS VALUES. 7 | # base_batch_size = (32 GPUs) x (3 samples per GPU) 8 | auto_scale_lr = dict(base_batch_size=96) 9 | -------------------------------------------------------------------------------- /configs/pvt/retinanet_pvtv2-b2_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = 'retinanet_pvtv2-b0_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | embed_dims=64, 5 | num_layers=[3, 4, 6, 3], 6 | init_cfg=dict(checkpoint='https://github.com/whai362/PVT/' 7 | 'releases/download/v2/pvt_v2_b2.pth')), 8 | neck=dict(in_channels=[64, 128, 320, 512])) 9 | -------------------------------------------------------------------------------- /tools/dataset_converters/scripts/preprocess_voc2007.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | DOWNLOAD_DIR=$1 4 | DATA_ROOT=$2 5 | 6 | tar -xvf $DOWNLOAD_DIR/OpenDataLab___PASCAL_VOC2007/raw/VOCtrainval_06-Nov-2007.tar -C $DATA_ROOT 7 | tar -xvf $DOWNLOAD_DIR/OpenDataLab___PASCAL_VOC2007/raw/VOCtestnoimgs_06-Nov-2007.tar -C $DATA_ROOT 8 | rm -rf $DOWNLOAD_DIR/OpenDataLab___PASCAL_VOC2007 9 | -------------------------------------------------------------------------------- /configs/pvt/retinanet_pvtv2-b3_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = 'retinanet_pvtv2-b0_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | embed_dims=64, 5 | num_layers=[3, 4, 18, 3], 6 | init_cfg=dict(checkpoint='https://github.com/whai362/PVT/' 7 | 'releases/download/v2/pvt_v2_b3.pth')), 8 | neck=dict(in_channels=[64, 128, 320, 512])) 9 | -------------------------------------------------------------------------------- /configs/res2net/mask-rcnn_res2net-101_fpn_2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../mask_rcnn/mask-rcnn_r50_fpn_2x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='Res2Net', 5 | depth=101, 6 | scales=4, 7 | base_width=26, 8 | init_cfg=dict( 9 | type='Pretrained', 10 | checkpoint='open-mmlab://res2net101_v1d_26w_4s'))) 11 | -------------------------------------------------------------------------------- /configs/cornernet/cornernet_hourglass104_10xb5-crop511-210e-mstest_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './cornernet_hourglass104_8xb6-210e-mstest_coco.py' 2 | 3 | train_dataloader = dict(batch_size=5) 4 | 5 | # NOTE: `auto_scale_lr` is for automatically scaling LR, 6 | # USER SHOULD NOT CHANGE ITS VALUES. 7 | # base_batch_size = (10 GPUs) x (5 samples per GPU) 8 | auto_scale_lr = dict(base_batch_size=50) 9 | -------------------------------------------------------------------------------- /configs/res2net/faster-rcnn_res2net-101_fpn_2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../faster_rcnn/faster-rcnn_r50_fpn_2x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='Res2Net', 5 | depth=101, 6 | scales=4, 7 | base_width=26, 8 | init_cfg=dict( 9 | type='Pretrained', 10 | checkpoint='open-mmlab://res2net101_v1d_26w_4s'))) 11 | -------------------------------------------------------------------------------- /configs/fcos/fcos_r18_fpn_gn-head-center-normbbox-centeronreg-giou_8xb8-amp-lsj-200e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './fcos_r50_fpn_gn-head-center-normbbox-centeronreg-giou_8xb8-amp-lsj-200e_coco.py' # noqa 2 | 3 | model = dict( 4 | backbone=dict( 5 | depth=18, 6 | init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet18')), 7 | neck=dict(in_channels=[64, 128, 256, 512])) 8 | -------------------------------------------------------------------------------- /configs/mask2former/mask2former_swin-b-p4-w12-384-in21k_8xb2-lsj-50e_coco-panoptic.py: -------------------------------------------------------------------------------- 1 | _base_ = ['./mask2former_swin-b-p4-w12-384_8xb2-lsj-50e_coco-panoptic.py'] 2 | pretrained = 'https://github.com/SwinTransformer/storage/releases/download/v1.0.0/swin_base_patch4_window12_384_22k.pth' # noqa 3 | 4 | model = dict( 5 | backbone=dict(init_cfg=dict(type='Pretrained', checkpoint=pretrained))) 6 | -------------------------------------------------------------------------------- /configs/regnet/mask-rcnn_regnetx-3.2GF-mdconv-c3-c5_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = 'mask-rcnn_regnetx-3.2GF_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | dcn=dict(type='DCNv2', deform_groups=1, fallback_on_stride=False), 5 | stage_with_dcn=(False, True, True, True), 6 | init_cfg=dict( 7 | type='Pretrained', checkpoint='open-mmlab://regnetx_3.2gf'))) 8 | -------------------------------------------------------------------------------- /configs/res2net/cascade-rcnn_res2net-101_fpn_20e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../cascade_rcnn/cascade-rcnn_r50_fpn_20e_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='Res2Net', 5 | depth=101, 6 | scales=4, 7 | base_width=26, 8 | init_cfg=dict( 9 | type='Pretrained', 10 | checkpoint='open-mmlab://res2net101_v1d_26w_4s'))) 11 | -------------------------------------------------------------------------------- /configs/swin/mask-rcnn_swin-s-p4-w7_fpn_amp-ms-crop-3x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_swin-t-p4-w7_fpn_amp-ms-crop-3x_coco.py' 2 | pretrained = 'https://github.com/SwinTransformer/storage/releases/download/v1.0.0/swin_small_patch4_window7_224.pth' # noqa 3 | model = dict( 4 | backbone=dict( 5 | depths=[2, 2, 18, 2], 6 | init_cfg=dict(type='Pretrained', checkpoint=pretrained))) 7 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | 3 | contact_links: 4 | - name: Common Issues 5 | url: https://mmdetection.readthedocs.io/en/latest/faq.html 6 | about: Check if your issue already has solutions 7 | - name: MMDetection Documentation 8 | url: https://mmdetection.readthedocs.io/en/latest/ 9 | about: Check if your question is answered in docs 10 | -------------------------------------------------------------------------------- /projects/Detic/detic/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .centernet_rpn_head import CenterNetRPNHead 3 | from .detic_bbox_head import DeticBBoxHead 4 | from .detic_roi_head import DeticRoIHead 5 | from .zero_shot_classifier import ZeroShotClassifier 6 | 7 | __all__ = [ 8 | 'CenterNetRPNHead', 'DeticBBoxHead', 'DeticRoIHead', 'ZeroShotClassifier' 9 | ] 10 | -------------------------------------------------------------------------------- /configs/bytetrack/bytetrack_yolox_x_8xb4-amp-80e_crowdhuman-mot17halftrain_test-mot17halfval.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | './bytetrack_yolox_x_8xb4-80e_crowdhuman-mot17halftrain_' 3 | 'test-mot17halfval.py' 4 | ] 5 | 6 | # fp16 settings 7 | optim_wrapper = dict(type='AmpOptimWrapper', loss_scale='dynamic') 8 | val_cfg = dict(type='ValLoop', fp16=True) 9 | test_cfg = dict(type='TestLoop', fp16=True) 10 | -------------------------------------------------------------------------------- /configs/res2net/cascade-mask-rcnn_res2net-101_fpn_20e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../cascade_rcnn/cascade-mask-rcnn_r50_fpn_20e_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='Res2Net', 5 | depth=101, 6 | scales=4, 7 | base_width=26, 8 | init_cfg=dict( 9 | type='Pretrained', 10 | checkpoint='open-mmlab://res2net101_v1d_26w_4s'))) 11 | -------------------------------------------------------------------------------- /configs/retinanet/retinanet_r50_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/retinanet_r50_fpn.py', 3 | '../_base_/datasets/coco_detection.py', 4 | '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py', 5 | './retinanet_tta.py' 6 | ] 7 | 8 | # optimizer 9 | optim_wrapper = dict( 10 | optimizer=dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0001)) 11 | -------------------------------------------------------------------------------- /mmdet/models/detectors/scnet.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from mmdet.registry import MODELS 3 | from .cascade_rcnn import CascadeRCNN 4 | 5 | 6 | @MODELS.register_module() 7 | class SCNet(CascadeRCNN): 8 | """Implementation of `SCNet `_""" 9 | 10 | def __init__(self, **kwargs) -> None: 11 | super().__init__(**kwargs) 12 | -------------------------------------------------------------------------------- /mmdet/models/mot/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .base import BaseMOTModel 3 | from .bytetrack import ByteTrack 4 | from .deep_sort import DeepSORT 5 | from .ocsort import OCSORT 6 | from .qdtrack import QDTrack 7 | from .strongsort import StrongSORT 8 | 9 | __all__ = [ 10 | 'BaseMOTModel', 'ByteTrack', 'QDTrack', 'DeepSORT', 'StrongSORT', 'OCSORT' 11 | ] 12 | -------------------------------------------------------------------------------- /configs/fpg/faster-rcnn_r50_fpg-chn128_crop640-50e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = 'faster-rcnn_r50_fpg_crop640-50e_coco.py' 2 | 3 | norm_cfg = dict(type='BN', requires_grad=True) 4 | model = dict( 5 | neck=dict(out_channels=128, inter_channels=128), 6 | rpn_head=dict(in_channels=128), 7 | roi_head=dict( 8 | bbox_roi_extractor=dict(out_channels=128), 9 | bbox_head=dict(in_channels=128))) 10 | -------------------------------------------------------------------------------- /configs/scnet/scnet_x101-64x4d_fpn_8xb1-20e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './scnet_x101-64x4d_fpn_20e_coco.py' 2 | train_dataloader = dict(batch_size=1, num_workers=1) 3 | 4 | optim_wrapper = dict(optimizer=dict(lr=0.01)) 5 | # NOTE: `auto_scale_lr` is for automatically scaling LR, 6 | # USER SHOULD NOT CHANGE ITS VALUES. 7 | # base_batch_size = (8 GPUs) x (1 samples per GPU) 8 | auto_scale_lr = dict(base_batch_size=8) 9 | -------------------------------------------------------------------------------- /configs/pvt/retinanet_pvt-l_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = 'retinanet_pvt-t_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | num_layers=[3, 8, 27, 3], 5 | init_cfg=dict(checkpoint='https://github.com/whai362/PVT/' 6 | 'releases/download/v2/pvt_large.pth'))) 7 | # Enable automatic-mixed-precision training with AmpOptimWrapper. 8 | optim_wrapper = dict(type='AmpOptimWrapper') 9 | -------------------------------------------------------------------------------- /configs/faster_rcnn/faster-rcnn_r101-caffe_fpn_ms-3x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = 'faster-rcnn_r50_fpn_ms-3x_coco.py' 2 | 3 | model = dict( 4 | backbone=dict( 5 | depth=101, 6 | norm_cfg=dict(requires_grad=False), 7 | norm_eval=True, 8 | style='caffe', 9 | init_cfg=dict( 10 | type='Pretrained', 11 | checkpoint='open-mmlab://detectron2/resnet101_caffe'))) 12 | -------------------------------------------------------------------------------- /configs/dino/dino-4scale_r50_8xb2-24e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './dino-4scale_r50_8xb2-12e_coco.py' 2 | max_epochs = 24 3 | train_cfg = dict( 4 | type='EpochBasedTrainLoop', max_epochs=max_epochs, val_interval=1) 5 | param_scheduler = [ 6 | dict( 7 | type='MultiStepLR', 8 | begin=0, 9 | end=max_epochs, 10 | by_epoch=True, 11 | milestones=[20], 12 | gamma=0.1) 13 | ] 14 | -------------------------------------------------------------------------------- /configs/dino/dino-4scale_r50_8xb2-36e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './dino-4scale_r50_8xb2-12e_coco.py' 2 | max_epochs = 36 3 | train_cfg = dict( 4 | type='EpochBasedTrainLoop', max_epochs=max_epochs, val_interval=1) 5 | param_scheduler = [ 6 | dict( 7 | type='MultiStepLR', 8 | begin=0, 9 | end=max_epochs, 10 | by_epoch=True, 11 | milestones=[30], 12 | gamma=0.1) 13 | ] 14 | -------------------------------------------------------------------------------- /configs/dino/dino-5scale_swin-l_8xb2-36e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './dino-5scale_swin-l_8xb2-12e_coco.py' 2 | max_epochs = 36 3 | train_cfg = dict( 4 | type='EpochBasedTrainLoop', max_epochs=max_epochs, val_interval=1) 5 | param_scheduler = [ 6 | dict( 7 | type='MultiStepLR', 8 | begin=0, 9 | end=max_epochs, 10 | by_epoch=True, 11 | milestones=[27, 33], 12 | gamma=0.1) 13 | ] 14 | -------------------------------------------------------------------------------- /mmdet/apis/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .det_inferencer import DetInferencer 3 | from .inference import (async_inference_detector, inference_detector, 4 | inference_mot, init_detector, init_track_model) 5 | 6 | __all__ = [ 7 | 'init_detector', 'async_inference_detector', 'inference_detector', 8 | 'DetInferencer', 'inference_mot', 'init_track_model' 9 | ] 10 | -------------------------------------------------------------------------------- /configs/fast_rcnn/fast-rcnn_r50_fpn_2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './fast-rcnn_r50_fpn_1x_coco.py' 2 | 3 | train_cfg = dict(max_epochs=24) 4 | param_scheduler = [ 5 | dict( 6 | type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500), 7 | dict( 8 | type='MultiStepLR', 9 | begin=0, 10 | end=24, 11 | by_epoch=True, 12 | milestones=[16, 22], 13 | gamma=0.1) 14 | ] 15 | -------------------------------------------------------------------------------- /configs/reppoints/reppoints-moment_r101-dconv-c3-c5_fpn-gn_head-gn_2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './reppoints-moment_r50_fpn-gn_head-gn_2x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | depth=101, 5 | dcn=dict(type='DCN', deform_groups=1, fallback_on_stride=False), 6 | stage_with_dcn=(False, True, True, True), 7 | init_cfg=dict(type='Pretrained', 8 | checkpoint='torchvision://resnet101'))) 9 | -------------------------------------------------------------------------------- /configs/retinanet/retinanet_r101_fpn_ms-640-800-3x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = ['../_base_/models/retinanet_r50_fpn.py', '../common/ms_3x_coco.py'] 2 | # optimizer 3 | model = dict( 4 | backbone=dict( 5 | depth=101, 6 | init_cfg=dict(type='Pretrained', 7 | checkpoint='torchvision://resnet101'))) 8 | optim_wrapper = dict( 9 | optimizer=dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0001)) 10 | -------------------------------------------------------------------------------- /configs/wider_face/retinanet_r50_fpn_1x_widerface.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/retinanet_r50_fpn.py', 3 | '../_base_/datasets/wider_face.py', '../_base_/schedules/schedule_1x.py', 4 | '../_base_/default_runtime.py' 5 | ] 6 | # model settings 7 | model = dict(bbox_head=dict(num_classes=1)) 8 | # optimizer 9 | optim_wrapper = dict( 10 | optimizer=dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0001)) 11 | -------------------------------------------------------------------------------- /projects/XDecoder/xdecoder/__init__.py: -------------------------------------------------------------------------------- 1 | from .focalnet import FocalNet 2 | from .pixel_decoder import XTransformerEncoderPixelDecoder 3 | from .transformer_decoder import XDecoderTransformerDecoder 4 | from .unified_head import XDecoderUnifiedhead 5 | from .xdecoder import XDecoder 6 | 7 | __all__ = [ 8 | 'XDecoder', 'FocalNet', 'XDecoderUnifiedhead', 9 | 'XTransformerEncoderPixelDecoder', 'XDecoderTransformerDecoder' 10 | ] 11 | -------------------------------------------------------------------------------- /configs/yolox/yolox_nano_8xb8-300e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './yolox_tiny_8xb8-300e_coco.py' 2 | 3 | # model settings 4 | model = dict( 5 | backbone=dict(deepen_factor=0.33, widen_factor=0.25, use_depthwise=True), 6 | neck=dict( 7 | in_channels=[64, 128, 256], 8 | out_channels=64, 9 | num_csp_blocks=1, 10 | use_depthwise=True), 11 | bbox_head=dict(in_channels=64, feat_channels=64, use_depthwise=True)) 12 | -------------------------------------------------------------------------------- /docs/zh_cn/migration/migration.md: -------------------------------------------------------------------------------- 1 | # 从 MMDetection 2.x 迁移至 3.x 2 | 3 | MMDetection 3.x 版本是一个重大更新,包含了许多 API 和配置文件的变化。本文档旨在帮助用户从 MMDetection 2.x 版本迁移到 3.x 版本。 4 | 我们将迁移指南分为以下几个部分: 5 | 6 | - [配置文件迁移](./config_migration.md) 7 | - [API 和 Registry 迁移](./api_and_registry_migration.md) 8 | - [数据集迁移](./dataset_migration.md) 9 | - [模型迁移](./model_migration.md) 10 | - [常见问题](./migration_faq.md) 11 | 12 | 如果您在迁移过程中遇到任何问题,欢迎在 issue 中提出。我们也欢迎您为本文档做出贡献。 13 | -------------------------------------------------------------------------------- /projects/Detic_new/configs/detic_centernet2_r50_fpn_4x_lvis-base_boxsup.py: -------------------------------------------------------------------------------- 1 | _base_ = './detic_centernet2_r50_fpn_4x_lvis_boxsup.py' 2 | 3 | # 'lvis_v1_train_norare.json' is the annotations of lvis_v1 4 | # removing the labels of 337 rare-class 5 | train_dataloader = dict( 6 | dataset=dict( 7 | type='ClassBalancedDataset', 8 | oversample_thr=1e-3, 9 | dataset=dict(ann_file='annotations/lvis_v1_train_norare.json'))) 10 | -------------------------------------------------------------------------------- /configs/faster_rcnn/faster-rcnn_r50_fpn_soft-nms_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/faster-rcnn_r50_fpn.py', 3 | '../_base_/datasets/coco_detection.py', 4 | '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py' 5 | ] 6 | 7 | model = dict( 8 | test_cfg=dict( 9 | rcnn=dict( 10 | score_thr=0.05, 11 | nms=dict(type='soft_nms', iou_threshold=0.5), 12 | max_per_img=100))) 13 | -------------------------------------------------------------------------------- /configs/fpg/mask-rcnn_r50_fpg-chn128_crop640-50e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = 'mask-rcnn_r50_fpg_crop640-50e_coco.py' 2 | 3 | model = dict( 4 | neck=dict(out_channels=128, inter_channels=128), 5 | rpn_head=dict(in_channels=128), 6 | roi_head=dict( 7 | bbox_roi_extractor=dict(out_channels=128), 8 | bbox_head=dict(in_channels=128), 9 | mask_roi_extractor=dict(out_channels=128), 10 | mask_head=dict(in_channels=128))) 11 | -------------------------------------------------------------------------------- /projects/Detic_new/configs/detic_centernet2_swin-b_fpn_4x_lvis-base_boxsup.py: -------------------------------------------------------------------------------- 1 | _base_ = './detic_centernet2_swin-b_fpn_4x_lvis_boxsup.py' 2 | 3 | # 'lvis_v1_train_norare.json' is the annotations of lvis_v1 4 | # removing the labels of 337 rare-class 5 | train_dataloader = dict( 6 | dataset=dict( 7 | type='ClassBalancedDataset', 8 | oversample_thr=1e-3, 9 | dataset=dict(ann_file='annotations/lvis_v1_train_norare.json'))) 10 | -------------------------------------------------------------------------------- /configs/glip/glip_atss_swin-l_fpn_dyhead_pretrain_mixeddata.py: -------------------------------------------------------------------------------- 1 | _base_ = './glip_atss_swin-t_a_fpn_dyhead_pretrain_obj365.py' 2 | 3 | model = dict( 4 | backbone=dict( 5 | embed_dims=192, 6 | depths=[2, 2, 18, 2], 7 | num_heads=[6, 12, 24, 48], 8 | window_size=12, 9 | drop_path_rate=0.4, 10 | ), 11 | neck=dict(in_channels=[384, 768, 1536]), 12 | bbox_head=dict(early_fuse=True, num_dyhead_blocks=8)) 13 | -------------------------------------------------------------------------------- /projects/SparseInst/sparseinst/__init__.py: -------------------------------------------------------------------------------- 1 | from .decoder import BaseIAMDecoder, GroupIAMDecoder, GroupIAMSoftDecoder 2 | from .encoder import PyramidPoolingModule 3 | from .loss import SparseInstCriterion, SparseInstMatcher 4 | from .sparseinst import SparseInst 5 | 6 | __all__ = [ 7 | 'BaseIAMDecoder', 'GroupIAMDecoder', 'GroupIAMSoftDecoder', 8 | 'PyramidPoolingModule', 'SparseInstCriterion', 'SparseInstMatcher', 9 | 'SparseInst' 10 | ] 11 | -------------------------------------------------------------------------------- /configs/glip/glip_atss_swin-t_b_fpn_dyhead_16xb2_ms-2x_funtune_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './glip_atss_swin-t_a_fpn_dyhead_16xb2_ms-2x_funtune_coco.py' 2 | 3 | model = dict(bbox_head=dict(early_fuse=True, use_checkpoint=True)) 4 | 5 | load_from = 'https://download.openmmlab.com/mmdetection/v3.0/glip/glip_tiny_b_mmdet-6dfbd102.pth' # noqa 6 | 7 | optim_wrapper = dict( 8 | optimizer=dict(lr=0.00001), 9 | clip_grad=dict(_delete_=True, max_norm=1, norm_type=2)) 10 | -------------------------------------------------------------------------------- /mmdet/configs/dino/dino_4scale_r50_8xb2_24e_coco.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from mmengine.config import read_base 3 | from mmengine.runner.loops import EpochBasedTrainLoop 4 | 5 | with read_base(): 6 | from .dino_4scale_r50_8xb2_12e_coco import * 7 | 8 | max_epochs = 24 9 | train_cfg.update( 10 | dict(type=EpochBasedTrainLoop, max_epochs=max_epochs, val_interval=1)) 11 | 12 | param_scheduler[0].update(dict(milestones=[20])) 13 | -------------------------------------------------------------------------------- /mmdet/configs/dino/dino_4scale_r50_8xb2_36e_coco.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from mmengine.config import read_base 3 | from mmengine.runner.loops import EpochBasedTrainLoop 4 | 5 | with read_base(): 6 | from .dino_4scale_r50_8xb2_12e_coco import * 7 | 8 | max_epochs = 36 9 | train_cfg.update( 10 | dict(type=EpochBasedTrainLoop, max_epochs=max_epochs, val_interval=1)) 11 | 12 | param_scheduler[0].update(dict(milestones=[30])) 13 | -------------------------------------------------------------------------------- /mmdet/models/test_time_augs/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .det_tta import DetTTAModel 3 | from .merge_augs import (merge_aug_bboxes, merge_aug_masks, 4 | merge_aug_proposals, merge_aug_results, 5 | merge_aug_scores) 6 | 7 | __all__ = [ 8 | 'merge_aug_bboxes', 'merge_aug_masks', 'merge_aug_proposals', 9 | 'merge_aug_scores', 'merge_aug_results', 'DetTTAModel' 10 | ] 11 | -------------------------------------------------------------------------------- /configs/free_anchor/freeanchor_x101-32x4d_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './freeanchor_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=32, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | style='pytorch', 12 | init_cfg=dict( 13 | type='Pretrained', checkpoint='open-mmlab://resnext101_32x4d'))) 14 | -------------------------------------------------------------------------------- /configs/gcnet/mask-rcnn_r101-syncbn-gcb-r4-c3-c5_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../mask_rcnn/mask-rcnn_r101_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | norm_cfg=dict(type='SyncBN', requires_grad=True), 5 | norm_eval=False, 6 | plugins=[ 7 | dict( 8 | cfg=dict(type='ContextBlock', ratio=1. / 4), 9 | stages=(False, True, True, True), 10 | position='after_conv3') 11 | ])) 12 | -------------------------------------------------------------------------------- /configs/gcnet/mask-rcnn_r50-syncbn-gcb-r16-c3-c5_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../mask_rcnn/mask-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | norm_cfg=dict(type='SyncBN', requires_grad=True), 5 | norm_eval=False, 6 | plugins=[ 7 | dict( 8 | cfg=dict(type='ContextBlock', ratio=1. / 16), 9 | stages=(False, True, True, True), 10 | position='after_conv3') 11 | ])) 12 | -------------------------------------------------------------------------------- /configs/gcnet/mask-rcnn_r50-syncbn-gcb-r4-c3-c5_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../mask_rcnn/mask-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | norm_cfg=dict(type='SyncBN', requires_grad=True), 5 | norm_eval=False, 6 | plugins=[ 7 | dict( 8 | cfg=dict(type='ContextBlock', ratio=1. / 4), 9 | stages=(False, True, True, True), 10 | position='after_conv3') 11 | ])) 12 | -------------------------------------------------------------------------------- /configs/glip/lvis/glip_atss_swin-l_fpn_dyhead_pretrain_zeroshot_lvis.py: -------------------------------------------------------------------------------- 1 | _base_ = './glip_atss_swin-t_a_fpn_dyhead_pretrain_zeroshot_lvis.py' 2 | 3 | model = dict( 4 | backbone=dict( 5 | embed_dims=192, 6 | depths=[2, 2, 18, 2], 7 | num_heads=[6, 12, 24, 48], 8 | window_size=12, 9 | drop_path_rate=0.4, 10 | ), 11 | neck=dict(in_channels=[384, 768, 1536]), 12 | bbox_head=dict(early_fuse=True, num_dyhead_blocks=8)) 13 | -------------------------------------------------------------------------------- /configs/retinanet/retinanet_x101-64x4d_fpn_ms-640-800-3x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = ['../_base_/models/retinanet_r50_fpn.py', '../common/ms_3x_coco.py'] 2 | # optimizer 3 | model = dict( 4 | backbone=dict( 5 | type='ResNeXt', 6 | depth=101, 7 | groups=64, 8 | base_width=4, 9 | init_cfg=dict( 10 | type='Pretrained', checkpoint='open-mmlab://resnext101_64x4d'))) 11 | optim_wrapper = dict(optimizer=dict(type='SGD', lr=0.01)) 12 | -------------------------------------------------------------------------------- /configs/detectors/cascade-rcnn_r50-sac_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/cascade-rcnn_r50_fpn.py', 3 | '../_base_/datasets/coco_detection.py', 4 | '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py' 5 | ] 6 | 7 | model = dict( 8 | backbone=dict( 9 | type='DetectoRS_ResNet', 10 | conv_cfg=dict(type='ConvAWS'), 11 | sac=dict(type='SAC', use_deform=True), 12 | stage_with_sac=(False, True, True, True))) 13 | -------------------------------------------------------------------------------- /configs/gcnet/mask-rcnn_r101-syncbn-gcb-r16-c3-c5_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../mask_rcnn/mask-rcnn_r101_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | norm_cfg=dict(type='SyncBN', requires_grad=True), 5 | norm_eval=False, 6 | plugins=[ 7 | dict( 8 | cfg=dict(type='ContextBlock', ratio=1. / 16), 9 | stages=(False, True, True, True), 10 | position='after_conv3') 11 | ])) 12 | -------------------------------------------------------------------------------- /configs/htc/htc_r50_fpn_20e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './htc_r50_fpn_1x_coco.py' 2 | 3 | # learning policy 4 | max_epochs = 20 5 | param_scheduler = [ 6 | dict( 7 | type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500), 8 | dict( 9 | type='MultiStepLR', 10 | begin=0, 11 | end=max_epochs, 12 | by_epoch=True, 13 | milestones=[16, 19], 14 | gamma=0.1) 15 | ] 16 | train_cfg = dict(max_epochs=max_epochs) 17 | -------------------------------------------------------------------------------- /configs/scnet/scnet_r50_fpn_20e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './scnet_r50_fpn_1x_coco.py' 2 | # learning policy 3 | max_epochs = 20 4 | param_scheduler = [ 5 | dict( 6 | type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500), 7 | dict( 8 | type='MultiStepLR', 9 | begin=0, 10 | end=max_epochs, 11 | by_epoch=True, 12 | milestones=[16, 19], 13 | gamma=0.1) 14 | ] 15 | train_cfg = dict(max_epochs=max_epochs) 16 | -------------------------------------------------------------------------------- /mmdet/configs/detr/detr_r101_8xb2_500e_coco.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from mmengine.config import read_base 3 | from mmengine.model.weight_init import PretrainedInit 4 | 5 | with read_base(): 6 | from .detr_r50_8xb2_500e_coco import * 7 | 8 | model.update( 9 | dict( 10 | backbone=dict( 11 | depth=101, 12 | init_cfg=dict( 13 | type=PretrainedInit, checkpoint='torchvision://resnet101')))) 14 | -------------------------------------------------------------------------------- /mmdet/configs/dino/dino_5scale_swin_l_8xb2_36e_coco.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from mmengine.config import read_base 3 | from mmengine.runner.loops import EpochBasedTrainLoop 4 | 5 | with read_base(): 6 | from .dino_5scale_swin_l_8xb2_12e_coco import * 7 | 8 | max_epochs = 36 9 | train_cfg.update( 10 | dict(type=EpochBasedTrainLoop, max_epochs=max_epochs, val_interval=1)) 11 | 12 | param_scheduler[0].update(dict(milestones=[27, 33])) 13 | -------------------------------------------------------------------------------- /configs/dcn/mask-rcnn_r50-dconv-c3-c5_fpn_amp-1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../mask_rcnn/mask-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | dcn=dict(type='DCN', deform_groups=1, fallback_on_stride=False), 5 | stage_with_dcn=(False, True, True, True))) 6 | 7 | # MMEngine support the following two ways, users can choose 8 | # according to convenience 9 | # optim_wrapper = dict(type='AmpOptimWrapper') 10 | _base_.optim_wrapper.type = 'AmpOptimWrapper' 11 | -------------------------------------------------------------------------------- /configs/glip/lvis/glip_atss_swin-l_fpn_dyhead_pretrain_zeroshot_mini-lvis.py: -------------------------------------------------------------------------------- 1 | _base_ = './glip_atss_swin-t_a_fpn_dyhead_pretrain_zeroshot_mini-lvis.py' 2 | 3 | model = dict( 4 | backbone=dict( 5 | embed_dims=192, 6 | depths=[2, 2, 18, 2], 7 | num_heads=[6, 12, 24, 48], 8 | window_size=12, 9 | drop_path_rate=0.4, 10 | ), 11 | neck=dict(in_channels=[384, 768, 1536]), 12 | bbox_head=dict(early_fuse=True, num_dyhead_blocks=8)) 13 | -------------------------------------------------------------------------------- /configs/mask_rcnn/mask-rcnn_r50-caffe_fpn_ms-poly-2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_r50-caffe_fpn_ms-poly-1x_coco.py' 2 | 3 | train_cfg = dict(max_epochs=24) 4 | # learning rate 5 | param_scheduler = [ 6 | dict( 7 | type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500), 8 | dict( 9 | type='MultiStepLR', 10 | begin=0, 11 | end=24, 12 | by_epoch=True, 13 | milestones=[16, 22], 14 | gamma=0.1) 15 | ] 16 | -------------------------------------------------------------------------------- /configs/mask_rcnn/mask-rcnn_r50-caffe_fpn_ms-poly-3x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_r50-caffe_fpn_ms-poly-1x_coco.py' 2 | 3 | train_cfg = dict(max_epochs=36) 4 | # learning rate 5 | param_scheduler = [ 6 | dict( 7 | type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500), 8 | dict( 9 | type='MultiStepLR', 10 | begin=0, 11 | end=24, 12 | by_epoch=True, 13 | milestones=[28, 34], 14 | gamma=0.1) 15 | ] 16 | -------------------------------------------------------------------------------- /configs/dcnv2/mask-rcnn_r50-mdconv-c3-c5_fpn_amp-1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../mask_rcnn/mask-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | dcn=dict(type='DCNv2', deform_groups=1, fallback_on_stride=False), 5 | stage_with_dcn=(False, True, True, True))) 6 | 7 | # MMEngine support the following two ways, users can choose 8 | # according to convenience 9 | # optim_wrapper = dict(type='AmpOptimWrapper') 10 | _base_.optim_wrapper.type = 'AmpOptimWrapper' 11 | -------------------------------------------------------------------------------- /configs/foveabox/fovea_r50_fpn_4xb4-2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './fovea_r50_fpn_4xb4-1x_coco.py' 2 | # learning policy 3 | max_epochs = 24 4 | param_scheduler = [ 5 | dict( 6 | type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500), 7 | dict( 8 | type='MultiStepLR', 9 | begin=0, 10 | end=max_epochs, 11 | by_epoch=True, 12 | milestones=[16, 22], 13 | gamma=0.1) 14 | ] 15 | train_cfg = dict(max_epochs=max_epochs) 16 | -------------------------------------------------------------------------------- /configs/gcnet/mask-rcnn_x101-32x4d-syncbn-gcb-r16-c3-c5_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../mask_rcnn/mask-rcnn_x101-32x4d_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | norm_cfg=dict(type='SyncBN', requires_grad=True), 5 | norm_eval=False, 6 | plugins=[ 7 | dict( 8 | cfg=dict(type='ContextBlock', ratio=1. / 16), 9 | stages=(False, True, True, True), 10 | position='after_conv3') 11 | ])) 12 | -------------------------------------------------------------------------------- /configs/gcnet/mask-rcnn_x101-32x4d-syncbn-gcb-r4-c3-c5_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../mask_rcnn/mask-rcnn_x101-32x4d_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | norm_cfg=dict(type='SyncBN', requires_grad=True), 5 | norm_eval=False, 6 | plugins=[ 7 | dict( 8 | cfg=dict(type='ContextBlock', ratio=1. / 4), 9 | stages=(False, True, True, True), 10 | position='after_conv3') 11 | ])) 12 | -------------------------------------------------------------------------------- /configs/grid_rcnn/grid-rcnn_x101-32x4d_fpn_gn-head_2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './grid-rcnn_r50_fpn_gn-head_2x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=32, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | style='pytorch', 12 | init_cfg=dict( 13 | type='Pretrained', checkpoint='open-mmlab://resnext101_32x4d'))) 14 | -------------------------------------------------------------------------------- /configs/hrnet/htc_hrnetv2p-w40_28e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './htc_hrnetv2p-w40_20e_coco.py' 2 | 3 | # learning policy 4 | max_epochs = 28 5 | train_cfg = dict(max_epochs=max_epochs) 6 | param_scheduler = [ 7 | dict( 8 | type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500), 9 | dict( 10 | type='MultiStepLR', 11 | begin=0, 12 | end=max_epochs, 13 | by_epoch=True, 14 | milestones=[24, 27], 15 | gamma=0.1) 16 | ] 17 | -------------------------------------------------------------------------------- /configs/gfl/gfl_r101_fpn_ms-2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './gfl_r50_fpn_ms-2x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNet', 5 | depth=101, 6 | num_stages=4, 7 | out_indices=(0, 1, 2, 3), 8 | frozen_stages=1, 9 | norm_cfg=dict(type='BN', requires_grad=True), 10 | norm_eval=True, 11 | style='pytorch', 12 | init_cfg=dict(type='Pretrained', 13 | checkpoint='torchvision://resnet101'))) 14 | -------------------------------------------------------------------------------- /configs/grid_rcnn/grid-rcnn_x101-64x4d_fpn_gn-head_2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './grid-rcnn_x101-32x4d_fpn_gn-head_2x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=64, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | style='pytorch', 12 | init_cfg=dict( 13 | type='Pretrained', checkpoint='open-mmlab://resnext101_64x4d'))) 14 | -------------------------------------------------------------------------------- /configs/reid/reid_r50_8xb32-6e_mot20train80_test-mot20val20.py: -------------------------------------------------------------------------------- 1 | _base_ = ['./reid_r50_8xb32-6e_mot17train80_test-mot17val20.py'] 2 | model = dict(head=dict(num_classes=1701)) 3 | # data 4 | data_root = 'data/MOT20/' 5 | train_dataloader = dict(dataset=dict(data_root=data_root)) 6 | val_dataloader = dict(dataset=dict(data_root=data_root)) 7 | test_dataloader = val_dataloader 8 | 9 | # train, val, test setting 10 | train_cfg = dict(type='EpochBasedTrainLoop', max_epochs=6, val_interval=7) 11 | -------------------------------------------------------------------------------- /mmdet/configs/panoptic_fpn/panoptic_fpn_r101_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from mmengine.config import read_base 3 | from mmengine.model.weight_init import PretrainedInit 4 | 5 | with read_base(): 6 | from .panoptic_fpn_r50_fpn_1x_coco import * 7 | 8 | model.update( 9 | dict( 10 | backbone=dict( 11 | depth=101, 12 | init_cfg=dict( 13 | type=PretrainedInit, checkpoint='torchvision://resnet101')))) 14 | -------------------------------------------------------------------------------- /mmdet/structures/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .det_data_sample import DetDataSample, OptSampleList, SampleList 3 | from .reid_data_sample import ReIDDataSample 4 | from .track_data_sample import (OptTrackSampleList, TrackDataSample, 5 | TrackSampleList) 6 | 7 | __all__ = [ 8 | 'DetDataSample', 'SampleList', 'OptSampleList', 'TrackDataSample', 9 | 'TrackSampleList', 'OptTrackSampleList', 'ReIDDataSample' 10 | ] 11 | -------------------------------------------------------------------------------- /configs/common/lsj-200e_coco-detection.py: -------------------------------------------------------------------------------- 1 | _base_ = './lsj-100e_coco-detection.py' 2 | 3 | # 8x25=200e 4 | train_dataloader = dict(dataset=dict(times=8)) 5 | 6 | # learning rate 7 | param_scheduler = [ 8 | dict( 9 | type='LinearLR', start_factor=0.067, by_epoch=False, begin=0, 10 | end=1000), 11 | dict( 12 | type='MultiStepLR', 13 | begin=0, 14 | end=25, 15 | by_epoch=True, 16 | milestones=[22, 24], 17 | gamma=0.1) 18 | ] 19 | -------------------------------------------------------------------------------- /configs/common/lsj-200e_coco-instance.py: -------------------------------------------------------------------------------- 1 | _base_ = './lsj-100e_coco-instance.py' 2 | 3 | # 8x25=200e 4 | train_dataloader = dict(dataset=dict(times=8)) 5 | 6 | # learning rate 7 | param_scheduler = [ 8 | dict( 9 | type='LinearLR', start_factor=0.067, by_epoch=False, begin=0, 10 | end=1000), 11 | dict( 12 | type='MultiStepLR', 13 | begin=0, 14 | end=25, 15 | by_epoch=True, 16 | milestones=[22, 24], 17 | gamma=0.1) 18 | ] 19 | -------------------------------------------------------------------------------- /configs/grounding_dino/lvis/grounding_dino_swin-b_pretrain_zeroshot_lvis.py: -------------------------------------------------------------------------------- 1 | _base_ = './grounding_dino_swin-t_pretrain_zeroshot_lvis.py' 2 | 3 | model = dict( 4 | type='GroundingDINO', 5 | backbone=dict( 6 | pretrain_img_size=384, 7 | embed_dims=128, 8 | depths=[2, 2, 18, 2], 9 | num_heads=[4, 8, 16, 32], 10 | window_size=12, 11 | drop_path_rate=0.3, 12 | patch_norm=True), 13 | neck=dict(in_channels=[256, 512, 1024]), 14 | ) 15 | -------------------------------------------------------------------------------- /configs/hrnet/mask-rcnn_hrnetv2p-w18-2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_hrnetv2p-w18-1x_coco.py' 2 | 3 | # learning policy 4 | max_epochs = 24 5 | train_cfg = dict(max_epochs=max_epochs) 6 | param_scheduler = [ 7 | dict( 8 | type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500), 9 | dict( 10 | type='MultiStepLR', 11 | begin=0, 12 | end=max_epochs, 13 | by_epoch=True, 14 | milestones=[16, 22], 15 | gamma=0.1) 16 | ] 17 | -------------------------------------------------------------------------------- /configs/hrnet/mask-rcnn_hrnetv2p-w32-2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_hrnetv2p-w32-1x_coco.py' 2 | 3 | # learning policy 4 | max_epochs = 24 5 | train_cfg = dict(max_epochs=max_epochs) 6 | param_scheduler = [ 7 | dict( 8 | type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500), 9 | dict( 10 | type='MultiStepLR', 11 | begin=0, 12 | end=max_epochs, 13 | by_epoch=True, 14 | milestones=[16, 22], 15 | gamma=0.1) 16 | ] 17 | -------------------------------------------------------------------------------- /configs/hrnet/mask-rcnn_hrnetv2p-w40-2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_hrnetv2p-w40_1x_coco.py' 2 | 3 | # learning policy 4 | max_epochs = 24 5 | train_cfg = dict(max_epochs=max_epochs) 6 | param_scheduler = [ 7 | dict( 8 | type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500), 9 | dict( 10 | type='MultiStepLR', 11 | begin=0, 12 | end=max_epochs, 13 | by_epoch=True, 14 | milestones=[16, 22], 15 | gamma=0.1) 16 | ] 17 | -------------------------------------------------------------------------------- /configs/dcn/faster-rcnn_r50_fpn_dpool_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../faster_rcnn/faster-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | roi_head=dict( 4 | bbox_roi_extractor=dict( 5 | type='SingleRoIExtractor', 6 | roi_layer=dict( 7 | _delete_=True, 8 | type='DeformRoIPoolPack', 9 | output_size=7, 10 | output_channels=256), 11 | out_channels=256, 12 | featmap_strides=[4, 8, 16, 32]))) 13 | -------------------------------------------------------------------------------- /configs/grounding_dino/refcoco/grounding_dino_swin-b_pretrain_zeroshot_refexp.py: -------------------------------------------------------------------------------- 1 | _base_ = './grounding_dino_swin-t_pretrain_zeroshot_refexp.py' 2 | 3 | model = dict( 4 | type='GroundingDINO', 5 | backbone=dict( 6 | pretrain_img_size=384, 7 | embed_dims=128, 8 | depths=[2, 2, 18, 2], 9 | num_heads=[4, 8, 16, 32], 10 | window_size=12, 11 | drop_path_rate=0.3, 12 | patch_norm=True), 13 | neck=dict(in_channels=[256, 512, 1024]), 14 | ) 15 | -------------------------------------------------------------------------------- /configs/hrnet/faster-rcnn_hrnetv2p-w18-2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './faster-rcnn_hrnetv2p-w18-1x_coco.py' 2 | 3 | # learning policy 4 | max_epochs = 24 5 | train_cfg = dict(max_epochs=max_epochs) 6 | param_scheduler = [ 7 | dict( 8 | type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500), 9 | dict( 10 | type='MultiStepLR', 11 | begin=0, 12 | end=max_epochs, 13 | by_epoch=True, 14 | milestones=[16, 22], 15 | gamma=0.1) 16 | ] 17 | -------------------------------------------------------------------------------- /configs/hrnet/faster-rcnn_hrnetv2p-w32_2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './faster-rcnn_hrnetv2p-w32-1x_coco.py' 2 | 3 | # learning policy 4 | max_epochs = 24 5 | train_cfg = dict(max_epochs=max_epochs) 6 | param_scheduler = [ 7 | dict( 8 | type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500), 9 | dict( 10 | type='MultiStepLR', 11 | begin=0, 12 | end=max_epochs, 13 | by_epoch=True, 14 | milestones=[16, 22], 15 | gamma=0.1) 16 | ] 17 | -------------------------------------------------------------------------------- /configs/hrnet/faster-rcnn_hrnetv2p-w40_2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './faster-rcnn_hrnetv2p-w40-1x_coco.py' 2 | 3 | # learning policy 4 | max_epochs = 24 5 | train_cfg = dict(max_epochs=max_epochs) 6 | param_scheduler = [ 7 | dict( 8 | type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500), 9 | dict( 10 | type='MultiStepLR', 11 | begin=0, 12 | end=max_epochs, 13 | by_epoch=True, 14 | milestones=[16, 22], 15 | gamma=0.1) 16 | ] 17 | -------------------------------------------------------------------------------- /mmdet/configs/panoptic_fpn/panoptic_fpn_r101_fpn_ms_3x_coco.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from mmengine.config import read_base 3 | from mmengine.model.weight_init import PretrainedInit 4 | 5 | with read_base(): 6 | from .panoptic_fpn_r50_fpn_ms_3x_coco import * 7 | 8 | model.update( 9 | dict( 10 | backbone=dict( 11 | depth=101, 12 | init_cfg=dict( 13 | type=PretrainedInit, checkpoint='torchvision://resnet101')))) 14 | -------------------------------------------------------------------------------- /mmdet/models/task_modules/tracking/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .aflink import AppearanceFreeLink 3 | from .camera_motion_compensation import CameraMotionCompensation 4 | from .interpolation import InterpolateTracklets 5 | from .kalman_filter import KalmanFilter 6 | from .similarity import embed_similarity 7 | 8 | __all__ = [ 9 | 'KalmanFilter', 'InterpolateTracklets', 'embed_similarity', 10 | 'AppearanceFreeLink', 'CameraMotionCompensation' 11 | ] 12 | -------------------------------------------------------------------------------- /mmdet/models/tracking_heads/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .mask2former_track_head import Mask2FormerTrackHead 3 | from .quasi_dense_embed_head import QuasiDenseEmbedHead 4 | from .quasi_dense_track_head import QuasiDenseTrackHead 5 | from .roi_embed_head import RoIEmbedHead 6 | from .roi_track_head import RoITrackHead 7 | 8 | __all__ = [ 9 | 'QuasiDenseEmbedHead', 'QuasiDenseTrackHead', 'Mask2FormerTrackHead', 10 | 'RoIEmbedHead', 'RoITrackHead' 11 | ] 12 | -------------------------------------------------------------------------------- /projects/DiffusionDet/diffusiondet/__init__.py: -------------------------------------------------------------------------------- 1 | from .diffusiondet import DiffusionDet 2 | from .head import (DynamicConv, DynamicDiffusionDetHead, 3 | SingleDiffusionDetHead, SinusoidalPositionEmbeddings) 4 | from .loss import DiffusionDetCriterion, DiffusionDetMatcher 5 | 6 | __all__ = [ 7 | 'DiffusionDet', 'DynamicDiffusionDetHead', 'SingleDiffusionDetHead', 8 | 'SinusoidalPositionEmbeddings', 'DynamicConv', 'DiffusionDetCriterion', 9 | 'DiffusionDetMatcher' 10 | ] 11 | -------------------------------------------------------------------------------- /configs/gcnet/cascade-mask-rcnn_x101-32x4d-syncbn-r16-gcb-c3-c5_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../cascade_rcnn/cascade-mask-rcnn_x101-32x4d_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | norm_cfg=dict(type='SyncBN', requires_grad=True), 5 | norm_eval=False, 6 | plugins=[ 7 | dict( 8 | cfg=dict(type='ContextBlock', ratio=1. / 16), 9 | stages=(False, True, True, True), 10 | position='after_conv3') 11 | ])) 12 | -------------------------------------------------------------------------------- /configs/gcnet/cascade-mask-rcnn_x101-32x4d-syncbn-r4-gcb-c3-c5_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../cascade_rcnn/cascade-mask-rcnn_x101-32x4d_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | norm_cfg=dict(type='SyncBN', requires_grad=True), 5 | norm_eval=False, 6 | plugins=[ 7 | dict( 8 | cfg=dict(type='ContextBlock', ratio=1. / 4), 9 | stages=(False, True, True, True), 10 | position='after_conv3') 11 | ])) 12 | -------------------------------------------------------------------------------- /configs/grounding_dino/dod/grounding_dino_swin-b_pretrain_zeroshot_concat_dod.py: -------------------------------------------------------------------------------- 1 | _base_ = 'grounding_dino_swin-t_pretrain_zeroshot_concat_dod.py' 2 | 3 | model = dict( 4 | type='GroundingDINO', 5 | backbone=dict( 6 | pretrain_img_size=384, 7 | embed_dims=128, 8 | depths=[2, 2, 18, 2], 9 | num_heads=[4, 8, 16, 32], 10 | window_size=12, 11 | drop_path_rate=0.3, 12 | patch_norm=True), 13 | neck=dict(in_channels=[256, 512, 1024]), 14 | ) 15 | -------------------------------------------------------------------------------- /configs/grounding_dino/lvis/grounding_dino_swin-b_pretrain_zeroshot_mini-lvis.py: -------------------------------------------------------------------------------- 1 | _base_ = './grounding_dino_swin-t_pretrain_zeroshot_mini-lvis.py' 2 | 3 | model = dict( 4 | type='GroundingDINO', 5 | backbone=dict( 6 | pretrain_img_size=384, 7 | embed_dims=128, 8 | depths=[2, 2, 18, 2], 9 | num_heads=[4, 8, 16, 32], 10 | window_size=12, 11 | drop_path_rate=0.3, 12 | patch_norm=True), 13 | neck=dict(in_channels=[256, 512, 1024]), 14 | ) 15 | -------------------------------------------------------------------------------- /configs/hrnet/htc_x101-64x4d_fpn_16xb1-28e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../htc/htc_x101-64x4d_fpn_16xb1-20e_coco.py' 2 | 3 | # learning policy 4 | max_epochs = 28 5 | train_cfg = dict(max_epochs=max_epochs) 6 | param_scheduler = [ 7 | dict( 8 | type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500), 9 | dict( 10 | type='MultiStepLR', 11 | begin=0, 12 | end=max_epochs, 13 | by_epoch=True, 14 | milestones=[24, 27], 15 | gamma=0.1) 16 | ] 17 | -------------------------------------------------------------------------------- /configs/fsaf/fsaf_x101-64x4d_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './fsaf_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=64, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | norm_cfg=dict(type='BN', requires_grad=True), 12 | style='pytorch', 13 | init_cfg=dict( 14 | type='Pretrained', checkpoint='open-mmlab://resnext101_64x4d'))) 15 | -------------------------------------------------------------------------------- /configs/grounding_dino/grounding_dino_swin-b_pretrain_mixeddata.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | './grounding_dino_swin-t_pretrain_obj365_goldg_cap4m.py', 3 | ] 4 | 5 | model = dict( 6 | type='GroundingDINO', 7 | backbone=dict( 8 | pretrain_img_size=384, 9 | embed_dims=128, 10 | depths=[2, 2, 18, 2], 11 | num_heads=[4, 8, 16, 32], 12 | window_size=12, 13 | drop_path_rate=0.3, 14 | patch_norm=True), 15 | neck=dict(in_channels=[256, 512, 1024]), 16 | ) 17 | -------------------------------------------------------------------------------- /configs/hrnet/fcos_hrnetv2p-w18-gn-head_4xb4-2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './fcos_hrnetv2p-w18-gn-head_4xb4-1x_coco.py' 2 | 3 | # learning policy 4 | max_epochs = 24 5 | train_cfg = dict(max_epochs=max_epochs) 6 | param_scheduler = [ 7 | dict( 8 | type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500), 9 | dict( 10 | type='MultiStepLR', 11 | begin=0, 12 | end=max_epochs, 13 | by_epoch=True, 14 | milestones=[16, 22], 15 | gamma=0.1) 16 | ] 17 | -------------------------------------------------------------------------------- /configs/hrnet/fcos_hrnetv2p-w32-gn-head_4xb4-2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './fcos_hrnetv2p-w32-gn-head_4xb4-1x_coco.py' 2 | 3 | # learning policy 4 | max_epochs = 24 5 | train_cfg = dict(max_epochs=max_epochs) 6 | param_scheduler = [ 7 | dict( 8 | type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500), 9 | dict( 10 | type='MultiStepLR', 11 | begin=0, 12 | end=max_epochs, 13 | by_epoch=True, 14 | milestones=[16, 22], 15 | gamma=0.1) 16 | ] 17 | -------------------------------------------------------------------------------- /configs/hrnet/htc_hrnetv2p-w18_20e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './htc_hrnetv2p-w32_20e_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | extra=dict( 5 | stage2=dict(num_channels=(18, 36)), 6 | stage3=dict(num_channels=(18, 36, 72)), 7 | stage4=dict(num_channels=(18, 36, 72, 144))), 8 | init_cfg=dict( 9 | type='Pretrained', checkpoint='open-mmlab://msra/hrnetv2_w18')), 10 | neck=dict(type='HRFPN', in_channels=[18, 36, 72, 144], out_channels=256)) 11 | -------------------------------------------------------------------------------- /configs/paa/paa_r101_fpn_2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './paa_r101_fpn_1x_coco.py' 2 | max_epochs = 24 3 | 4 | # learning rate 5 | param_scheduler = [ 6 | dict( 7 | type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500), 8 | dict( 9 | type='MultiStepLR', 10 | begin=0, 11 | end=max_epochs, 12 | by_epoch=True, 13 | milestones=[16, 22], 14 | gamma=0.1) 15 | ] 16 | 17 | # training schedule for 2x 18 | train_cfg = dict(max_epochs=max_epochs) 19 | -------------------------------------------------------------------------------- /configs/paa/paa_r50_fpn_1.5x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './paa_r50_fpn_1x_coco.py' 2 | max_epochs = 18 3 | 4 | # learning rate 5 | param_scheduler = [ 6 | dict( 7 | type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500), 8 | dict( 9 | type='MultiStepLR', 10 | begin=0, 11 | end=max_epochs, 12 | by_epoch=True, 13 | milestones=[12, 16], 14 | gamma=0.1) 15 | ] 16 | 17 | # training schedule for 1.5x 18 | train_cfg = dict(max_epochs=max_epochs) 19 | -------------------------------------------------------------------------------- /configs/paa/paa_r50_fpn_2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './paa_r50_fpn_1x_coco.py' 2 | max_epochs = 24 3 | 4 | # learning rate 5 | param_scheduler = [ 6 | dict( 7 | type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500), 8 | dict( 9 | type='MultiStepLR', 10 | begin=0, 11 | end=max_epochs, 12 | by_epoch=True, 13 | milestones=[16, 22], 14 | gamma=0.1) 15 | ] 16 | 17 | # training schedule for 2x 18 | train_cfg = dict(max_epochs=max_epochs) 19 | -------------------------------------------------------------------------------- /configs/regnet/faster-rcnn_regnetx-3.2GF_fpn_2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './faster-rcnn_regnetx-3.2GF_fpn_1x_coco.py' 2 | 3 | # learning policy 4 | max_epochs = 24 5 | train_cfg = dict(max_epochs=max_epochs) 6 | param_scheduler = [ 7 | dict( 8 | type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500), 9 | dict( 10 | type='MultiStepLR', 11 | begin=0, 12 | end=max_epochs, 13 | by_epoch=True, 14 | milestones=[16, 22], 15 | gamma=0.1) 16 | ] 17 | -------------------------------------------------------------------------------- /configs/retinanet/retinanet_r50-caffe_fpn_ms-2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './retinanet_r50-caffe_fpn_ms-1x_coco.py' 2 | # training schedule for 2x 3 | train_cfg = dict(max_epochs=24) 4 | 5 | # learning rate policy 6 | param_scheduler = [ 7 | dict( 8 | type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500), 9 | dict( 10 | type='MultiStepLR', 11 | begin=0, 12 | end=24, 13 | by_epoch=True, 14 | milestones=[16, 22], 15 | gamma=0.1) 16 | ] 17 | -------------------------------------------------------------------------------- /configs/rpn/rpn_x101-32x4d_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './rpn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=32, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | norm_cfg=dict(type='BN', requires_grad=True), 12 | style='pytorch', 13 | init_cfg=dict( 14 | type='Pretrained', checkpoint='open-mmlab://resnext101_32x4d'))) 15 | -------------------------------------------------------------------------------- /configs/rpn/rpn_x101-32x4d_fpn_2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './rpn_r50_fpn_2x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=32, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | norm_cfg=dict(type='BN', requires_grad=True), 12 | style='pytorch', 13 | init_cfg=dict( 14 | type='Pretrained', checkpoint='open-mmlab://resnext101_32x4d'))) 15 | -------------------------------------------------------------------------------- /configs/rpn/rpn_x101-64x4d_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './rpn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=64, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | norm_cfg=dict(type='BN', requires_grad=True), 12 | style='pytorch', 13 | init_cfg=dict( 14 | type='Pretrained', checkpoint='open-mmlab://resnext101_64x4d'))) 15 | -------------------------------------------------------------------------------- /configs/rpn/rpn_x101-64x4d_fpn_2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './rpn_r50_fpn_2x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=64, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | norm_cfg=dict(type='BN', requires_grad=True), 12 | style='pytorch', 13 | init_cfg=dict( 14 | type='Pretrained', checkpoint='open-mmlab://resnext101_64x4d'))) 15 | -------------------------------------------------------------------------------- /mmdet/configs/mask_rcnn/mask_rcnn_r50_fpn_ms_poly_-3x_coco.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | 3 | # Please refer to https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#a-pure-python-style-configuration-file-beta for more details. # noqa 4 | # mmcv >= 2.0.1 5 | # mmengine >= 0.8.0 6 | 7 | from mmengine.config import read_base 8 | 9 | with read_base(): 10 | from .._base_.models.mask_rcnn_r50_fpn import * 11 | from ..common.ms_poly_3x_coco_instance import * 12 | -------------------------------------------------------------------------------- /configs/dcnv2/faster-rcnn_r50_fpn_mdpool_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../faster_rcnn/faster-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | roi_head=dict( 4 | bbox_roi_extractor=dict( 5 | type='SingleRoIExtractor', 6 | roi_layer=dict( 7 | _delete_=True, 8 | type='ModulatedDeformRoIPoolPack', 9 | output_size=7, 10 | output_channels=256), 11 | out_channels=256, 12 | featmap_strides=[4, 8, 16, 32]))) 13 | -------------------------------------------------------------------------------- /configs/mask_rcnn/mask-rcnn_r50-caffe_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | # use caffe img_norm 4 | data_preprocessor=dict( 5 | mean=[103.530, 116.280, 123.675], 6 | std=[1.0, 1.0, 1.0], 7 | bgr_to_rgb=False), 8 | backbone=dict( 9 | norm_cfg=dict(requires_grad=False), 10 | style='caffe', 11 | init_cfg=dict( 12 | type='Pretrained', 13 | checkpoint='open-mmlab://detectron2/resnet50_caffe'))) 14 | -------------------------------------------------------------------------------- /configs/retinanet/retinanet_r50-caffe_fpn_ms-3x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './retinanet_r50-caffe_fpn_ms-1x_coco.py' 2 | 3 | # training schedule for 2x 4 | train_cfg = dict(max_epochs=36) 5 | 6 | # learning rate policy 7 | param_scheduler = [ 8 | dict( 9 | type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500), 10 | dict( 11 | type='MultiStepLR', 12 | begin=0, 13 | end=36, 14 | by_epoch=True, 15 | milestones=[28, 34], 16 | gamma=0.1) 17 | ] 18 | -------------------------------------------------------------------------------- /mmdet/configs/detr/detr_r18_8xb2_500e_coco.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from mmengine.config import read_base 3 | from mmengine.model.weight_init import PretrainedInit 4 | 5 | with read_base(): 6 | from .detr_r50_8xb2_500e_coco import * 7 | 8 | model.update( 9 | dict( 10 | backbone=dict( 11 | depth=18, 12 | init_cfg=dict( 13 | type=PretrainedInit, checkpoint='torchvision://resnet18')), 14 | neck=dict(in_channels=[512]))) 15 | -------------------------------------------------------------------------------- /configs/empirical_attention/faster-rcnn_r50-attn0010_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../faster_rcnn/faster-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict(plugins=[ 4 | dict( 5 | cfg=dict( 6 | type='GeneralizedAttention', 7 | spatial_range=-1, 8 | num_heads=8, 9 | attention_type='0010', 10 | kv_stride=2), 11 | stages=(False, False, True, True), 12 | position='after_conv2') 13 | ])) 14 | -------------------------------------------------------------------------------- /configs/empirical_attention/faster-rcnn_r50-attn1111_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../faster_rcnn/faster-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict(plugins=[ 4 | dict( 5 | cfg=dict( 6 | type='GeneralizedAttention', 7 | spatial_range=-1, 8 | num_heads=8, 9 | attention_type='1111', 10 | kv_stride=2), 11 | stages=(False, False, True, True), 12 | position='after_conv2') 13 | ])) 14 | -------------------------------------------------------------------------------- /configs/gcnet/cascade-mask-rcnn_x101-32x4d-syncbn-dconv-c3-c5-r16-gcb-c3-c5_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../dcn/cascade-mask-rcnn_x101-32x4d-dconv-c3-c5_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | norm_cfg=dict(type='SyncBN', requires_grad=True), 5 | norm_eval=False, 6 | plugins=[ 7 | dict( 8 | cfg=dict(type='ContextBlock', ratio=1. / 16), 9 | stages=(False, True, True, True), 10 | position='after_conv3') 11 | ])) 12 | -------------------------------------------------------------------------------- /configs/gcnet/cascade-mask-rcnn_x101-32x4d-syncbn-dconv-c3-c5-r4-gcb-c3-c5_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = '../dcn/cascade-mask-rcnn_x101-32x4d-dconv-c3-c5_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | norm_cfg=dict(type='SyncBN', requires_grad=True), 5 | norm_eval=False, 6 | plugins=[ 7 | dict( 8 | cfg=dict(type='ContextBlock', ratio=1. / 4), 9 | stages=(False, True, True, True), 10 | position='after_conv3') 11 | ])) 12 | -------------------------------------------------------------------------------- /configs/hrnet/mask-rcnn_hrnetv2p-w18-1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_hrnetv2p-w32-1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | extra=dict( 5 | stage2=dict(num_channels=(18, 36)), 6 | stage3=dict(num_channels=(18, 36, 72)), 7 | stage4=dict(num_channels=(18, 36, 72, 144))), 8 | init_cfg=dict( 9 | type='Pretrained', checkpoint='open-mmlab://msra/hrnetv2_w18')), 10 | neck=dict(type='HRFPN', in_channels=[18, 36, 72, 144], out_channels=256)) 11 | -------------------------------------------------------------------------------- /configs/ms_rcnn/ms-rcnn_x101-32x4d_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './ms-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=32, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | norm_cfg=dict(type='BN', requires_grad=True), 12 | style='pytorch', 13 | init_cfg=dict( 14 | type='Pretrained', checkpoint='open-mmlab://resnext101_32x4d'))) 15 | -------------------------------------------------------------------------------- /configs/ms_rcnn/ms-rcnn_x101-64x4d_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './ms-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=64, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | norm_cfg=dict(type='BN', requires_grad=True), 12 | style='pytorch', 13 | init_cfg=dict( 14 | type='Pretrained', checkpoint='open-mmlab://resnext101_64x4d'))) 15 | -------------------------------------------------------------------------------- /configs/qdtrack/qdtrack_faster-rcnn_r50_fpn_8xb2-4e_mot17halftrain_test-mot17halfval.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | './qdtrack_faster-rcnn_r50_fpn_4e_base.py', 3 | '../_base_/datasets/mot_challenge.py', 4 | ] 5 | 6 | # evaluator 7 | val_evaluator = [ 8 | dict(type='CocoVideoMetric', metric=['bbox'], classwise=True), 9 | dict(type='MOTChallengeMetric', metric=['HOTA', 'CLEAR', 'Identity']) 10 | ] 11 | 12 | test_evaluator = val_evaluator 13 | # The fluctuation of HOTA is about +-1. 14 | randomness = dict(seed=6) 15 | -------------------------------------------------------------------------------- /mmdet/configs/deformable_detr/deformable_detr_refine_r50_16xb2_50e_coco.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | 3 | # Please refer to https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#a-pure-python-style-configuration-file-beta for more details. # noqa 4 | # mmcv >= 2.0.1 5 | # mmengine >= 0.8.0 6 | 7 | from mmengine.config import read_base 8 | 9 | with read_base(): 10 | from .deformable_detr_r50_16xb2_50e_coco import * 11 | 12 | model.update(dict(with_box_refine=True)) 13 | -------------------------------------------------------------------------------- /configs/gn/mask-rcnn_r101_fpn_gn-all_3x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_r101_fpn_gn-all_2x_coco.py' 2 | 3 | # learning policy 4 | max_epochs = 36 5 | train_cfg = dict(max_epochs=max_epochs) 6 | 7 | # learning rate 8 | param_scheduler = [ 9 | dict( 10 | type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500), 11 | dict( 12 | type='MultiStepLR', 13 | begin=0, 14 | end=max_epochs, 15 | by_epoch=True, 16 | milestones=[28, 34], 17 | gamma=0.1) 18 | ] 19 | -------------------------------------------------------------------------------- /configs/gn/mask-rcnn_r50_fpn_gn-all_3x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_r50_fpn_gn-all_2x_coco.py' 2 | 3 | # learning policy 4 | max_epochs = 36 5 | train_cfg = dict(max_epochs=max_epochs) 6 | 7 | # learning rate 8 | param_scheduler = [ 9 | dict( 10 | type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500), 11 | dict( 12 | type='MultiStepLR', 13 | begin=0, 14 | end=max_epochs, 15 | by_epoch=True, 16 | milestones=[28, 34], 17 | gamma=0.1) 18 | ] 19 | -------------------------------------------------------------------------------- /configs/point_rend/point-rend_r50-caffe_fpn_ms-3x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './point-rend_r50-caffe_fpn_ms-1x_coco.py' 2 | 3 | max_epochs = 36 4 | 5 | # learning policy 6 | param_scheduler = [ 7 | dict( 8 | type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500), 9 | dict( 10 | type='MultiStepLR', 11 | begin=0, 12 | end=max_epochs, 13 | by_epoch=True, 14 | milestones=[28, 34], 15 | gamma=0.1) 16 | ] 17 | 18 | train_cfg = dict(max_epochs=max_epochs) 19 | -------------------------------------------------------------------------------- /configs/retinanet/retinanet_x101-32x4d_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './retinanet_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=32, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | norm_cfg=dict(type='BN', requires_grad=True), 12 | style='pytorch', 13 | init_cfg=dict( 14 | type='Pretrained', checkpoint='open-mmlab://resnext101_32x4d'))) 15 | -------------------------------------------------------------------------------- /configs/retinanet/retinanet_x101-32x4d_fpn_2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './retinanet_r50_fpn_2x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=32, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | norm_cfg=dict(type='BN', requires_grad=True), 12 | style='pytorch', 13 | init_cfg=dict( 14 | type='Pretrained', checkpoint='open-mmlab://resnext101_32x4d'))) 15 | -------------------------------------------------------------------------------- /configs/retinanet/retinanet_x101-64x4d_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './retinanet_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=64, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | norm_cfg=dict(type='BN', requires_grad=True), 12 | style='pytorch', 13 | init_cfg=dict( 14 | type='Pretrained', checkpoint='open-mmlab://resnext101_64x4d'))) 15 | -------------------------------------------------------------------------------- /configs/retinanet/retinanet_x101-64x4d_fpn_2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './retinanet_r50_fpn_2x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=64, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | norm_cfg=dict(type='BN', requires_grad=True), 12 | style='pytorch', 13 | init_cfg=dict( 14 | type='Pretrained', checkpoint='open-mmlab://resnext101_64x4d'))) 15 | -------------------------------------------------------------------------------- /configs/rpn/rpn_r50_fpn_2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './rpn_r50_fpn_1x_coco.py' 2 | 3 | # learning policy 4 | max_epochs = 24 5 | train_cfg = dict( 6 | type='EpochBasedTrainLoop', max_epochs=max_epochs, val_interval=1) 7 | param_scheduler = [ 8 | dict( 9 | type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500), 10 | dict( 11 | type='MultiStepLR', 12 | begin=0, 13 | end=max_epochs, 14 | by_epoch=True, 15 | milestones=[16, 22], 16 | gamma=0.1) 17 | ] 18 | -------------------------------------------------------------------------------- /configs/ghm/retinanet_x101-32x4d_fpn_ghm-1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './retinanet_r50_fpn_ghm-1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=32, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | norm_cfg=dict(type='BN', requires_grad=True), 12 | style='pytorch', 13 | init_cfg=dict( 14 | type='Pretrained', checkpoint='open-mmlab://resnext101_32x4d'))) 15 | -------------------------------------------------------------------------------- /configs/ghm/retinanet_x101-64x4d_fpn_ghm-1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './retinanet_r50_fpn_ghm-1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=64, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | norm_cfg=dict(type='BN', requires_grad=True), 12 | style='pytorch', 13 | init_cfg=dict( 14 | type='Pretrained', checkpoint='open-mmlab://resnext101_64x4d'))) 15 | -------------------------------------------------------------------------------- /configs/guided_anchoring/ga-rpn_x101-32x4d_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './ga-rpn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=32, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | norm_cfg=dict(type='BN', requires_grad=True), 12 | style='pytorch', 13 | init_cfg=dict( 14 | type='Pretrained', checkpoint='open-mmlab://resnext101_32x4d'))) 15 | -------------------------------------------------------------------------------- /configs/guided_anchoring/ga-rpn_x101-64x4d_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './ga-rpn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=64, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | norm_cfg=dict(type='BN', requires_grad=True), 12 | style='pytorch', 13 | init_cfg=dict( 14 | type='Pretrained', checkpoint='open-mmlab://resnext101_64x4d'))) 15 | -------------------------------------------------------------------------------- /configs/lvis/mask-rcnn_r50_fpn_sample1e-3_ms-1x_lvis-v1.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/mask-rcnn_r50_fpn.py', 3 | '../_base_/datasets/lvis_v1_instance.py', 4 | '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py' 5 | ] 6 | model = dict( 7 | roi_head=dict( 8 | bbox_head=dict(num_classes=1203), mask_head=dict(num_classes=1203)), 9 | test_cfg=dict( 10 | rcnn=dict( 11 | score_thr=0.0001, 12 | # LVIS allows up to 300 13 | max_per_img=300))) 14 | -------------------------------------------------------------------------------- /configs/mask_rcnn/mask-rcnn_x101-32x4d_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_r101_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=32, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | norm_cfg=dict(type='BN', requires_grad=True), 12 | style='pytorch', 13 | init_cfg=dict( 14 | type='Pretrained', checkpoint='open-mmlab://resnext101_32x4d'))) 15 | -------------------------------------------------------------------------------- /configs/mask_rcnn/mask-rcnn_x101-32x4d_fpn_2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_r101_fpn_2x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=32, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | norm_cfg=dict(type='BN', requires_grad=True), 12 | style='pytorch', 13 | init_cfg=dict( 14 | type='Pretrained', checkpoint='open-mmlab://resnext101_32x4d'))) 15 | -------------------------------------------------------------------------------- /configs/selfsup_pretrain/mask-rcnn_r50-mocov2-pre_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/mask-rcnn_r50_fpn.py', 3 | '../_base_/datasets/coco_instance.py', 4 | '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py' 5 | ] 6 | 7 | model = dict( 8 | backbone=dict( 9 | frozen_stages=0, 10 | norm_cfg=dict(type='SyncBN', requires_grad=True), 11 | norm_eval=False, 12 | init_cfg=dict( 13 | type='Pretrained', checkpoint='./mocov2_r50_800ep_pretrain.pth'))) 14 | -------------------------------------------------------------------------------- /configs/selfsup_pretrain/mask-rcnn_r50-swav-pre_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/mask-rcnn_r50_fpn.py', 3 | '../_base_/datasets/coco_instance.py', 4 | '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py' 5 | ] 6 | 7 | model = dict( 8 | backbone=dict( 9 | frozen_stages=0, 10 | norm_cfg=dict(type='SyncBN', requires_grad=True), 11 | norm_eval=False, 12 | init_cfg=dict( 13 | type='Pretrained', checkpoint='./swav_800ep_pretrain.pth.tar'))) 14 | -------------------------------------------------------------------------------- /mmdet/configs/deformable_detr/deformable_detr_refine_twostage_r50_16xb2_50e_coco.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | 3 | # Please refer to https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#a-pure-python-style-configuration-file-beta for more details. # noqa 4 | # mmcv >= 2.0.1 5 | # mmengine >= 0.8.0 6 | 7 | from mmengine.config import read_base 8 | 9 | with read_base(): 10 | from .deformable_detr_refine_r50_16xb2_50e_coco import * 11 | 12 | model.update(dict(as_two_stage=True)) 13 | -------------------------------------------------------------------------------- /configs/cascade_rcnn/cascade-rcnn_x101-32x4d_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './cascade-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=32, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | norm_cfg=dict(type='BN', requires_grad=True), 12 | style='pytorch', 13 | init_cfg=dict( 14 | type='Pretrained', checkpoint='open-mmlab://resnext101_32x4d'))) 15 | -------------------------------------------------------------------------------- /configs/faster_rcnn/faster-rcnn_x101-32x4d_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './faster-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=32, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | norm_cfg=dict(type='BN', requires_grad=True), 12 | style='pytorch', 13 | init_cfg=dict( 14 | type='Pretrained', checkpoint='open-mmlab://resnext101_32x4d'))) 15 | -------------------------------------------------------------------------------- /configs/faster_rcnn/faster-rcnn_x101-32x4d_fpn_2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './faster-rcnn_r50_fpn_2x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=32, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | norm_cfg=dict(type='BN', requires_grad=True), 12 | style='pytorch', 13 | init_cfg=dict( 14 | type='Pretrained', checkpoint='open-mmlab://resnext101_32x4d'))) 15 | -------------------------------------------------------------------------------- /configs/faster_rcnn/faster-rcnn_x101-64x4d_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './faster-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=64, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | norm_cfg=dict(type='BN', requires_grad=True), 12 | style='pytorch', 13 | init_cfg=dict( 14 | type='Pretrained', checkpoint='open-mmlab://resnext101_64x4d'))) 15 | -------------------------------------------------------------------------------- /configs/faster_rcnn/faster-rcnn_x101-64x4d_fpn_2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './faster-rcnn_r50_fpn_2x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=64, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | norm_cfg=dict(type='BN', requires_grad=True), 12 | style='pytorch', 13 | init_cfg=dict( 14 | type='Pretrained', checkpoint='open-mmlab://resnext101_64x4d'))) 15 | -------------------------------------------------------------------------------- /configs/gn+ws/mask-rcnn_r101_fpn_gn-ws-all_20-23-24e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_r101_fpn_gn-ws-all_2x_coco.py' 2 | # learning policy 3 | max_epochs = 24 4 | train_cfg = dict(max_epochs=max_epochs) 5 | 6 | # learning rate 7 | param_scheduler = [ 8 | dict( 9 | type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500), 10 | dict( 11 | type='MultiStepLR', 12 | begin=0, 13 | end=max_epochs, 14 | by_epoch=True, 15 | milestones=[20, 23], 16 | gamma=0.1) 17 | ] 18 | -------------------------------------------------------------------------------- /configs/gn+ws/mask-rcnn_r50_fpn_gn-ws-all_20-23-24e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_r50_fpn_gn-ws-all_2x_coco.py' 2 | # learning policy 3 | max_epochs = 24 4 | train_cfg = dict(max_epochs=max_epochs) 5 | 6 | # learning rate 7 | param_scheduler = [ 8 | dict( 9 | type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500), 10 | dict( 11 | type='MultiStepLR', 12 | begin=0, 13 | end=max_epochs, 14 | by_epoch=True, 15 | milestones=[20, 23], 16 | gamma=0.1) 17 | ] 18 | -------------------------------------------------------------------------------- /configs/hrnet/fcos_hrnetv2p-w18-gn-head_4xb4-1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './fcos_hrnetv2p-w32-gn-head_4xb4-1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | extra=dict( 5 | stage2=dict(num_channels=(18, 36)), 6 | stage3=dict(num_channels=(18, 36, 72)), 7 | stage4=dict(num_channels=(18, 36, 72, 144))), 8 | init_cfg=dict( 9 | type='Pretrained', checkpoint='open-mmlab://msra/hrnetv2_w18')), 10 | neck=dict(type='HRFPN', in_channels=[18, 36, 72, 144], out_channels=256)) 11 | -------------------------------------------------------------------------------- /configs/lvis/mask-rcnn_r50_fpn_sample1e-3_ms-2x_lvis-v0.5.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/mask-rcnn_r50_fpn.py', 3 | '../_base_/datasets/lvis_v0.5_instance.py', 4 | '../_base_/schedules/schedule_2x.py', '../_base_/default_runtime.py' 5 | ] 6 | model = dict( 7 | roi_head=dict( 8 | bbox_head=dict(num_classes=1230), mask_head=dict(num_classes=1230)), 9 | test_cfg=dict( 10 | rcnn=dict( 11 | score_thr=0.0001, 12 | # LVIS allows up to 300 13 | max_per_img=300))) 14 | -------------------------------------------------------------------------------- /configs/mask_rcnn/mask-rcnn_x101-64x4d_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_x101-32x4d_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=64, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | norm_cfg=dict(type='BN', requires_grad=True), 12 | style='pytorch', 13 | init_cfg=dict( 14 | type='Pretrained', checkpoint='open-mmlab://resnext101_64x4d'))) 15 | -------------------------------------------------------------------------------- /configs/mask_rcnn/mask-rcnn_x101-64x4d_fpn_2x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_x101-32x4d_fpn_2x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=64, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | norm_cfg=dict(type='BN', requires_grad=True), 12 | style='pytorch', 13 | init_cfg=dict( 14 | type='Pretrained', checkpoint='open-mmlab://resnext101_64x4d'))) 15 | -------------------------------------------------------------------------------- /requirements/tests.txt: -------------------------------------------------------------------------------- 1 | asynctest 2 | cityscapesscripts 3 | codecov 4 | flake8 5 | imagecorruptions 6 | instaboostfast 7 | interrogate 8 | isort==4.3.21 9 | # Note: used for kwarray.group_items, this may be ported to mmcv in the future. 10 | kwarray 11 | memory_profiler 12 | -e git+https://github.com/open-mmlab/mmtracking@dev-1.x#egg=mmtrack 13 | nltk 14 | onnx==1.7.0 15 | onnxruntime>=1.8.0 16 | parameterized 17 | prettytable 18 | protobuf<=3.20.1 19 | psutil 20 | pytest 21 | transformers 22 | ubelt 23 | xdoctest>=0.10.0 24 | yapf 25 | -------------------------------------------------------------------------------- /configs/cascade_rcnn/cascade-mask-rcnn_r50-caffe_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = ['./cascade-mask-rcnn_r50_fpn_1x_coco.py'] 2 | 3 | model = dict( 4 | data_preprocessor=dict( 5 | mean=[103.530, 116.280, 123.675], 6 | std=[1.0, 1.0, 1.0], 7 | bgr_to_rgb=False), 8 | backbone=dict( 9 | norm_cfg=dict(requires_grad=False), 10 | norm_eval=True, 11 | style='caffe', 12 | init_cfg=dict( 13 | type='Pretrained', 14 | checkpoint='open-mmlab://detectron2/resnet50_caffe'))) 15 | -------------------------------------------------------------------------------- /configs/cascade_rcnn/cascade-rcnn_x101-32x4d_fpn_20e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './cascade-rcnn_r50_fpn_20e_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=32, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | norm_cfg=dict(type='BN', requires_grad=True), 12 | style='pytorch', 13 | init_cfg=dict( 14 | type='Pretrained', checkpoint='open-mmlab://resnext101_32x4d'))) 15 | -------------------------------------------------------------------------------- /configs/gn/mask-rcnn_r50-contrib_fpn_gn-all_3x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_r50-contrib_fpn_gn-all_2x_coco.py' 2 | 3 | # learning policy 4 | max_epochs = 36 5 | train_cfg = dict(max_epochs=max_epochs) 6 | 7 | # learning rate 8 | param_scheduler = [ 9 | dict( 10 | type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500), 11 | dict( 12 | type='MultiStepLR', 13 | begin=0, 14 | end=max_epochs, 15 | by_epoch=True, 16 | milestones=[28, 34], 17 | gamma=0.1) 18 | ] 19 | -------------------------------------------------------------------------------- /configs/guided_anchoring/ga-retinanet_x101-32x4d_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './ga-retinanet_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=32, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | norm_cfg=dict(type='BN', requires_grad=True), 12 | style='pytorch', 13 | init_cfg=dict( 14 | type='Pretrained', checkpoint='open-mmlab://resnext101_32x4d'))) 15 | -------------------------------------------------------------------------------- /configs/guided_anchoring/ga-retinanet_x101-64x4d_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './ga-retinanet_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=64, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | norm_cfg=dict(type='BN', requires_grad=True), 12 | style='pytorch', 13 | init_cfg=dict( 14 | type='Pretrained', checkpoint='open-mmlab://resnext101_64x4d'))) 15 | -------------------------------------------------------------------------------- /configs/hrnet/htc_hrnetv2p-w40_20e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './htc_hrnetv2p-w32_20e_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='HRNet', 5 | extra=dict( 6 | stage2=dict(num_channels=(40, 80)), 7 | stage3=dict(num_channels=(40, 80, 160)), 8 | stage4=dict(num_channels=(40, 80, 160, 320))), 9 | init_cfg=dict( 10 | type='Pretrained', checkpoint='open-mmlab://msra/hrnetv2_w40')), 11 | neck=dict(type='HRFPN', in_channels=[40, 80, 160, 320], out_channels=256)) 12 | -------------------------------------------------------------------------------- /configs/sort/faster-rcnn_r50_fpn_8xb2-4e_mot17train_test-mot17train.py: -------------------------------------------------------------------------------- 1 | _base_ = ['./faster-rcnn_r50_fpn_8xb2-4e_mot17halftrain_test-mot17halfval'] 2 | # data 3 | data_root = 'data/MOT17/' 4 | train_dataloader = dict( 5 | dataset=dict(ann_file='annotations/train_cocoformat.json')) 6 | val_dataloader = dict( 7 | dataset=dict(ann_file='annotations/train_cocoformat.json')) 8 | test_dataloader = val_dataloader 9 | 10 | val_evaluator = dict(ann_file=data_root + 'annotations/train_cocoformat.json') 11 | test_evaluator = val_evaluator 12 | -------------------------------------------------------------------------------- /tools/dist_train.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CONFIG=$1 4 | GPUS=$2 5 | NNODES=${NNODES:-1} 6 | NODE_RANK=${NODE_RANK:-0} 7 | PORT=${PORT:-29500} 8 | MASTER_ADDR=${MASTER_ADDR:-"127.0.0.1"} 9 | 10 | PYTHONPATH="$(dirname $0)/..":$PYTHONPATH \ 11 | python -m torch.distributed.launch \ 12 | --nnodes=$NNODES \ 13 | --node_rank=$NODE_RANK \ 14 | --master_addr=$MASTER_ADDR \ 15 | --nproc_per_node=$GPUS \ 16 | --master_port=$PORT \ 17 | $(dirname "$0")/train.py \ 18 | $CONFIG \ 19 | --launcher pytorch ${@:3} 20 | -------------------------------------------------------------------------------- /configs/cascade_rcnn/cascade-mask-rcnn_x101-32x4d_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './cascade-mask-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=32, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | norm_cfg=dict(type='BN', requires_grad=True), 12 | style='pytorch', 13 | init_cfg=dict( 14 | type='Pretrained', checkpoint='open-mmlab://resnext101_32x4d'))) 15 | -------------------------------------------------------------------------------- /configs/cascade_rcnn/cascade-mask-rcnn_x101-64x4d_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './cascade-mask-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=64, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | norm_cfg=dict(type='BN', requires_grad=True), 12 | style='pytorch', 13 | init_cfg=dict( 14 | type='Pretrained', checkpoint='open-mmlab://resnext101_64x4d'))) 15 | -------------------------------------------------------------------------------- /configs/gn+ws/mask-rcnn_x50-32x4d_fpn_gn-ws-all_20-23-24e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask-rcnn_x50-32x4d_fpn_gn-ws-all_2x_coco.py' 2 | # learning policy 3 | max_epochs = 24 4 | train_cfg = dict(max_epochs=max_epochs) 5 | 6 | # learning rate 7 | param_scheduler = [ 8 | dict( 9 | type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500), 10 | dict( 11 | type='MultiStepLR', 12 | begin=0, 13 | end=max_epochs, 14 | by_epoch=True, 15 | milestones=[20, 23], 16 | gamma=0.1) 17 | ] 18 | -------------------------------------------------------------------------------- /configs/guided_anchoring/ga-faster-rcnn_x101-32x4d_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './ga-faster-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=32, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | norm_cfg=dict(type='BN', requires_grad=True), 12 | style='pytorch', 13 | init_cfg=dict( 14 | type='Pretrained', checkpoint='open-mmlab://resnext101_32x4d'))) 15 | -------------------------------------------------------------------------------- /configs/guided_anchoring/ga-faster-rcnn_x101-64x4d_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './ga-faster-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=64, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | norm_cfg=dict(type='BN', requires_grad=True), 12 | style='pytorch', 13 | init_cfg=dict( 14 | type='Pretrained', checkpoint='open-mmlab://resnext101_64x4d'))) 15 | -------------------------------------------------------------------------------- /configs/hrnet/faster-rcnn_hrnetv2p-w18-1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './faster-rcnn_hrnetv2p-w32-1x_coco.py' 2 | # model settings 3 | model = dict( 4 | backbone=dict( 5 | extra=dict( 6 | stage2=dict(num_channels=(18, 36)), 7 | stage3=dict(num_channels=(18, 36, 72)), 8 | stage4=dict(num_channels=(18, 36, 72, 144))), 9 | init_cfg=dict( 10 | type='Pretrained', checkpoint='open-mmlab://msra/hrnetv2_w18')), 11 | neck=dict(type='HRFPN', in_channels=[18, 36, 72, 144], out_channels=256)) 12 | -------------------------------------------------------------------------------- /configs/libra_rcnn/libra-faster-rcnn_x101-64x4d_fpn_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './libra-faster-rcnn_r50_fpn_1x_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=64, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | norm_cfg=dict(type='BN', requires_grad=True), 12 | style='pytorch', 13 | init_cfg=dict( 14 | type='Pretrained', checkpoint='open-mmlab://resnext101_64x4d'))) 15 | -------------------------------------------------------------------------------- /configs/scnet/scnet_x101-64x4d_fpn_20e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './scnet_r50_fpn_20e_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=64, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | norm_cfg=dict(type='BN', requires_grad=True), 12 | norm_eval=True, 13 | style='pytorch', 14 | init_cfg=dict( 15 | type='Pretrained', checkpoint='open-mmlab://resnext101_64x4d'))) 16 | -------------------------------------------------------------------------------- /projects/example_project/dummy/dummy_resnet.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from mmdet.models.backbones import ResNet 3 | from mmdet.registry import MODELS 4 | 5 | 6 | @MODELS.register_module() 7 | class DummyResNet(ResNet): 8 | """Implements a dummy ResNet wrapper for demonstration purpose. 9 | Args: 10 | **kwargs: All the arguments are passed to the parent class. 11 | """ 12 | 13 | def __init__(self, **kwargs) -> None: 14 | print('Hello world!') 15 | super().__init__(**kwargs) 16 | -------------------------------------------------------------------------------- /configs/cascade_rcnn/cascade-mask-rcnn_x101-32x4d_fpn_20e_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = './cascade-mask-rcnn_r50_fpn_20e_coco.py' 2 | model = dict( 3 | backbone=dict( 4 | type='ResNeXt', 5 | depth=101, 6 | groups=32, 7 | base_width=4, 8 | num_stages=4, 9 | out_indices=(0, 1, 2, 3), 10 | frozen_stages=1, 11 | norm_cfg=dict(type='BN', requires_grad=True), 12 | style='pytorch', 13 | init_cfg=dict( 14 | type='Pretrained', checkpoint='open-mmlab://resnext101_32x4d'))) 15 | --------------------------------------------------------------------------------