├── LICENSE.txt ├── README.md ├── configs ├── _base_ │ ├── datasets │ │ ├── cityscapes_detection.py │ │ ├── cityscapes_instance.py │ │ ├── coco_detection.py │ │ ├── coco_instance.py │ │ ├── coco_instance_semantic.py │ │ ├── coco_panoptic.py │ │ ├── deepfashion.py │ │ ├── lvis_v0.5_instance.py │ │ ├── lvis_v1_instance.py │ │ ├── voc0712.py │ │ └── wider_face.py │ ├── default_runtime.py │ ├── models │ │ ├── cascade_mask_rcnn_r50_fpn.py │ │ ├── cascade_rcnn_r50_fpn.py │ │ ├── fast_rcnn_r50_fpn.py │ │ ├── faster_rcnn_r50_caffe_c4.py │ │ ├── faster_rcnn_r50_caffe_dc5.py │ │ ├── faster_rcnn_r50_fpn.py │ │ ├── faster_rcnn_r50_sspnet.py │ │ ├── mask_rcnn_r50_caffe_c4.py │ │ ├── mask_rcnn_r50_fpn.py │ │ ├── retinanet_r50_fpn.py │ │ ├── rpn_r50_caffe_c4.py │ │ ├── rpn_r50_fpn.py │ │ └── ssd300.py │ └── schedules │ │ ├── schedule_1x.py │ │ ├── schedule_20e.py │ │ └── schedule_2x.py └── sspnet │ ├── faster_rcnn_r50_sspnet_1x_coco.py │ └── fovea_r50_sspnet_4x4_1x_coco.py ├── demo ├── MMDet_Tutorial.ipynb ├── create_result_gif.py ├── demo.jpg ├── demo.mp4 ├── image_demo.py ├── inference_demo.ipynb ├── video_demo.py └── webcam_demo.py ├── img ├── cam.png ├── img1.png └── visualization.png ├── latest_version ├── config │ └── sspnet │ │ ├── faster_rcnn_r50_sspnet_1x_coco.py │ │ └── fovea_r50_sspnet_4x4_1x_coco.py ├── model │ ├── detector │ │ ├── faster_rcnn_ssp.py │ │ └── fovea_sppnet.py │ └── module │ │ ├── __init__.py │ │ ├── __pycache__ │ │ ├── __init__.cpython-37.pyc │ │ ├── heatmap.cpython-37.pyc │ │ └── tinymap.cpython-37.pyc │ │ ├── heatmap.py │ │ └── tinymap.py └── neck │ └── ssfpn.py ├── mmdet ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-37.pyc │ └── version.cpython-37.pyc ├── apis │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-37.pyc │ │ ├── inference.cpython-37.pyc │ │ ├── test.cpython-37.pyc │ │ └── train.cpython-37.pyc │ ├── inference.py │ ├── test.py │ └── train.py ├── core │ ├── __init__.py │ ├── __pycache__ │ │ └── __init__.cpython-37.pyc │ ├── anchor │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── anchor_generator.cpython-37.pyc │ │ │ ├── builder.cpython-37.pyc │ │ │ ├── point_generator.cpython-37.pyc │ │ │ └── utils.cpython-37.pyc │ │ ├── anchor_generator.py │ │ ├── builder.py │ │ ├── point_generator.py │ │ └── utils.py │ ├── bbox │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── builder.cpython-37.pyc │ │ │ ├── demodata.cpython-37.pyc │ │ │ └── transforms.cpython-37.pyc │ │ ├── assigners │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── approx_max_iou_assigner.cpython-37.pyc │ │ │ │ ├── assign_result.cpython-37.pyc │ │ │ │ ├── atss_assigner.cpython-37.pyc │ │ │ │ ├── base_assigner.cpython-37.pyc │ │ │ │ ├── center_region_assigner.cpython-37.pyc │ │ │ │ ├── grid_assigner.cpython-37.pyc │ │ │ │ ├── hungarian_assigner.cpython-37.pyc │ │ │ │ ├── max_iou_assigner.cpython-37.pyc │ │ │ │ ├── point_assigner.cpython-37.pyc │ │ │ │ ├── region_assigner.cpython-37.pyc │ │ │ │ ├── sim_ota_assigner.cpython-37.pyc │ │ │ │ └── uniform_assigner.cpython-37.pyc │ │ │ ├── approx_max_iou_assigner.py │ │ │ ├── assign_result.py │ │ │ ├── atss_assigner.py │ │ │ ├── base_assigner.py │ │ │ ├── center_region_assigner.py │ │ │ ├── grid_assigner.py │ │ │ ├── hungarian_assigner.py │ │ │ ├── max_iou_assigner.py │ │ │ ├── point_assigner.py │ │ │ ├── region_assigner.py │ │ │ ├── sim_ota_assigner.py │ │ │ └── uniform_assigner.py │ │ ├── builder.py │ │ ├── coder │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── base_bbox_coder.cpython-37.pyc │ │ │ │ ├── bucketing_bbox_coder.cpython-37.pyc │ │ │ │ ├── delta_xywh_bbox_coder.cpython-37.pyc │ │ │ │ ├── distance_point_bbox_coder.cpython-37.pyc │ │ │ │ ├── legacy_delta_xywh_bbox_coder.cpython-37.pyc │ │ │ │ ├── pseudo_bbox_coder.cpython-37.pyc │ │ │ │ ├── tblr_bbox_coder.cpython-37.pyc │ │ │ │ └── yolo_bbox_coder.cpython-37.pyc │ │ │ ├── base_bbox_coder.py │ │ │ ├── bucketing_bbox_coder.py │ │ │ ├── delta_xywh_bbox_coder.py │ │ │ ├── distance_point_bbox_coder.py │ │ │ ├── legacy_delta_xywh_bbox_coder.py │ │ │ ├── pseudo_bbox_coder.py │ │ │ ├── tblr_bbox_coder.py │ │ │ └── yolo_bbox_coder.py │ │ ├── demodata.py │ │ ├── iou_calculators │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── builder.cpython-37.pyc │ │ │ │ └── iou2d_calculator.cpython-37.pyc │ │ │ ├── builder.py │ │ │ └── iou2d_calculator.py │ │ ├── match_costs │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── builder.cpython-37.pyc │ │ │ │ └── match_cost.cpython-37.pyc │ │ │ ├── builder.py │ │ │ └── match_cost.py │ │ ├── samplers │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── base_sampler.cpython-37.pyc │ │ │ │ ├── combined_sampler.cpython-37.pyc │ │ │ │ ├── ic_base_sampler.cpython-37.pyc │ │ │ │ ├── ic_neg_sampler.cpython-37.pyc │ │ │ │ ├── instance_balanced_pos_sampler.cpython-37.pyc │ │ │ │ ├── iou_balanced_neg_sampler.cpython-37.pyc │ │ │ │ ├── ohem_sampler.cpython-37.pyc │ │ │ │ ├── pseudo_sampler.cpython-37.pyc │ │ │ │ ├── random_sampler.cpython-37.pyc │ │ │ │ ├── sampling_result.cpython-37.pyc │ │ │ │ └── score_hlr_sampler.cpython-37.pyc │ │ │ ├── base_sampler.py │ │ │ ├── combined_sampler.py │ │ │ ├── ic_base_sampler.py │ │ │ ├── ic_neg_sampler.py │ │ │ ├── instance_balanced_pos_sampler.py │ │ │ ├── iou_balanced_neg_sampler.py │ │ │ ├── ohem_sampler.py │ │ │ ├── pseudo_sampler.py │ │ │ ├── random_sampler.py │ │ │ ├── sampling_result.py │ │ │ └── score_hlr_sampler.py │ │ └── transforms.py │ ├── data_structures │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── general_data.cpython-37.pyc │ │ │ └── instance_data.cpython-37.pyc │ │ ├── general_data.py │ │ └── instance_data.py │ ├── evaluation │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── bbox_overlaps.cpython-37.pyc │ │ │ ├── class_names.cpython-37.pyc │ │ │ ├── cocoeval.cpython-37.pyc │ │ │ ├── eval_hooks.cpython-37.pyc │ │ │ ├── mean_ap.cpython-37.pyc │ │ │ └── recall.cpython-37.pyc │ │ ├── bbox_overlaps.py │ │ ├── class_names.py │ │ ├── cocoeval.py │ │ ├── eval_hooks.py │ │ ├── mean_ap.py │ │ ├── recall.py │ │ └── tiny_eval │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── bounding_box.cpython-37.pyc │ │ │ └── split_and_merge_image.cpython-37.pyc │ │ │ ├── bounding_box.py │ │ │ ├── merge.py │ │ │ └── split_and_merge_image.py │ ├── export │ │ ├── __init__.py │ │ ├── model_wrappers.py │ │ ├── onnx_helper.py │ │ └── pytorch2onnx.py │ ├── hook │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── checkloss_hook.cpython-37.pyc │ │ │ ├── ema.cpython-37.pyc │ │ │ ├── sync_norm_hook.cpython-37.pyc │ │ │ ├── sync_random_size_hook.cpython-37.pyc │ │ │ ├── yolox_lrupdater_hook.cpython-37.pyc │ │ │ └── yolox_mode_switch_hook.cpython-37.pyc │ │ ├── checkloss_hook.py │ │ ├── ema.py │ │ ├── sync_norm_hook.py │ │ ├── sync_random_size_hook.py │ │ ├── yolox_lrupdater_hook.py │ │ └── yolox_mode_switch_hook.py │ ├── mask │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── mask_target.cpython-37.pyc │ │ │ ├── structures.cpython-37.pyc │ │ │ └── utils.cpython-37.pyc │ │ ├── mask_target.py │ │ ├── structures.py │ │ └── utils.py │ ├── post_processing │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── bbox_nms.cpython-37.pyc │ │ │ ├── matrix_nms.cpython-37.pyc │ │ │ └── merge_augs.cpython-37.pyc │ │ ├── bbox_nms.py │ │ ├── matrix_nms.py │ │ └── merge_augs.py │ ├── utils │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── dist_utils.cpython-37.pyc │ │ │ └── misc.cpython-37.pyc │ │ ├── dist_utils.py │ │ └── misc.py │ └── visualization │ │ ├── __init__.py │ │ ├── __pycache__ │ │ ├── __init__.cpython-37.pyc │ │ └── image.cpython-37.pyc │ │ └── image.py ├── datasets │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-37.pyc │ │ ├── builder.cpython-37.pyc │ │ ├── cityscapes.cpython-37.pyc │ │ ├── coco.cpython-37.pyc │ │ ├── coco_panoptic.cpython-37.pyc │ │ ├── custom.cpython-37.pyc │ │ ├── dataset_wrappers.cpython-37.pyc │ │ ├── deepfashion.cpython-37.pyc │ │ ├── lvis.cpython-37.pyc │ │ ├── utils.cpython-37.pyc │ │ ├── voc.cpython-37.pyc │ │ ├── wider_face.cpython-37.pyc │ │ └── xml_style.cpython-37.pyc │ ├── api_wrappers │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── coco_api.cpython-37.pyc │ │ │ └── panoptic_evaluation.cpython-37.pyc │ │ ├── coco_api.py │ │ └── panoptic_evaluation.py │ ├── builder.py │ ├── cityscapes.py │ ├── coco.py │ ├── coco_panoptic.py │ ├── custom.py │ ├── dataset_wrappers.py │ ├── deepfashion.py │ ├── lvis.py │ ├── pipelines │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── auto_augment.cpython-37.pyc │ │ │ ├── compose.cpython-37.pyc │ │ │ ├── formating.cpython-37.pyc │ │ │ ├── instaboost.cpython-37.pyc │ │ │ ├── loading.cpython-37.pyc │ │ │ ├── test_time_aug.cpython-37.pyc │ │ │ └── transforms.cpython-37.pyc │ │ ├── auto_augment.py │ │ ├── compose.py │ │ ├── formating.py │ │ ├── instaboost.py │ │ ├── loading.py │ │ ├── test_time_aug.py │ │ └── transforms.py │ ├── samplers │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── distributed_sampler.cpython-37.pyc │ │ │ ├── group_sampler.cpython-37.pyc │ │ │ └── infinite_sampler.cpython-37.pyc │ │ ├── distributed_sampler.py │ │ ├── group_sampler.py │ │ └── infinite_sampler.py │ ├── utils.py │ ├── voc.py │ ├── wider_face.py │ └── xml_style.py ├── models │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-37.pyc │ │ └── builder.cpython-37.pyc │ ├── backbones │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── csp_darknet.cpython-37.pyc │ │ │ ├── darknet.cpython-37.pyc │ │ │ ├── detectors_resnet.cpython-37.pyc │ │ │ ├── detectors_resnext.cpython-37.pyc │ │ │ ├── hourglass.cpython-37.pyc │ │ │ ├── hrnet.cpython-37.pyc │ │ │ ├── mobilenet_v2.cpython-37.pyc │ │ │ ├── pvt.cpython-37.pyc │ │ │ ├── regnet.cpython-37.pyc │ │ │ ├── res2net.cpython-37.pyc │ │ │ ├── resnest.cpython-37.pyc │ │ │ ├── resnet.cpython-37.pyc │ │ │ ├── resnext.cpython-37.pyc │ │ │ ├── ssd_vgg.cpython-37.pyc │ │ │ ├── swin.cpython-37.pyc │ │ │ └── trident_resnet.cpython-37.pyc │ │ ├── csp_darknet.py │ │ ├── darknet.py │ │ ├── detectors_resnet.py │ │ ├── detectors_resnext.py │ │ ├── hourglass.py │ │ ├── hrnet.py │ │ ├── mobilenet_v2.py │ │ ├── pvt.py │ │ ├── regnet.py │ │ ├── res2net.py │ │ ├── resnest.py │ │ ├── resnet.py │ │ ├── resnext.py │ │ ├── ssd_vgg.py │ │ ├── swin.py │ │ └── trident_resnet.py │ ├── builder.py │ ├── dense_heads │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── anchor_free_head.cpython-37.pyc │ │ │ ├── anchor_head.cpython-37.pyc │ │ │ ├── atss_head.cpython-37.pyc │ │ │ ├── autoassign_head.cpython-37.pyc │ │ │ ├── base_dense_head.cpython-37.pyc │ │ │ ├── base_mask_head.cpython-37.pyc │ │ │ ├── cascade_rpn_head.cpython-37.pyc │ │ │ ├── centernet_head.cpython-37.pyc │ │ │ ├── centripetal_head.cpython-37.pyc │ │ │ ├── corner_head.cpython-37.pyc │ │ │ ├── deformable_detr_head.cpython-37.pyc │ │ │ ├── dense_test_mixins.cpython-37.pyc │ │ │ ├── detr_head.cpython-37.pyc │ │ │ ├── embedding_rpn_head.cpython-37.pyc │ │ │ ├── fcos_head.cpython-37.pyc │ │ │ ├── fovea_head.cpython-37.pyc │ │ │ ├── free_anchor_retina_head.cpython-37.pyc │ │ │ ├── fsaf_head.cpython-37.pyc │ │ │ ├── ga_retina_head.cpython-37.pyc │ │ │ ├── ga_rpn_head.cpython-37.pyc │ │ │ ├── gfl_head.cpython-37.pyc │ │ │ ├── guided_anchor_head.cpython-37.pyc │ │ │ ├── lad_head.cpython-37.pyc │ │ │ ├── ld_head.cpython-37.pyc │ │ │ ├── nasfcos_head.cpython-37.pyc │ │ │ ├── paa_head.cpython-37.pyc │ │ │ ├── pisa_retinanet_head.cpython-37.pyc │ │ │ ├── pisa_ssd_head.cpython-37.pyc │ │ │ ├── reppoints_head.cpython-37.pyc │ │ │ ├── retina_head.cpython-37.pyc │ │ │ ├── retina_sepbn_head.cpython-37.pyc │ │ │ ├── rpn_head.cpython-37.pyc │ │ │ ├── sabl_retina_head.cpython-37.pyc │ │ │ ├── solo_head.cpython-37.pyc │ │ │ ├── ssd_head.cpython-37.pyc │ │ │ ├── vfnet_head.cpython-37.pyc │ │ │ ├── yolact_head.cpython-37.pyc │ │ │ ├── yolo_head.cpython-37.pyc │ │ │ ├── yolof_head.cpython-37.pyc │ │ │ └── yolox_head.cpython-37.pyc │ │ ├── anchor_free_head.py │ │ ├── anchor_head.py │ │ ├── atss_head.py │ │ ├── autoassign_head.py │ │ ├── base_dense_head.py │ │ ├── base_mask_head.py │ │ ├── cascade_rpn_head.py │ │ ├── centernet_head.py │ │ ├── centripetal_head.py │ │ ├── corner_head.py │ │ ├── deformable_detr_head.py │ │ ├── dense_test_mixins.py │ │ ├── detr_head.py │ │ ├── embedding_rpn_head.py │ │ ├── fcos_head.py │ │ ├── fovea_head.py │ │ ├── free_anchor_retina_head.py │ │ ├── fsaf_head.py │ │ ├── ga_retina_head.py │ │ ├── ga_rpn_head.py │ │ ├── gfl_head.py │ │ ├── guided_anchor_head.py │ │ ├── lad_head.py │ │ ├── ld_head.py │ │ ├── nasfcos_head.py │ │ ├── paa_head.py │ │ ├── pisa_retinanet_head.py │ │ ├── pisa_ssd_head.py │ │ ├── reppoints_head.py │ │ ├── retina_head.py │ │ ├── retina_sepbn_head.py │ │ ├── rpn_head.py │ │ ├── sabl_retina_head.py │ │ ├── solo_head.py │ │ ├── ssd_head.py │ │ ├── vfnet_head.py │ │ ├── yolact_head.py │ │ ├── yolo_head.py │ │ ├── yolof_head.py │ │ └── yolox_head.py │ ├── detectors │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── atss.cpython-37.pyc │ │ │ ├── autoassign.cpython-37.pyc │ │ │ ├── base.cpython-37.pyc │ │ │ ├── cascade_rcnn.cpython-37.pyc │ │ │ ├── centernet.cpython-37.pyc │ │ │ ├── cornernet.cpython-37.pyc │ │ │ ├── deformable_detr.cpython-37.pyc │ │ │ ├── detr.cpython-37.pyc │ │ │ ├── fast_rcnn.cpython-37.pyc │ │ │ ├── faster_rcnn.cpython-37.pyc │ │ │ ├── faster_rcnn_ssp.cpython-37.pyc │ │ │ ├── fcos.cpython-37.pyc │ │ │ ├── fovea.cpython-37.pyc │ │ │ ├── fovea_sppnet.cpython-37.pyc │ │ │ ├── fsaf.cpython-37.pyc │ │ │ ├── gfl.cpython-37.pyc │ │ │ ├── grid_rcnn.cpython-37.pyc │ │ │ ├── htc.cpython-37.pyc │ │ │ ├── kd_one_stage.cpython-37.pyc │ │ │ ├── lad.cpython-37.pyc │ │ │ ├── mask_rcnn.cpython-37.pyc │ │ │ ├── mask_scoring_rcnn.cpython-37.pyc │ │ │ ├── nasfcos.cpython-37.pyc │ │ │ ├── paa.cpython-37.pyc │ │ │ ├── panoptic_fpn.cpython-37.pyc │ │ │ ├── panoptic_two_stage_segmentor.cpython-37.pyc │ │ │ ├── point_rend.cpython-37.pyc │ │ │ ├── queryinst.cpython-37.pyc │ │ │ ├── reppoints_detector.cpython-37.pyc │ │ │ ├── retinanet.cpython-37.pyc │ │ │ ├── rpn.cpython-37.pyc │ │ │ ├── scnet.cpython-37.pyc │ │ │ ├── single_stage.cpython-37.pyc │ │ │ ├── single_stage_instance_seg.cpython-37.pyc │ │ │ ├── solo.cpython-37.pyc │ │ │ ├── sparse_rcnn.cpython-37.pyc │ │ │ ├── trident_faster_rcnn.cpython-37.pyc │ │ │ ├── two_stage.cpython-37.pyc │ │ │ ├── vfnet.cpython-37.pyc │ │ │ ├── yolact.cpython-37.pyc │ │ │ ├── yolo.cpython-37.pyc │ │ │ ├── yolof.cpython-37.pyc │ │ │ └── yolox.cpython-37.pyc │ │ ├── atss.py │ │ ├── autoassign.py │ │ ├── base.py │ │ ├── cascade_rcnn.py │ │ ├── centernet.py │ │ ├── cornernet.py │ │ ├── deformable_detr.py │ │ ├── detr.py │ │ ├── fast_rcnn.py │ │ ├── faster_rcnn.py │ │ ├── faster_rcnn_ssp.py │ │ ├── fcos.py │ │ ├── fovea.py │ │ ├── fovea_sppnet.py │ │ ├── fsaf.py │ │ ├── gfl.py │ │ ├── grid_rcnn.py │ │ ├── htc.py │ │ ├── kd_one_stage.py │ │ ├── lad.py │ │ ├── mask_rcnn.py │ │ ├── mask_scoring_rcnn.py │ │ ├── nasfcos.py │ │ ├── paa.py │ │ ├── panoptic_fpn.py │ │ ├── panoptic_two_stage_segmentor.py │ │ ├── point_rend.py │ │ ├── queryinst.py │ │ ├── reppoints_detector.py │ │ ├── retinanet.py │ │ ├── rpn.py │ │ ├── scnet.py │ │ ├── single_stage.py │ │ ├── single_stage_instance_seg.py │ │ ├── solo.py │ │ ├── sparse_rcnn.py │ │ ├── trident_faster_rcnn.py │ │ ├── two_stage.py │ │ ├── vfnet.py │ │ ├── yolact.py │ │ ├── yolo.py │ │ ├── yolof.py │ │ └── yolox.py │ ├── losses │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── accuracy.cpython-37.pyc │ │ │ ├── ae_loss.cpython-37.pyc │ │ │ ├── balanced_l1_loss.cpython-37.pyc │ │ │ ├── cross_entropy_loss.cpython-37.pyc │ │ │ ├── dice_loss.cpython-37.pyc │ │ │ ├── focal_loss.cpython-37.pyc │ │ │ ├── gaussian_focal_loss.cpython-37.pyc │ │ │ ├── gfocal_loss.cpython-37.pyc │ │ │ ├── ghm_loss.cpython-37.pyc │ │ │ ├── iou_loss.cpython-37.pyc │ │ │ ├── kd_loss.cpython-37.pyc │ │ │ ├── mse_loss.cpython-37.pyc │ │ │ ├── pisa_loss.cpython-37.pyc │ │ │ ├── seesaw_loss.cpython-37.pyc │ │ │ ├── smooth_l1_loss.cpython-37.pyc │ │ │ ├── utils.cpython-37.pyc │ │ │ └── varifocal_loss.cpython-37.pyc │ │ ├── accuracy.py │ │ ├── ae_loss.py │ │ ├── balanced_l1_loss.py │ │ ├── cross_entropy_loss.py │ │ ├── dice_loss.py │ │ ├── focal_loss.py │ │ ├── gaussian_focal_loss.py │ │ ├── gfocal_loss.py │ │ ├── ghm_loss.py │ │ ├── iou_loss.py │ │ ├── kd_loss.py │ │ ├── mse_loss.py │ │ ├── pisa_loss.py │ │ ├── seesaw_loss.py │ │ ├── smooth_l1_loss.py │ │ ├── utils.py │ │ └── varifocal_loss.py │ ├── module │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-37.pyc │ │ │ └── heatmap.cpython-37.pyc │ │ └── heatmap.py │ ├── necks │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── bfp.cpython-37.pyc │ │ │ ├── channel_mapper.cpython-37.pyc │ │ │ ├── ct_resnet_neck.cpython-37.pyc │ │ │ ├── dilated_encoder.cpython-37.pyc │ │ │ ├── fpg.cpython-37.pyc │ │ │ ├── fpn.cpython-37.pyc │ │ │ ├── fpn_carafe.cpython-37.pyc │ │ │ ├── hrfpn.cpython-37.pyc │ │ │ ├── nas_fpn.cpython-37.pyc │ │ │ ├── nasfcos_fpn.cpython-37.pyc │ │ │ ├── pafpn.cpython-37.pyc │ │ │ ├── rfp.cpython-37.pyc │ │ │ ├── ssd_neck.cpython-37.pyc │ │ │ ├── ssfpn.cpython-37.pyc │ │ │ ├── yolo_neck.cpython-37.pyc │ │ │ └── yolox_pafpn.cpython-37.pyc │ │ ├── bfp.py │ │ ├── channel_mapper.py │ │ ├── ct_resnet_neck.py │ │ ├── dilated_encoder.py │ │ ├── fpg.py │ │ ├── fpn.py │ │ ├── fpn_carafe.py │ │ ├── hrfpn.py │ │ ├── nas_fpn.py │ │ ├── nasfcos_fpn.py │ │ ├── pafpn.py │ │ ├── rfp.py │ │ ├── ssd_neck.py │ │ ├── ssfpn.py │ │ ├── yolo_neck.py │ │ └── yolox_pafpn.py │ ├── plugins │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-37.pyc │ │ │ └── dropblock.cpython-37.pyc │ │ └── dropblock.py │ ├── roi_heads │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── base_roi_head.cpython-37.pyc │ │ │ ├── cascade_roi_head.cpython-37.pyc │ │ │ ├── double_roi_head.cpython-37.pyc │ │ │ ├── dynamic_roi_head.cpython-37.pyc │ │ │ ├── grid_roi_head.cpython-37.pyc │ │ │ ├── htc_roi_head.cpython-37.pyc │ │ │ ├── mask_scoring_roi_head.cpython-37.pyc │ │ │ ├── pisa_roi_head.cpython-37.pyc │ │ │ ├── point_rend_roi_head.cpython-37.pyc │ │ │ ├── scnet_roi_head.cpython-37.pyc │ │ │ ├── sparse_roi_head.cpython-37.pyc │ │ │ ├── standard_roi_head.cpython-37.pyc │ │ │ ├── test_mixins.cpython-37.pyc │ │ │ └── trident_roi_head.cpython-37.pyc │ │ ├── base_roi_head.py │ │ ├── bbox_heads │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── bbox_head.cpython-37.pyc │ │ │ │ ├── convfc_bbox_head.cpython-37.pyc │ │ │ │ ├── dii_head.cpython-37.pyc │ │ │ │ ├── double_bbox_head.cpython-37.pyc │ │ │ │ ├── sabl_head.cpython-37.pyc │ │ │ │ └── scnet_bbox_head.cpython-37.pyc │ │ │ ├── bbox_head.py │ │ │ ├── convfc_bbox_head.py │ │ │ ├── dii_head.py │ │ │ ├── double_bbox_head.py │ │ │ ├── sabl_head.py │ │ │ └── scnet_bbox_head.py │ │ ├── cascade_roi_head.py │ │ ├── double_roi_head.py │ │ ├── dynamic_roi_head.py │ │ ├── grid_roi_head.py │ │ ├── htc_roi_head.py │ │ ├── mask_heads │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── coarse_mask_head.cpython-37.pyc │ │ │ │ ├── dynamic_mask_head.cpython-37.pyc │ │ │ │ ├── fcn_mask_head.cpython-37.pyc │ │ │ │ ├── feature_relay_head.cpython-37.pyc │ │ │ │ ├── fused_semantic_head.cpython-37.pyc │ │ │ │ ├── global_context_head.cpython-37.pyc │ │ │ │ ├── grid_head.cpython-37.pyc │ │ │ │ ├── htc_mask_head.cpython-37.pyc │ │ │ │ ├── mask_point_head.cpython-37.pyc │ │ │ │ ├── maskiou_head.cpython-37.pyc │ │ │ │ ├── scnet_mask_head.cpython-37.pyc │ │ │ │ └── scnet_semantic_head.cpython-37.pyc │ │ │ ├── coarse_mask_head.py │ │ │ ├── dynamic_mask_head.py │ │ │ ├── fcn_mask_head.py │ │ │ ├── feature_relay_head.py │ │ │ ├── fused_semantic_head.py │ │ │ ├── global_context_head.py │ │ │ ├── grid_head.py │ │ │ ├── htc_mask_head.py │ │ │ ├── mask_point_head.py │ │ │ ├── maskiou_head.py │ │ │ ├── scnet_mask_head.py │ │ │ └── scnet_semantic_head.py │ │ ├── mask_scoring_roi_head.py │ │ ├── pisa_roi_head.py │ │ ├── point_rend_roi_head.py │ │ ├── roi_extractors │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── base_roi_extractor.cpython-37.pyc │ │ │ │ ├── generic_roi_extractor.cpython-37.pyc │ │ │ │ └── single_level_roi_extractor.cpython-37.pyc │ │ │ ├── base_roi_extractor.py │ │ │ ├── generic_roi_extractor.py │ │ │ └── single_level_roi_extractor.py │ │ ├── scnet_roi_head.py │ │ ├── shared_heads │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ └── res_layer.cpython-37.pyc │ │ │ └── res_layer.py │ │ ├── sparse_roi_head.py │ │ ├── standard_roi_head.py │ │ ├── test_mixins.py │ │ └── trident_roi_head.py │ ├── seg_heads │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── base_semantic_head.cpython-37.pyc │ │ │ └── panoptic_fpn_head.cpython-37.pyc │ │ ├── base_semantic_head.py │ │ ├── panoptic_fpn_head.py │ │ └── panoptic_fusion_heads │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── base_panoptic_fusion_head.cpython-37.pyc │ │ │ └── heuristic_fusion_head.cpython-37.pyc │ │ │ ├── base_panoptic_fusion_head.py │ │ │ └── heuristic_fusion_head.py │ └── utils │ │ ├── __init__.py │ │ ├── __pycache__ │ │ ├── __init__.cpython-37.pyc │ │ ├── brick_wrappers.cpython-37.pyc │ │ ├── builder.cpython-37.pyc │ │ ├── ckpt_convert.cpython-37.pyc │ │ ├── conv_upsample.cpython-37.pyc │ │ ├── csp_layer.cpython-37.pyc │ │ ├── gaussian_target.cpython-37.pyc │ │ ├── inverted_residual.cpython-37.pyc │ │ ├── make_divisible.cpython-37.pyc │ │ ├── misc.cpython-37.pyc │ │ ├── normed_predictor.cpython-37.pyc │ │ ├── positional_encoding.cpython-37.pyc │ │ ├── res_layer.cpython-37.pyc │ │ ├── se_layer.cpython-37.pyc │ │ └── transformer.cpython-37.pyc │ │ ├── brick_wrappers.py │ │ ├── builder.py │ │ ├── ckpt_convert.py │ │ ├── conv_upsample.py │ │ ├── csp_layer.py │ │ ├── gaussian_target.py │ │ ├── inverted_residual.py │ │ ├── make_divisible.py │ │ ├── misc.py │ │ ├── normed_predictor.py │ │ ├── positional_encoding.py │ │ ├── res_layer.py │ │ ├── se_layer.py │ │ └── transformer.py ├── utils │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-37.pyc │ │ ├── collect_env.cpython-37.pyc │ │ ├── contextmanagers.cpython-37.pyc │ │ ├── logger.cpython-37.pyc │ │ ├── util_mixins.cpython-37.pyc │ │ └── util_random.cpython-37.pyc │ ├── collect_env.py │ ├── contextmanagers.py │ ├── logger.py │ ├── profiling.py │ ├── util_mixins.py │ └── util_random.py └── version.py ├── requirements.txt ├── requirements ├── build.txt ├── docs.txt ├── mminstall.txt ├── optional.txt ├── readthedocs.txt ├── runtime.txt └── tests.txt ├── setup.py ├── tests ├── data │ ├── VOCdevkit │ │ ├── VOC2007 │ │ │ ├── Annotations │ │ │ │ └── 000001.xml │ │ │ ├── ImageSets │ │ │ │ └── Main │ │ │ │ │ ├── test.txt │ │ │ │ │ └── trainval.txt │ │ │ └── JPEGImages │ │ │ │ └── 000001.jpg │ │ └── VOC2012 │ │ │ ├── Annotations │ │ │ └── 000001.xml │ │ │ ├── ImageSets │ │ │ └── Main │ │ │ │ ├── test.txt │ │ │ │ └── trainval.txt │ │ │ └── JPEGImages │ │ │ └── 000001.jpg │ ├── coco_sample.json │ ├── color.jpg │ ├── configs_mmtrack │ │ ├── faster_rcnn_r50_dc5.py │ │ ├── faster_rcnn_r50_fpn.py │ │ ├── mot_challenge.py │ │ ├── selsa_faster_rcnn_r101_dc5_1x.py │ │ └── tracktor_faster-rcnn_r50_fpn_4e.py │ ├── custom_dataset │ │ ├── images │ │ │ ├── 000001.jpg │ │ │ └── 000001.xml │ │ ├── test.txt │ │ └── trainval.txt │ └── gray.jpg ├── test_data │ ├── test_datasets │ │ ├── test_coco_dataset.py │ │ ├── test_common.py │ │ ├── test_custom_dataset.py │ │ ├── test_dataset_wrapper.py │ │ ├── test_panoptic_dataset.py │ │ └── test_xml_dataset.py │ ├── test_pipelines │ │ ├── test_formatting.py │ │ ├── test_loading.py │ │ ├── test_sampler.py │ │ └── test_transform │ │ │ ├── __init__.py │ │ │ ├── test_img_augment.py │ │ │ ├── test_models_aug_test.py │ │ │ ├── test_rotate.py │ │ │ ├── test_shear.py │ │ │ ├── test_transform.py │ │ │ ├── test_translate.py │ │ │ └── utils.py │ └── test_utils.py ├── test_downstream │ └── test_mmtrack.py ├── test_metrics │ ├── test_box_overlap.py │ ├── test_losses.py │ ├── test_mean_ap.py │ └── test_recall.py ├── test_models │ ├── test_backbones │ │ ├── __init__.py │ │ ├── test_csp_darknet.py │ │ ├── test_detectors_resnet.py │ │ ├── test_hourglass.py │ │ ├── test_hrnet.py │ │ ├── test_mobilenet_v2.py │ │ ├── test_pvt.py │ │ ├── test_regnet.py │ │ ├── test_renext.py │ │ ├── test_res2net.py │ │ ├── test_resnest.py │ │ ├── test_resnet.py │ │ ├── test_swin.py │ │ ├── test_trident_resnet.py │ │ └── utils.py │ ├── test_dense_heads │ │ ├── test_anchor_head.py │ │ ├── test_atss_head.py │ │ ├── test_autoassign_head.py │ │ ├── test_centernet_head.py │ │ ├── test_corner_head.py │ │ ├── test_dense_heads_attr.py │ │ ├── test_detr_head.py │ │ ├── test_fcos_head.py │ │ ├── test_fsaf_head.py │ │ ├── test_ga_anchor_head.py │ │ ├── test_gfl_head.py │ │ ├── test_lad_head.py │ │ ├── test_ld_head.py │ │ ├── test_paa_head.py │ │ ├── test_pisa_head.py │ │ ├── test_sabl_retina_head.py │ │ ├── test_solo_head.py │ │ ├── test_vfnet_head.py │ │ ├── test_yolact_head.py │ │ ├── test_yolof_head.py │ │ └── test_yolox_head.py │ ├── test_forward.py │ ├── test_loss.py │ ├── test_loss_compatibility.py │ ├── test_necks.py │ ├── test_plugins.py │ ├── test_roi_heads │ │ ├── __init__.py │ │ ├── test_bbox_head.py │ │ ├── test_mask_head.py │ │ ├── test_roi_extractor.py │ │ ├── test_sabl_bbox_head.py │ │ └── utils.py │ └── test_utils │ │ ├── test_brick_wrappers.py │ │ ├── test_conv_upsample.py │ │ ├── test_inverted_residual.py │ │ ├── test_model_misc.py │ │ ├── test_position_encoding.py │ │ ├── test_se_layer.py │ │ └── test_transformer.py ├── test_onnx │ ├── __init__.py │ ├── data │ │ ├── fsaf_head_get_bboxes.pkl │ │ ├── retina_head_get_bboxes.pkl │ │ ├── ssd_head_get_bboxes.pkl │ │ ├── yolov3_head_get_bboxes.pkl │ │ └── yolov3_neck.pkl │ ├── test_head.py │ ├── test_neck.py │ └── utils.py ├── test_runtime │ ├── async_benchmark.py │ ├── test_async.py │ ├── test_config.py │ ├── test_eval_hook.py │ └── test_fp16.py └── test_utils │ ├── test_anchor.py │ ├── test_assigner.py │ ├── test_coder.py │ ├── test_general_data.py │ ├── test_hook.py │ ├── test_masks.py │ ├── test_misc.py │ ├── test_nms.py │ ├── test_version.py │ └── test_visualization.py └── tools ├── analysis_tools ├── analyze_logs.py ├── analyze_results.py ├── benchmark.py ├── coco_error_analysis.py ├── confusion_matrix.py ├── eval_metric.py ├── get_flops.py ├── optimize_anchors.py ├── robustness_eval.py └── test_robustness.py ├── dataset_converters ├── cityscapes.py ├── images2coco.py └── pascal_voc.py ├── deployment ├── mmdet2torchserve.py ├── mmdet_handler.py ├── onnx2tensorrt.py ├── pytorch2onnx.py ├── test.py └── test_torchserver.py ├── dist_test.sh ├── dist_train.sh ├── misc ├── browse_dataset.py └── print_config.py ├── model_converters ├── detectron2pytorch.py ├── publish_model.py ├── regnet2mmdet.py ├── selfsup2mmdet.py ├── upgrade_model_version.py └── upgrade_ssd_version.py ├── result └── result.bbox.json ├── slurm_test.sh ├── slurm_train.sh ├── test.py └── train.py /configs/_base_/datasets/lvis_v0.5_instance.py: -------------------------------------------------------------------------------- 1 | _base_ = 'coco_instance.py' 2 | dataset_type = 'LVISV05Dataset' 3 | data_root = 'data/lvis_v0.5/' 4 | data = dict( 5 | samples_per_gpu=2, 6 | workers_per_gpu=2, 7 | train=dict( 8 | _delete_=True, 9 | type='ClassBalancedDataset', 10 | oversample_thr=1e-3, 11 | dataset=dict( 12 | type=dataset_type, 13 | ann_file=data_root + 'annotations/lvis_v0.5_train.json', 14 | img_prefix=data_root + 'train2017/')), 15 | val=dict( 16 | type=dataset_type, 17 | ann_file=data_root + 'annotations/lvis_v0.5_val.json', 18 | img_prefix=data_root + 'val2017/'), 19 | test=dict( 20 | type=dataset_type, 21 | ann_file=data_root + 'annotations/lvis_v0.5_val.json', 22 | img_prefix=data_root + 'val2017/')) 23 | evaluation = dict(metric=['bbox', 'segm']) 24 | -------------------------------------------------------------------------------- /configs/_base_/datasets/lvis_v1_instance.py: -------------------------------------------------------------------------------- 1 | _base_ = 'coco_instance.py' 2 | dataset_type = 'LVISV1Dataset' 3 | data_root = 'data/lvis_v1/' 4 | data = dict( 5 | samples_per_gpu=2, 6 | workers_per_gpu=2, 7 | train=dict( 8 | _delete_=True, 9 | type='ClassBalancedDataset', 10 | oversample_thr=1e-3, 11 | dataset=dict( 12 | type=dataset_type, 13 | ann_file=data_root + 'annotations/lvis_v1_train.json', 14 | img_prefix=data_root)), 15 | val=dict( 16 | type=dataset_type, 17 | ann_file=data_root + 'annotations/lvis_v1_val.json', 18 | img_prefix=data_root), 19 | test=dict( 20 | type=dataset_type, 21 | ann_file=data_root + 'annotations/lvis_v1_val.json', 22 | img_prefix=data_root)) 23 | evaluation = dict(metric=['bbox', 'segm']) 24 | -------------------------------------------------------------------------------- /configs/_base_/default_runtime.py: -------------------------------------------------------------------------------- 1 | checkpoint_config = dict(interval=1) 2 | # yapf:disable 3 | log_config = dict( 4 | interval=50, 5 | hooks=[ 6 | dict(type='TextLoggerHook'), 7 | # dict(type='TensorboardLoggerHook') 8 | ]) 9 | # yapf:enable 10 | dist_params = dict(backend='nccl') 11 | log_level = 'INFO' 12 | load_from = None 13 | resume_from = None 14 | workflow = [('train', 1)] 15 | -------------------------------------------------------------------------------- /configs/_base_/models/ssd300.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | input_size = 300 3 | model = dict( 4 | type='SingleStageDetector', 5 | pretrained='open-mmlab://vgg16_caffe', 6 | backbone=dict( 7 | type='SSDVGG', 8 | input_size=input_size, 9 | depth=16, 10 | with_last_pool=False, 11 | ceil_mode=True, 12 | out_indices=(3, 4), 13 | out_feature_indices=(22, 34), 14 | l2_norm_scale=20), 15 | neck=None, 16 | bbox_head=dict( 17 | type='SSDHead', 18 | in_channels=(512, 1024, 512, 256, 256, 256), 19 | num_classes=80, 20 | anchor_generator=dict( 21 | type='SSDAnchorGenerator', 22 | scale_major=False, 23 | input_size=input_size, 24 | basesize_ratio_range=(0.15, 0.9), 25 | strides=[8, 16, 32, 64, 100, 300], 26 | ratios=[[2], [2, 3], [2, 3], [2, 3], [2], [2]]), 27 | bbox_coder=dict( 28 | type='DeltaXYWHBBoxCoder', 29 | target_means=[.0, .0, .0, .0], 30 | target_stds=[0.1, 0.1, 0.2, 0.2]))) 31 | cudnn_benchmark = True 32 | train_cfg = dict( 33 | assigner=dict( 34 | type='MaxIoUAssigner', 35 | pos_iou_thr=0.5, 36 | neg_iou_thr=0.5, 37 | min_pos_iou=0., 38 | ignore_iof_thr=-1, 39 | gt_max_assign_all=False), 40 | smoothl1_beta=1., 41 | allowed_border=-1, 42 | pos_weight=-1, 43 | neg_pos_ratio=3, 44 | debug=False) 45 | test_cfg = dict( 46 | nms=dict(type='nms', iou_threshold=0.45), 47 | min_bbox_size=0, 48 | score_thr=0.02, 49 | max_per_img=200) 50 | -------------------------------------------------------------------------------- /configs/_base_/schedules/schedule_1x.py: -------------------------------------------------------------------------------- 1 | # optimizer 2 | optimizer = dict(type='SGD', lr=0.002, momentum=0.9, weight_decay=0.0001) 3 | optimizer_config = dict(grad_clip=None) 4 | # learning policy 5 | lr_config = dict( 6 | policy='step', 7 | warmup='linear', 8 | warmup_iters=500, 9 | warmup_ratio=0.001, 10 | step=[8, 11]) 11 | total_epochs = 12 12 | -------------------------------------------------------------------------------- /configs/_base_/schedules/schedule_20e.py: -------------------------------------------------------------------------------- 1 | # optimizer 2 | optimizer = dict(type='SGD', lr=0.02, momentum=0.9, weight_decay=0.0001) 3 | optimizer_config = dict(grad_clip=None) 4 | # learning policy 5 | lr_config = dict( 6 | policy='step', 7 | warmup='linear', 8 | warmup_iters=500, 9 | warmup_ratio=0.001, 10 | step=[16, 19]) 11 | total_epochs = 20 12 | -------------------------------------------------------------------------------- /configs/_base_/schedules/schedule_2x.py: -------------------------------------------------------------------------------- 1 | # optimizer 2 | optimizer = dict(type='SGD', lr=0.02, momentum=0.9, weight_decay=0.0001) 3 | optimizer_config = dict(grad_clip=None) 4 | # learning policy 5 | lr_config = dict( 6 | policy='step', 7 | warmup='linear', 8 | warmup_iters=500, 9 | warmup_ratio=0.001, 10 | step=[16, 22]) 11 | total_epochs = 24 12 | -------------------------------------------------------------------------------- /configs/sspnet/faster_rcnn_r50_sspnet_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/faster_rcnn_r50_sspnet.py', 3 | '../_base_/datasets/coco_detection.py', 4 | '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py' 5 | ] 6 | -------------------------------------------------------------------------------- /demo/demo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/demo/demo.jpg -------------------------------------------------------------------------------- /demo/demo.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/demo/demo.mp4 -------------------------------------------------------------------------------- /demo/webcam_demo.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | import argparse 3 | 4 | import cv2 5 | import torch 6 | 7 | from mmdet.apis import inference_detector, init_detector 8 | 9 | 10 | def parse_args(): 11 | parser = argparse.ArgumentParser(description='MMDetection webcam demo') 12 | parser.add_argument('config', help='test config file path') 13 | parser.add_argument('checkpoint', help='checkpoint file') 14 | parser.add_argument( 15 | '--device', type=str, default='cuda:0', help='CPU/CUDA device option') 16 | parser.add_argument( 17 | '--camera-id', type=int, default=0, help='camera device id') 18 | parser.add_argument( 19 | '--score-thr', type=float, default=0.5, help='bbox score threshold') 20 | args = parser.parse_args() 21 | return args 22 | 23 | 24 | def main(): 25 | args = parse_args() 26 | 27 | device = torch.device(args.device) 28 | 29 | model = init_detector(args.config, args.checkpoint, device=device) 30 | 31 | camera = cv2.VideoCapture(args.camera_id) 32 | 33 | print('Press "Esc", "q" or "Q" to exit.') 34 | while True: 35 | ret_val, img = camera.read() 36 | result = inference_detector(model, img) 37 | 38 | ch = cv2.waitKey(1) 39 | if ch == 27 or ch == ord('q') or ch == ord('Q'): 40 | break 41 | 42 | model.show_result( 43 | img, result, score_thr=args.score_thr, wait_time=1, show=True) 44 | 45 | 46 | if __name__ == '__main__': 47 | main() 48 | -------------------------------------------------------------------------------- /img/cam.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/img/cam.png -------------------------------------------------------------------------------- /img/img1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/img/img1.png -------------------------------------------------------------------------------- /img/visualization.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/img/visualization.png -------------------------------------------------------------------------------- /latest_version/config/sspnet/faster_rcnn_r50_sspnet_1x_coco.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/faster_rcnn_r50_sspnet.py', 3 | '../_base_/datasets/coco_detection.py', 4 | '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py' 5 | ] 6 | -------------------------------------------------------------------------------- /latest_version/model/module/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/latest_version/model/module/__init__.py -------------------------------------------------------------------------------- /latest_version/model/module/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/latest_version/model/module/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /latest_version/model/module/__pycache__/heatmap.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/latest_version/model/module/__pycache__/heatmap.cpython-37.pyc -------------------------------------------------------------------------------- /latest_version/model/module/__pycache__/tinymap.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/latest_version/model/module/__pycache__/tinymap.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | import mmcv 3 | 4 | from .version import __version__, short_version 5 | 6 | 7 | def digit_version(version_str): 8 | digit_version = [] 9 | for x in version_str.split('.'): 10 | if x.isdigit(): 11 | digit_version.append(int(x)) 12 | elif x.find('rc') != -1: 13 | patch_version = x.split('rc') 14 | digit_version.append(int(patch_version[0]) - 1) 15 | digit_version.append(int(patch_version[1])) 16 | return digit_version 17 | 18 | 19 | mmcv_minimum_version = '1.3.8' 20 | mmcv_maximum_version = '1.5.0' 21 | mmcv_version = digit_version(mmcv.__version__) 22 | 23 | 24 | assert (mmcv_version >= digit_version(mmcv_minimum_version) 25 | and mmcv_version <= digit_version(mmcv_maximum_version)), \ 26 | f'MMCV=={mmcv.__version__} is used but incompatible. ' \ 27 | f'Please install mmcv>={mmcv_minimum_version}, <={mmcv_maximum_version}.' 28 | 29 | __all__ = ['__version__', 'short_version'] 30 | -------------------------------------------------------------------------------- /mmdet/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/__pycache__/version.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/__pycache__/version.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/apis/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .inference import (async_inference_detector, inference_detector, 3 | init_detector, show_result_pyplot) 4 | from .test import multi_gpu_test, single_gpu_test 5 | from .train import (get_root_logger, init_random_seed, set_random_seed, 6 | train_detector) 7 | 8 | __all__ = [ 9 | 'get_root_logger', 'set_random_seed', 'train_detector', 'init_detector', 10 | 'async_inference_detector', 'inference_detector', 'show_result_pyplot', 11 | 'multi_gpu_test', 'single_gpu_test', 'init_random_seed' 12 | ] 13 | -------------------------------------------------------------------------------- /mmdet/apis/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/apis/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/apis/__pycache__/inference.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/apis/__pycache__/inference.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/apis/__pycache__/test.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/apis/__pycache__/test.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/apis/__pycache__/train.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/apis/__pycache__/train.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .anchor import * # noqa: F401, F403 3 | from .bbox import * # noqa: F401, F403 4 | from .data_structures import * # noqa: F401, F403 5 | from .evaluation import * # noqa: F401, F403 6 | from .hook import * # noqa: F401, F403 7 | from .mask import * # noqa: F401, F403 8 | from .post_processing import * # noqa: F401, F403 9 | from .utils import * # noqa: F401, F403 10 | -------------------------------------------------------------------------------- /mmdet/core/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/anchor/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .anchor_generator import (AnchorGenerator, LegacyAnchorGenerator, 3 | YOLOAnchorGenerator) 4 | from .builder import (ANCHOR_GENERATORS, PRIOR_GENERATORS, 5 | build_anchor_generator, build_prior_generator) 6 | from .point_generator import MlvlPointGenerator, PointGenerator 7 | from .utils import anchor_inside_flags, calc_region, images_to_levels 8 | 9 | __all__ = [ 10 | 'AnchorGenerator', 'LegacyAnchorGenerator', 'anchor_inside_flags', 11 | 'PointGenerator', 'images_to_levels', 'calc_region', 12 | 'build_anchor_generator', 'ANCHOR_GENERATORS', 'YOLOAnchorGenerator', 13 | 'build_prior_generator', 'PRIOR_GENERATORS', 'MlvlPointGenerator' 14 | ] 15 | -------------------------------------------------------------------------------- /mmdet/core/anchor/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/anchor/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/anchor/__pycache__/anchor_generator.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/anchor/__pycache__/anchor_generator.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/anchor/__pycache__/builder.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/anchor/__pycache__/builder.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/anchor/__pycache__/point_generator.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/anchor/__pycache__/point_generator.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/anchor/__pycache__/utils.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/anchor/__pycache__/utils.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/anchor/builder.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | import warnings 3 | 4 | from mmcv.utils import Registry, build_from_cfg 5 | 6 | PRIOR_GENERATORS = Registry('Generator for anchors and points') 7 | 8 | ANCHOR_GENERATORS = PRIOR_GENERATORS 9 | 10 | 11 | def build_prior_generator(cfg, default_args=None): 12 | return build_from_cfg(cfg, PRIOR_GENERATORS, default_args) 13 | 14 | 15 | def build_anchor_generator(cfg, default_args=None): 16 | warnings.warn( 17 | '``build_anchor_generator`` would be deprecated soon, please use ' 18 | '``build_prior_generator`` ') 19 | return build_prior_generator(cfg, default_args=default_args) 20 | -------------------------------------------------------------------------------- /mmdet/core/bbox/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/__pycache__/builder.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/__pycache__/builder.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/__pycache__/demodata.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/__pycache__/demodata.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/__pycache__/transforms.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/__pycache__/transforms.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/assigners/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .approx_max_iou_assigner import ApproxMaxIoUAssigner 3 | from .assign_result import AssignResult 4 | from .atss_assigner import ATSSAssigner 5 | from .base_assigner import BaseAssigner 6 | from .center_region_assigner import CenterRegionAssigner 7 | from .grid_assigner import GridAssigner 8 | from .hungarian_assigner import HungarianAssigner 9 | from .max_iou_assigner import MaxIoUAssigner 10 | from .point_assigner import PointAssigner 11 | from .region_assigner import RegionAssigner 12 | from .sim_ota_assigner import SimOTAAssigner 13 | from .uniform_assigner import UniformAssigner 14 | 15 | __all__ = [ 16 | 'BaseAssigner', 'MaxIoUAssigner', 'ApproxMaxIoUAssigner', 'AssignResult', 17 | 'PointAssigner', 'ATSSAssigner', 'CenterRegionAssigner', 'GridAssigner', 18 | 'HungarianAssigner', 'RegionAssigner', 'UniformAssigner', 'SimOTAAssigner' 19 | ] 20 | -------------------------------------------------------------------------------- /mmdet/core/bbox/assigners/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/assigners/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/assigners/__pycache__/approx_max_iou_assigner.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/assigners/__pycache__/approx_max_iou_assigner.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/assigners/__pycache__/assign_result.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/assigners/__pycache__/assign_result.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/assigners/__pycache__/atss_assigner.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/assigners/__pycache__/atss_assigner.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/assigners/__pycache__/base_assigner.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/assigners/__pycache__/base_assigner.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/assigners/__pycache__/center_region_assigner.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/assigners/__pycache__/center_region_assigner.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/assigners/__pycache__/grid_assigner.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/assigners/__pycache__/grid_assigner.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/assigners/__pycache__/hungarian_assigner.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/assigners/__pycache__/hungarian_assigner.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/assigners/__pycache__/max_iou_assigner.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/assigners/__pycache__/max_iou_assigner.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/assigners/__pycache__/point_assigner.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/assigners/__pycache__/point_assigner.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/assigners/__pycache__/region_assigner.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/assigners/__pycache__/region_assigner.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/assigners/__pycache__/sim_ota_assigner.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/assigners/__pycache__/sim_ota_assigner.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/assigners/__pycache__/uniform_assigner.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/assigners/__pycache__/uniform_assigner.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/assigners/base_assigner.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from abc import ABCMeta, abstractmethod 3 | 4 | 5 | class BaseAssigner(metaclass=ABCMeta): 6 | """Base assigner that assigns boxes to ground truth boxes.""" 7 | 8 | @abstractmethod 9 | def assign(self, bboxes, gt_bboxes, gt_bboxes_ignore=None, gt_labels=None): 10 | """Assign boxes to either a ground truth boxes or a negative boxes.""" 11 | -------------------------------------------------------------------------------- /mmdet/core/bbox/builder.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from mmcv.utils import Registry, build_from_cfg 3 | 4 | BBOX_ASSIGNERS = Registry('bbox_assigner') 5 | BBOX_SAMPLERS = Registry('bbox_sampler') 6 | BBOX_CODERS = Registry('bbox_coder') 7 | 8 | 9 | def build_assigner(cfg, **default_args): 10 | """Builder of box assigner.""" 11 | return build_from_cfg(cfg, BBOX_ASSIGNERS, default_args) 12 | 13 | 14 | def build_sampler(cfg, **default_args): 15 | """Builder of box sampler.""" 16 | return build_from_cfg(cfg, BBOX_SAMPLERS, default_args) 17 | 18 | 19 | def build_bbox_coder(cfg, **default_args): 20 | """Builder of box coder.""" 21 | return build_from_cfg(cfg, BBOX_CODERS, default_args) 22 | -------------------------------------------------------------------------------- /mmdet/core/bbox/coder/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .base_bbox_coder import BaseBBoxCoder 3 | from .bucketing_bbox_coder import BucketingBBoxCoder 4 | from .delta_xywh_bbox_coder import DeltaXYWHBBoxCoder 5 | from .distance_point_bbox_coder import DistancePointBBoxCoder 6 | from .legacy_delta_xywh_bbox_coder import LegacyDeltaXYWHBBoxCoder 7 | from .pseudo_bbox_coder import PseudoBBoxCoder 8 | from .tblr_bbox_coder import TBLRBBoxCoder 9 | from .yolo_bbox_coder import YOLOBBoxCoder 10 | 11 | __all__ = [ 12 | 'BaseBBoxCoder', 'PseudoBBoxCoder', 'DeltaXYWHBBoxCoder', 13 | 'LegacyDeltaXYWHBBoxCoder', 'TBLRBBoxCoder', 'YOLOBBoxCoder', 14 | 'BucketingBBoxCoder', 'DistancePointBBoxCoder' 15 | ] 16 | -------------------------------------------------------------------------------- /mmdet/core/bbox/coder/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/coder/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/coder/__pycache__/base_bbox_coder.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/coder/__pycache__/base_bbox_coder.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/coder/__pycache__/bucketing_bbox_coder.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/coder/__pycache__/bucketing_bbox_coder.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/coder/__pycache__/delta_xywh_bbox_coder.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/coder/__pycache__/delta_xywh_bbox_coder.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/coder/__pycache__/distance_point_bbox_coder.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/coder/__pycache__/distance_point_bbox_coder.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/coder/__pycache__/legacy_delta_xywh_bbox_coder.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/coder/__pycache__/legacy_delta_xywh_bbox_coder.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/coder/__pycache__/pseudo_bbox_coder.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/coder/__pycache__/pseudo_bbox_coder.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/coder/__pycache__/tblr_bbox_coder.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/coder/__pycache__/tblr_bbox_coder.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/coder/__pycache__/yolo_bbox_coder.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/coder/__pycache__/yolo_bbox_coder.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/coder/base_bbox_coder.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from abc import ABCMeta, abstractmethod 3 | 4 | 5 | class BaseBBoxCoder(metaclass=ABCMeta): 6 | """Base bounding box coder.""" 7 | 8 | def __init__(self, **kwargs): 9 | pass 10 | 11 | @abstractmethod 12 | def encode(self, bboxes, gt_bboxes): 13 | """Encode deltas between bboxes and ground truth boxes.""" 14 | 15 | @abstractmethod 16 | def decode(self, bboxes, bboxes_pred): 17 | """Decode the predicted bboxes according to prediction and base 18 | boxes.""" 19 | -------------------------------------------------------------------------------- /mmdet/core/bbox/coder/pseudo_bbox_coder.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from ..builder import BBOX_CODERS 3 | from .base_bbox_coder import BaseBBoxCoder 4 | 5 | 6 | @BBOX_CODERS.register_module() 7 | class PseudoBBoxCoder(BaseBBoxCoder): 8 | """Pseudo bounding box coder.""" 9 | 10 | def __init__(self, **kwargs): 11 | super(BaseBBoxCoder, self).__init__(**kwargs) 12 | 13 | def encode(self, bboxes, gt_bboxes): 14 | """torch.Tensor: return the given ``bboxes``""" 15 | return gt_bboxes 16 | 17 | def decode(self, bboxes, pred_bboxes): 18 | """torch.Tensor: return the given ``pred_bboxes``""" 19 | return pred_bboxes 20 | -------------------------------------------------------------------------------- /mmdet/core/bbox/demodata.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | import numpy as np 3 | import torch 4 | 5 | from mmdet.utils.util_random import ensure_rng 6 | 7 | 8 | def random_boxes(num=1, scale=1, rng=None): 9 | """Simple version of ``kwimage.Boxes.random`` 10 | 11 | Returns: 12 | Tensor: shape (n, 4) in x1, y1, x2, y2 format. 13 | 14 | References: 15 | https://gitlab.kitware.com/computer-vision/kwimage/blob/master/kwimage/structs/boxes.py#L1390 16 | 17 | Example: 18 | >>> num = 3 19 | >>> scale = 512 20 | >>> rng = 0 21 | >>> boxes = random_boxes(num, scale, rng) 22 | >>> print(boxes) 23 | tensor([[280.9925, 278.9802, 308.6148, 366.1769], 24 | [216.9113, 330.6978, 224.0446, 456.5878], 25 | [405.3632, 196.3221, 493.3953, 270.7942]]) 26 | """ 27 | rng = ensure_rng(rng) 28 | 29 | tlbr = rng.rand(num, 4).astype(np.float32) 30 | 31 | tl_x = np.minimum(tlbr[:, 0], tlbr[:, 2]) 32 | tl_y = np.minimum(tlbr[:, 1], tlbr[:, 3]) 33 | br_x = np.maximum(tlbr[:, 0], tlbr[:, 2]) 34 | br_y = np.maximum(tlbr[:, 1], tlbr[:, 3]) 35 | 36 | tlbr[:, 0] = tl_x * scale 37 | tlbr[:, 1] = tl_y * scale 38 | tlbr[:, 2] = br_x * scale 39 | tlbr[:, 3] = br_y * scale 40 | 41 | boxes = torch.from_numpy(tlbr) 42 | return boxes 43 | -------------------------------------------------------------------------------- /mmdet/core/bbox/iou_calculators/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .builder import build_iou_calculator 3 | from .iou2d_calculator import BboxOverlaps2D, bbox_overlaps 4 | 5 | __all__ = ['build_iou_calculator', 'BboxOverlaps2D', 'bbox_overlaps'] 6 | -------------------------------------------------------------------------------- /mmdet/core/bbox/iou_calculators/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/iou_calculators/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/iou_calculators/__pycache__/builder.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/iou_calculators/__pycache__/builder.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/iou_calculators/__pycache__/iou2d_calculator.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/iou_calculators/__pycache__/iou2d_calculator.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/iou_calculators/builder.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from mmcv.utils import Registry, build_from_cfg 3 | 4 | IOU_CALCULATORS = Registry('IoU calculator') 5 | 6 | 7 | def build_iou_calculator(cfg, default_args=None): 8 | """Builder of IoU calculator.""" 9 | return build_from_cfg(cfg, IOU_CALCULATORS, default_args) 10 | -------------------------------------------------------------------------------- /mmdet/core/bbox/match_costs/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .builder import build_match_cost 3 | from .match_cost import BBoxL1Cost, ClassificationCost, FocalLossCost, IoUCost 4 | 5 | __all__ = [ 6 | 'build_match_cost', 'ClassificationCost', 'BBoxL1Cost', 'IoUCost', 7 | 'FocalLossCost' 8 | ] 9 | -------------------------------------------------------------------------------- /mmdet/core/bbox/match_costs/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/match_costs/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/match_costs/__pycache__/builder.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/match_costs/__pycache__/builder.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/match_costs/__pycache__/match_cost.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/match_costs/__pycache__/match_cost.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/match_costs/builder.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from mmcv.utils import Registry, build_from_cfg 3 | 4 | MATCH_COST = Registry('Match Cost') 5 | 6 | 7 | def build_match_cost(cfg, default_args=None): 8 | """Builder of IoU calculator.""" 9 | return build_from_cfg(cfg, MATCH_COST, default_args) 10 | -------------------------------------------------------------------------------- /mmdet/core/bbox/samplers/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .base_sampler import BaseSampler 3 | from .combined_sampler import CombinedSampler 4 | from .instance_balanced_pos_sampler import InstanceBalancedPosSampler 5 | from .iou_balanced_neg_sampler import IoUBalancedNegSampler 6 | from .ohem_sampler import OHEMSampler 7 | from .pseudo_sampler import PseudoSampler 8 | from .random_sampler import RandomSampler 9 | from .sampling_result import SamplingResult 10 | from .score_hlr_sampler import ScoreHLRSampler 11 | from .ic_neg_sampler import ICNegSampler 12 | __all__ = [ 13 | 'BaseSampler', 'PseudoSampler', 'RandomSampler', 14 | 'InstanceBalancedPosSampler', 'IoUBalancedNegSampler', 'CombinedSampler', 15 | 'OHEMSampler', 'SamplingResult', 'ScoreHLRSampler','ICNegSampler' 16 | ] 17 | -------------------------------------------------------------------------------- /mmdet/core/bbox/samplers/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/samplers/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/samplers/__pycache__/base_sampler.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/samplers/__pycache__/base_sampler.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/samplers/__pycache__/combined_sampler.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/samplers/__pycache__/combined_sampler.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/samplers/__pycache__/ic_base_sampler.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/samplers/__pycache__/ic_base_sampler.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/samplers/__pycache__/ic_neg_sampler.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/samplers/__pycache__/ic_neg_sampler.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/samplers/__pycache__/instance_balanced_pos_sampler.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/samplers/__pycache__/instance_balanced_pos_sampler.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/samplers/__pycache__/iou_balanced_neg_sampler.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/samplers/__pycache__/iou_balanced_neg_sampler.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/samplers/__pycache__/ohem_sampler.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/samplers/__pycache__/ohem_sampler.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/samplers/__pycache__/pseudo_sampler.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/samplers/__pycache__/pseudo_sampler.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/samplers/__pycache__/random_sampler.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/samplers/__pycache__/random_sampler.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/samplers/__pycache__/sampling_result.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/samplers/__pycache__/sampling_result.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/samplers/__pycache__/score_hlr_sampler.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/bbox/samplers/__pycache__/score_hlr_sampler.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/bbox/samplers/combined_sampler.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from ..builder import BBOX_SAMPLERS, build_sampler 3 | from .base_sampler import BaseSampler 4 | 5 | 6 | @BBOX_SAMPLERS.register_module() 7 | class CombinedSampler(BaseSampler): 8 | """A sampler that combines positive sampler and negative sampler.""" 9 | 10 | def __init__(self, pos_sampler, neg_sampler, **kwargs): 11 | super(CombinedSampler, self).__init__(**kwargs) 12 | self.pos_sampler = build_sampler(pos_sampler, **kwargs) 13 | self.neg_sampler = build_sampler(neg_sampler, **kwargs) 14 | 15 | def _sample_pos(self, **kwargs): 16 | """Sample positive samples.""" 17 | raise NotImplementedError 18 | 19 | def _sample_neg(self, **kwargs): 20 | """Sample negative samples.""" 21 | raise NotImplementedError 22 | -------------------------------------------------------------------------------- /mmdet/core/data_structures/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .general_data import GeneralData 3 | from .instance_data import InstanceData 4 | 5 | __all__ = ['GeneralData', 'InstanceData'] 6 | -------------------------------------------------------------------------------- /mmdet/core/data_structures/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/data_structures/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/data_structures/__pycache__/general_data.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/data_structures/__pycache__/general_data.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/data_structures/__pycache__/instance_data.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/data_structures/__pycache__/instance_data.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/evaluation/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .class_names import (cityscapes_classes, coco_classes, dataset_aliases, 3 | get_classes, imagenet_det_classes, 4 | imagenet_vid_classes, voc_classes) 5 | from .eval_hooks import DistEvalHook, EvalHook 6 | from .mean_ap import average_precision, eval_map, print_map_summary 7 | from .recall import (eval_recalls, plot_iou_recall, plot_num_recall, 8 | print_recall_summary) 9 | 10 | __all__ = [ 11 | 'voc_classes', 'imagenet_det_classes', 'imagenet_vid_classes', 12 | 'coco_classes', 'cityscapes_classes', 'dataset_aliases', 'get_classes', 13 | 'DistEvalHook', 'EvalHook', 'average_precision', 'eval_map', 14 | 'print_map_summary', 'eval_recalls', 'print_recall_summary', 15 | 'plot_num_recall', 'plot_iou_recall' 16 | ] 17 | -------------------------------------------------------------------------------- /mmdet/core/evaluation/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/evaluation/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/evaluation/__pycache__/bbox_overlaps.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/evaluation/__pycache__/bbox_overlaps.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/evaluation/__pycache__/class_names.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/evaluation/__pycache__/class_names.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/evaluation/__pycache__/cocoeval.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/evaluation/__pycache__/cocoeval.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/evaluation/__pycache__/eval_hooks.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/evaluation/__pycache__/eval_hooks.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/evaluation/__pycache__/mean_ap.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/evaluation/__pycache__/mean_ap.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/evaluation/__pycache__/recall.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/evaluation/__pycache__/recall.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/evaluation/tiny_eval/__init__.py: -------------------------------------------------------------------------------- 1 | from .bounding_box import torch_nms 2 | from .bounding_box import BoxList -------------------------------------------------------------------------------- /mmdet/core/evaluation/tiny_eval/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/evaluation/tiny_eval/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/evaluation/tiny_eval/__pycache__/bounding_box.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/evaluation/tiny_eval/__pycache__/bounding_box.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/evaluation/tiny_eval/__pycache__/split_and_merge_image.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/evaluation/tiny_eval/__pycache__/split_and_merge_image.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/export/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .onnx_helper import (add_dummy_nms_for_onnx, dynamic_clip_for_onnx, 3 | get_k_for_topk) 4 | from .pytorch2onnx import (build_model_from_cfg, 5 | generate_inputs_and_wrap_model, 6 | preprocess_example_input) 7 | 8 | __all__ = [ 9 | 'build_model_from_cfg', 'generate_inputs_and_wrap_model', 10 | 'preprocess_example_input', 'get_k_for_topk', 'add_dummy_nms_for_onnx', 11 | 'dynamic_clip_for_onnx' 12 | ] 13 | -------------------------------------------------------------------------------- /mmdet/core/hook/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .checkloss_hook import CheckInvalidLossHook 3 | from .ema import ExpMomentumEMAHook, LinearMomentumEMAHook 4 | from .sync_norm_hook import SyncNormHook 5 | from .sync_random_size_hook import SyncRandomSizeHook 6 | from .yolox_lrupdater_hook import YOLOXLrUpdaterHook 7 | from .yolox_mode_switch_hook import YOLOXModeSwitchHook 8 | 9 | __all__ = [ 10 | 'SyncRandomSizeHook', 'YOLOXModeSwitchHook', 'SyncNormHook', 11 | 'ExpMomentumEMAHook', 'LinearMomentumEMAHook', 'YOLOXLrUpdaterHook', 12 | 'CheckInvalidLossHook' 13 | ] 14 | -------------------------------------------------------------------------------- /mmdet/core/hook/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/hook/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/hook/__pycache__/checkloss_hook.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/hook/__pycache__/checkloss_hook.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/hook/__pycache__/ema.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/hook/__pycache__/ema.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/hook/__pycache__/sync_norm_hook.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/hook/__pycache__/sync_norm_hook.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/hook/__pycache__/sync_random_size_hook.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/hook/__pycache__/sync_random_size_hook.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/hook/__pycache__/yolox_lrupdater_hook.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/hook/__pycache__/yolox_lrupdater_hook.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/hook/__pycache__/yolox_mode_switch_hook.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/hook/__pycache__/yolox_mode_switch_hook.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/hook/checkloss_hook.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | import torch 3 | from mmcv.runner.hooks import HOOKS, Hook 4 | 5 | 6 | @HOOKS.register_module() 7 | class CheckInvalidLossHook(Hook): 8 | """Check invalid loss hook. 9 | 10 | This hook will regularly check whether the loss is valid 11 | during training. 12 | 13 | Args: 14 | interval (int): Checking interval (every k iterations). 15 | Default: 50. 16 | """ 17 | 18 | def __init__(self, interval=50): 19 | self.interval = interval 20 | 21 | def after_train_iter(self, runner): 22 | if self.every_n_iters(runner, self.interval): 23 | assert torch.isfinite(runner.outputs['loss']), \ 24 | runner.logger.info('loss become infinite or NaN!') 25 | -------------------------------------------------------------------------------- /mmdet/core/mask/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .mask_target import mask_target 3 | from .structures import BaseInstanceMasks, BitmapMasks, PolygonMasks 4 | from .utils import encode_mask_results, split_combined_polys 5 | 6 | __all__ = [ 7 | 'split_combined_polys', 'mask_target', 'BaseInstanceMasks', 'BitmapMasks', 8 | 'PolygonMasks', 'encode_mask_results' 9 | ] 10 | -------------------------------------------------------------------------------- /mmdet/core/mask/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/mask/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/mask/__pycache__/mask_target.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/mask/__pycache__/mask_target.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/mask/__pycache__/structures.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/mask/__pycache__/structures.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/mask/__pycache__/utils.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/mask/__pycache__/utils.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/post_processing/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .bbox_nms import fast_nms, multiclass_nms 3 | from .matrix_nms import mask_matrix_nms 4 | from .merge_augs import (merge_aug_bboxes, merge_aug_masks, 5 | merge_aug_proposals, merge_aug_scores) 6 | 7 | __all__ = [ 8 | 'multiclass_nms', 'merge_aug_proposals', 'merge_aug_bboxes', 9 | 'merge_aug_scores', 'merge_aug_masks', 'mask_matrix_nms', 'fast_nms' 10 | ] 11 | -------------------------------------------------------------------------------- /mmdet/core/post_processing/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/post_processing/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/post_processing/__pycache__/bbox_nms.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/post_processing/__pycache__/bbox_nms.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/post_processing/__pycache__/matrix_nms.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/post_processing/__pycache__/matrix_nms.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/post_processing/__pycache__/merge_augs.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/post_processing/__pycache__/merge_augs.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/utils/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .dist_utils import (DistOptimizerHook, all_reduce_dict, allreduce_grads, 3 | reduce_mean) 4 | from .misc import (center_of_mass, filter_scores_and_topk, flip_tensor, 5 | generate_coordinate, mask2ndarray, multi_apply, 6 | select_single_mlvl, unmap) 7 | 8 | __all__ = [ 9 | 'allreduce_grads', 'DistOptimizerHook', 'reduce_mean', 'multi_apply', 10 | 'unmap', 'mask2ndarray', 'flip_tensor', 'all_reduce_dict', 11 | 'center_of_mass', 'generate_coordinate', 'select_single_mlvl', 12 | 'filter_scores_and_topk' 13 | ] 14 | -------------------------------------------------------------------------------- /mmdet/core/utils/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/utils/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/utils/__pycache__/dist_utils.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/utils/__pycache__/dist_utils.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/utils/__pycache__/misc.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/utils/__pycache__/misc.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/visualization/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .image import (color_val_matplotlib, imshow_det_bboxes, 3 | imshow_gt_det_bboxes) 4 | 5 | __all__ = ['imshow_det_bboxes', 'imshow_gt_det_bboxes', 'color_val_matplotlib'] 6 | -------------------------------------------------------------------------------- /mmdet/core/visualization/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/visualization/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/core/visualization/__pycache__/image.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/core/visualization/__pycache__/image.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/datasets/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .builder import DATASETS, PIPELINES, build_dataloader, build_dataset 3 | from .cityscapes import CityscapesDataset 4 | from .coco import CocoDataset 5 | from .coco_panoptic import CocoPanopticDataset 6 | from .custom import CustomDataset 7 | from .dataset_wrappers import (ClassBalancedDataset, ConcatDataset, 8 | MultiImageMixDataset, RepeatDataset) 9 | from .deepfashion import DeepFashionDataset 10 | from .lvis import LVISDataset, LVISV1Dataset, LVISV05Dataset 11 | from .samplers import DistributedGroupSampler, DistributedSampler, GroupSampler 12 | from .utils import (NumClassCheckHook, get_loading_pipeline, 13 | replace_ImageToTensor) 14 | from .voc import VOCDataset 15 | from .wider_face import WIDERFaceDataset 16 | from .xml_style import XMLDataset 17 | 18 | __all__ = [ 19 | 'CustomDataset', 'XMLDataset', 'CocoDataset', 'DeepFashionDataset', 20 | 'VOCDataset', 'CityscapesDataset', 'LVISDataset', 'LVISV05Dataset', 21 | 'LVISV1Dataset', 'GroupSampler', 'DistributedGroupSampler', 22 | 'DistributedSampler', 'build_dataloader', 'ConcatDataset', 'RepeatDataset', 23 | 'ClassBalancedDataset', 'WIDERFaceDataset', 'DATASETS', 'PIPELINES', 24 | 'build_dataset', 'replace_ImageToTensor', 'get_loading_pipeline', 25 | 'NumClassCheckHook', 'CocoPanopticDataset', 'MultiImageMixDataset' 26 | ] 27 | -------------------------------------------------------------------------------- /mmdet/datasets/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/datasets/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/datasets/__pycache__/builder.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/datasets/__pycache__/builder.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/datasets/__pycache__/cityscapes.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/datasets/__pycache__/cityscapes.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/datasets/__pycache__/coco.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/datasets/__pycache__/coco.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/datasets/__pycache__/coco_panoptic.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/datasets/__pycache__/coco_panoptic.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/datasets/__pycache__/custom.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/datasets/__pycache__/custom.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/datasets/__pycache__/dataset_wrappers.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/datasets/__pycache__/dataset_wrappers.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/datasets/__pycache__/deepfashion.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/datasets/__pycache__/deepfashion.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/datasets/__pycache__/lvis.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/datasets/__pycache__/lvis.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/datasets/__pycache__/utils.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/datasets/__pycache__/utils.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/datasets/__pycache__/voc.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/datasets/__pycache__/voc.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/datasets/__pycache__/wider_face.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/datasets/__pycache__/wider_face.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/datasets/__pycache__/xml_style.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/datasets/__pycache__/xml_style.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/datasets/api_wrappers/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .coco_api import COCO, COCOeval 3 | from .panoptic_evaluation import pq_compute_multi_core, pq_compute_single_core 4 | 5 | __all__ = [ 6 | 'COCO', 'COCOeval', 'pq_compute_multi_core', 'pq_compute_single_core' 7 | ] 8 | -------------------------------------------------------------------------------- /mmdet/datasets/api_wrappers/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/datasets/api_wrappers/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/datasets/api_wrappers/__pycache__/coco_api.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/datasets/api_wrappers/__pycache__/coco_api.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/datasets/api_wrappers/__pycache__/panoptic_evaluation.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/datasets/api_wrappers/__pycache__/panoptic_evaluation.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/datasets/deepfashion.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .builder import DATASETS 3 | from .coco import CocoDataset 4 | 5 | 6 | @DATASETS.register_module() 7 | class DeepFashionDataset(CocoDataset): 8 | 9 | CLASSES = ('top', 'skirt', 'leggings', 'dress', 'outer', 'pants', 'bag', 10 | 'neckwear', 'headwear', 'eyeglass', 'belt', 'footwear', 'hair', 11 | 'skin', 'face') 12 | -------------------------------------------------------------------------------- /mmdet/datasets/pipelines/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/datasets/pipelines/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/datasets/pipelines/__pycache__/auto_augment.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/datasets/pipelines/__pycache__/auto_augment.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/datasets/pipelines/__pycache__/compose.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/datasets/pipelines/__pycache__/compose.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/datasets/pipelines/__pycache__/formating.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/datasets/pipelines/__pycache__/formating.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/datasets/pipelines/__pycache__/instaboost.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/datasets/pipelines/__pycache__/instaboost.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/datasets/pipelines/__pycache__/loading.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/datasets/pipelines/__pycache__/loading.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/datasets/pipelines/__pycache__/test_time_aug.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/datasets/pipelines/__pycache__/test_time_aug.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/datasets/pipelines/__pycache__/transforms.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/datasets/pipelines/__pycache__/transforms.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/datasets/samplers/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .distributed_sampler import DistributedSampler 3 | from .group_sampler import DistributedGroupSampler, GroupSampler 4 | from .infinite_sampler import InfiniteBatchSampler, InfiniteGroupBatchSampler 5 | 6 | __all__ = [ 7 | 'DistributedSampler', 'DistributedGroupSampler', 'GroupSampler', 8 | 'InfiniteGroupBatchSampler', 'InfiniteBatchSampler' 9 | ] 10 | -------------------------------------------------------------------------------- /mmdet/datasets/samplers/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/datasets/samplers/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/datasets/samplers/__pycache__/distributed_sampler.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/datasets/samplers/__pycache__/distributed_sampler.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/datasets/samplers/__pycache__/group_sampler.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/datasets/samplers/__pycache__/group_sampler.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/datasets/samplers/__pycache__/infinite_sampler.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/datasets/samplers/__pycache__/infinite_sampler.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/datasets/samplers/distributed_sampler.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | import math 3 | 4 | import torch 5 | from torch.utils.data import DistributedSampler as _DistributedSampler 6 | 7 | 8 | class DistributedSampler(_DistributedSampler): 9 | 10 | def __init__(self, 11 | dataset, 12 | num_replicas=None, 13 | rank=None, 14 | shuffle=True, 15 | seed=0): 16 | super().__init__( 17 | dataset, num_replicas=num_replicas, rank=rank, shuffle=shuffle) 18 | # for the compatibility from PyTorch 1.3+ 19 | self.seed = seed if seed is not None else 0 20 | 21 | def __iter__(self): 22 | # deterministically shuffle based on epoch 23 | if self.shuffle: 24 | g = torch.Generator() 25 | g.manual_seed(self.epoch + self.seed) 26 | indices = torch.randperm(len(self.dataset), generator=g).tolist() 27 | else: 28 | indices = torch.arange(len(self.dataset)).tolist() 29 | 30 | # add extra samples to make it evenly divisible 31 | # in case that indices is shorter than half of total_size 32 | indices = (indices * 33 | math.ceil(self.total_size / len(indices)))[:self.total_size] 34 | assert len(indices) == self.total_size 35 | 36 | # subsample 37 | indices = indices[self.rank:self.total_size:self.num_replicas] 38 | assert len(indices) == self.num_samples 39 | 40 | return iter(indices) 41 | -------------------------------------------------------------------------------- /mmdet/models/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .backbones import * # noqa: F401,F403 3 | from .builder import (BACKBONES, DETECTORS, HEADS, LOSSES, NECKS, 4 | ROI_EXTRACTORS, SHARED_HEADS, build_backbone, 5 | build_detector, build_head, build_loss, build_neck, 6 | build_roi_extractor, build_shared_head) 7 | from .dense_heads import * # noqa: F401,F403 8 | from .detectors import * # noqa: F401,F403 9 | from .losses import * # noqa: F401,F403 10 | from .necks import * # noqa: F401,F403 11 | from .plugins import * # noqa: F401,F403 12 | from .roi_heads import * # noqa: F401,F403 13 | from .seg_heads import * # noqa: F401,F403 14 | 15 | __all__ = [ 16 | 'BACKBONES', 'NECKS', 'ROI_EXTRACTORS', 'SHARED_HEADS', 'HEADS', 'LOSSES', 17 | 'DETECTORS', 'build_backbone', 'build_neck', 'build_roi_extractor', 18 | 'build_shared_head', 'build_head', 'build_loss', 'build_detector' 19 | ] 20 | -------------------------------------------------------------------------------- /mmdet/models/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/__pycache__/builder.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/__pycache__/builder.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/backbones/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .csp_darknet import CSPDarknet 3 | from .darknet import Darknet 4 | from .detectors_resnet import DetectoRS_ResNet 5 | from .detectors_resnext import DetectoRS_ResNeXt 6 | from .hourglass import HourglassNet 7 | from .hrnet import HRNet 8 | from .mobilenet_v2 import MobileNetV2 9 | from .pvt import PyramidVisionTransformer, PyramidVisionTransformerV2 10 | from .regnet import RegNet 11 | from .res2net import Res2Net 12 | from .resnest import ResNeSt 13 | from .resnet import ResNet, ResNetV1d 14 | from .resnext import ResNeXt 15 | from .ssd_vgg import SSDVGG 16 | from .swin import SwinTransformer 17 | from .trident_resnet import TridentResNet 18 | 19 | __all__ = [ 20 | 'RegNet', 'ResNet', 'ResNetV1d', 'ResNeXt', 'SSDVGG', 'HRNet', 21 | 'MobileNetV2', 'Res2Net', 'HourglassNet', 'DetectoRS_ResNet', 22 | 'DetectoRS_ResNeXt', 'Darknet', 'ResNeSt', 'TridentResNet', 'CSPDarknet', 23 | 'SwinTransformer', 'PyramidVisionTransformer', 'PyramidVisionTransformerV2' 24 | ] 25 | -------------------------------------------------------------------------------- /mmdet/models/backbones/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/backbones/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/backbones/__pycache__/csp_darknet.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/backbones/__pycache__/csp_darknet.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/backbones/__pycache__/darknet.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/backbones/__pycache__/darknet.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/backbones/__pycache__/detectors_resnet.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/backbones/__pycache__/detectors_resnet.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/backbones/__pycache__/detectors_resnext.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/backbones/__pycache__/detectors_resnext.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/backbones/__pycache__/hourglass.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/backbones/__pycache__/hourglass.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/backbones/__pycache__/hrnet.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/backbones/__pycache__/hrnet.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/backbones/__pycache__/mobilenet_v2.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/backbones/__pycache__/mobilenet_v2.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/backbones/__pycache__/pvt.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/backbones/__pycache__/pvt.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/backbones/__pycache__/regnet.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/backbones/__pycache__/regnet.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/backbones/__pycache__/res2net.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/backbones/__pycache__/res2net.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/backbones/__pycache__/resnest.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/backbones/__pycache__/resnest.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/backbones/__pycache__/resnet.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/backbones/__pycache__/resnet.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/backbones/__pycache__/resnext.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/backbones/__pycache__/resnext.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/backbones/__pycache__/ssd_vgg.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/backbones/__pycache__/ssd_vgg.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/backbones/__pycache__/swin.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/backbones/__pycache__/swin.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/backbones/__pycache__/trident_resnet.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/backbones/__pycache__/trident_resnet.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/anchor_free_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/anchor_free_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/anchor_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/anchor_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/atss_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/atss_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/autoassign_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/autoassign_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/base_dense_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/base_dense_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/base_mask_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/base_mask_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/cascade_rpn_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/cascade_rpn_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/centernet_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/centernet_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/centripetal_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/centripetal_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/corner_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/corner_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/deformable_detr_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/deformable_detr_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/dense_test_mixins.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/dense_test_mixins.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/detr_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/detr_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/embedding_rpn_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/embedding_rpn_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/fcos_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/fcos_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/fovea_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/fovea_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/free_anchor_retina_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/free_anchor_retina_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/fsaf_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/fsaf_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/ga_retina_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/ga_retina_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/ga_rpn_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/ga_rpn_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/gfl_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/gfl_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/guided_anchor_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/guided_anchor_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/lad_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/lad_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/ld_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/ld_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/nasfcos_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/nasfcos_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/paa_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/paa_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/pisa_retinanet_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/pisa_retinanet_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/pisa_ssd_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/pisa_ssd_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/reppoints_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/reppoints_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/retina_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/retina_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/retina_sepbn_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/retina_sepbn_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/rpn_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/rpn_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/sabl_retina_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/sabl_retina_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/solo_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/solo_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/ssd_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/ssd_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/vfnet_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/vfnet_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/yolact_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/yolact_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/yolo_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/yolo_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/yolof_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/yolof_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/dense_heads/__pycache__/yolox_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/dense_heads/__pycache__/yolox_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/atss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/atss.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/autoassign.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/autoassign.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/base.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/base.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/cascade_rcnn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/cascade_rcnn.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/centernet.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/centernet.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/cornernet.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/cornernet.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/deformable_detr.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/deformable_detr.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/detr.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/detr.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/fast_rcnn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/fast_rcnn.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/faster_rcnn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/faster_rcnn.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/faster_rcnn_ssp.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/faster_rcnn_ssp.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/fcos.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/fcos.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/fovea.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/fovea.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/fovea_sppnet.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/fovea_sppnet.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/fsaf.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/fsaf.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/gfl.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/gfl.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/grid_rcnn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/grid_rcnn.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/htc.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/htc.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/kd_one_stage.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/kd_one_stage.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/lad.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/lad.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/mask_rcnn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/mask_rcnn.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/mask_scoring_rcnn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/mask_scoring_rcnn.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/nasfcos.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/nasfcos.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/paa.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/paa.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/panoptic_fpn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/panoptic_fpn.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/panoptic_two_stage_segmentor.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/panoptic_two_stage_segmentor.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/point_rend.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/point_rend.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/queryinst.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/queryinst.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/reppoints_detector.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/reppoints_detector.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/retinanet.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/retinanet.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/rpn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/rpn.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/scnet.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/scnet.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/single_stage.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/single_stage.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/single_stage_instance_seg.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/single_stage_instance_seg.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/solo.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/solo.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/sparse_rcnn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/sparse_rcnn.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/trident_faster_rcnn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/trident_faster_rcnn.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/two_stage.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/two_stage.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/vfnet.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/vfnet.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/yolact.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/yolact.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/yolo.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/yolo.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/yolof.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/yolof.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/__pycache__/yolox.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/detectors/__pycache__/yolox.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/detectors/atss.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from ..builder import DETECTORS 3 | from .single_stage import SingleStageDetector 4 | 5 | 6 | @DETECTORS.register_module() 7 | class ATSS(SingleStageDetector): 8 | """Implementation of `ATSS `_.""" 9 | 10 | def __init__(self, 11 | backbone, 12 | neck, 13 | bbox_head, 14 | train_cfg=None, 15 | test_cfg=None, 16 | pretrained=None, 17 | init_cfg=None): 18 | super(ATSS, self).__init__(backbone, neck, bbox_head, train_cfg, 19 | test_cfg, pretrained, init_cfg) 20 | -------------------------------------------------------------------------------- /mmdet/models/detectors/autoassign.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from ..builder import DETECTORS 3 | from .single_stage import SingleStageDetector 4 | 5 | 6 | @DETECTORS.register_module() 7 | class AutoAssign(SingleStageDetector): 8 | """Implementation of `AutoAssign: Differentiable Label Assignment for Dense 9 | Object Detection `_.""" 10 | 11 | def __init__(self, 12 | backbone, 13 | neck, 14 | bbox_head, 15 | train_cfg=None, 16 | test_cfg=None, 17 | pretrained=None): 18 | super(AutoAssign, self).__init__(backbone, neck, bbox_head, train_cfg, 19 | test_cfg, pretrained) 20 | -------------------------------------------------------------------------------- /mmdet/models/detectors/deformable_detr.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from ..builder import DETECTORS 3 | from .detr import DETR 4 | 5 | 6 | @DETECTORS.register_module() 7 | class DeformableDETR(DETR): 8 | 9 | def __init__(self, *args, **kwargs): 10 | super(DETR, self).__init__(*args, **kwargs) 11 | -------------------------------------------------------------------------------- /mmdet/models/detectors/faster_rcnn.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from ..builder import DETECTORS 3 | from .two_stage import TwoStageDetector 4 | 5 | 6 | @DETECTORS.register_module() 7 | class FasterRCNN(TwoStageDetector): 8 | """Implementation of `Faster R-CNN `_""" 9 | 10 | def __init__(self, 11 | backbone, 12 | rpn_head, 13 | roi_head, 14 | train_cfg, 15 | test_cfg, 16 | neck=None, 17 | pretrained=None, 18 | init_cfg=None): 19 | super(FasterRCNN, self).__init__( 20 | backbone=backbone, 21 | neck=neck, 22 | rpn_head=rpn_head, 23 | roi_head=roi_head, 24 | train_cfg=train_cfg, 25 | test_cfg=test_cfg, 26 | pretrained=pretrained, 27 | init_cfg=init_cfg) 28 | -------------------------------------------------------------------------------- /mmdet/models/detectors/fcos.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from ..builder import DETECTORS 3 | from .single_stage import SingleStageDetector 4 | 5 | 6 | @DETECTORS.register_module() 7 | class FCOS(SingleStageDetector): 8 | """Implementation of `FCOS `_""" 9 | 10 | def __init__(self, 11 | backbone, 12 | neck, 13 | bbox_head, 14 | train_cfg=None, 15 | test_cfg=None, 16 | pretrained=None, 17 | init_cfg=None): 18 | super(FCOS, self).__init__(backbone, neck, bbox_head, train_cfg, 19 | test_cfg, pretrained, init_cfg) 20 | -------------------------------------------------------------------------------- /mmdet/models/detectors/fovea.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from ..builder import DETECTORS 3 | from .single_stage import SingleStageDetector 4 | 5 | 6 | @DETECTORS.register_module() 7 | class FOVEA(SingleStageDetector): 8 | """Implementation of `FoveaBox `_""" 9 | 10 | def __init__(self, 11 | backbone, 12 | neck, 13 | bbox_head, 14 | train_cfg=None, 15 | test_cfg=None, 16 | pretrained=None, 17 | init_cfg=None): 18 | super(FOVEA, self).__init__(backbone, neck, bbox_head, train_cfg, 19 | test_cfg, pretrained, init_cfg) 20 | -------------------------------------------------------------------------------- /mmdet/models/detectors/fsaf.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from ..builder import DETECTORS 3 | from .single_stage import SingleStageDetector 4 | 5 | 6 | @DETECTORS.register_module() 7 | class FSAF(SingleStageDetector): 8 | """Implementation of `FSAF `_""" 9 | 10 | def __init__(self, 11 | backbone, 12 | neck, 13 | bbox_head, 14 | train_cfg=None, 15 | test_cfg=None, 16 | pretrained=None, 17 | init_cfg=None): 18 | super(FSAF, self).__init__(backbone, neck, bbox_head, train_cfg, 19 | test_cfg, pretrained, init_cfg) 20 | -------------------------------------------------------------------------------- /mmdet/models/detectors/gfl.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from ..builder import DETECTORS 3 | from .single_stage import SingleStageDetector 4 | 5 | 6 | @DETECTORS.register_module() 7 | class GFL(SingleStageDetector): 8 | 9 | def __init__(self, 10 | backbone, 11 | neck, 12 | bbox_head, 13 | train_cfg=None, 14 | test_cfg=None, 15 | pretrained=None, 16 | init_cfg=None): 17 | super(GFL, self).__init__(backbone, neck, bbox_head, train_cfg, 18 | test_cfg, pretrained, init_cfg) 19 | -------------------------------------------------------------------------------- /mmdet/models/detectors/grid_rcnn.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from ..builder import DETECTORS 3 | from .two_stage import TwoStageDetector 4 | 5 | 6 | @DETECTORS.register_module() 7 | class GridRCNN(TwoStageDetector): 8 | """Grid R-CNN. 9 | 10 | This detector is the implementation of: 11 | - Grid R-CNN (https://arxiv.org/abs/1811.12030) 12 | - Grid R-CNN Plus: Faster and Better (https://arxiv.org/abs/1906.05688) 13 | """ 14 | 15 | def __init__(self, 16 | backbone, 17 | rpn_head, 18 | roi_head, 19 | train_cfg, 20 | test_cfg, 21 | neck=None, 22 | pretrained=None, 23 | init_cfg=None): 24 | super(GridRCNN, self).__init__( 25 | backbone=backbone, 26 | neck=neck, 27 | rpn_head=rpn_head, 28 | roi_head=roi_head, 29 | train_cfg=train_cfg, 30 | test_cfg=test_cfg, 31 | pretrained=pretrained, 32 | init_cfg=init_cfg) 33 | -------------------------------------------------------------------------------- /mmdet/models/detectors/htc.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from ..builder import DETECTORS 3 | from .cascade_rcnn import CascadeRCNN 4 | 5 | 6 | @DETECTORS.register_module() 7 | class HybridTaskCascade(CascadeRCNN): 8 | """Implementation of `HTC `_""" 9 | 10 | def __init__(self, **kwargs): 11 | super(HybridTaskCascade, self).__init__(**kwargs) 12 | 13 | @property 14 | def with_semantic(self): 15 | """bool: whether the detector has a semantic head""" 16 | return self.roi_head.with_semantic 17 | -------------------------------------------------------------------------------- /mmdet/models/detectors/mask_rcnn.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from ..builder import DETECTORS 3 | from .two_stage import TwoStageDetector 4 | 5 | 6 | @DETECTORS.register_module() 7 | class MaskRCNN(TwoStageDetector): 8 | """Implementation of `Mask R-CNN `_""" 9 | 10 | def __init__(self, 11 | backbone, 12 | rpn_head, 13 | roi_head, 14 | train_cfg, 15 | test_cfg, 16 | neck=None, 17 | pretrained=None, 18 | init_cfg=None): 19 | super(MaskRCNN, self).__init__( 20 | backbone=backbone, 21 | neck=neck, 22 | rpn_head=rpn_head, 23 | roi_head=roi_head, 24 | train_cfg=train_cfg, 25 | test_cfg=test_cfg, 26 | pretrained=pretrained, 27 | init_cfg=init_cfg) 28 | -------------------------------------------------------------------------------- /mmdet/models/detectors/mask_scoring_rcnn.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from ..builder import DETECTORS 3 | from .two_stage import TwoStageDetector 4 | 5 | 6 | @DETECTORS.register_module() 7 | class MaskScoringRCNN(TwoStageDetector): 8 | """Mask Scoring RCNN. 9 | 10 | https://arxiv.org/abs/1903.00241 11 | """ 12 | 13 | def __init__(self, 14 | backbone, 15 | rpn_head, 16 | roi_head, 17 | train_cfg, 18 | test_cfg, 19 | neck=None, 20 | pretrained=None, 21 | init_cfg=None): 22 | super(MaskScoringRCNN, self).__init__( 23 | backbone=backbone, 24 | neck=neck, 25 | rpn_head=rpn_head, 26 | roi_head=roi_head, 27 | train_cfg=train_cfg, 28 | test_cfg=test_cfg, 29 | pretrained=pretrained, 30 | init_cfg=init_cfg) 31 | -------------------------------------------------------------------------------- /mmdet/models/detectors/nasfcos.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from ..builder import DETECTORS 3 | from .single_stage import SingleStageDetector 4 | 5 | 6 | @DETECTORS.register_module() 7 | class NASFCOS(SingleStageDetector): 8 | """NAS-FCOS: Fast Neural Architecture Search for Object Detection. 9 | 10 | https://arxiv.org/abs/1906.0442 11 | """ 12 | 13 | def __init__(self, 14 | backbone, 15 | neck, 16 | bbox_head, 17 | train_cfg=None, 18 | test_cfg=None, 19 | pretrained=None, 20 | init_cfg=None): 21 | super(NASFCOS, self).__init__(backbone, neck, bbox_head, train_cfg, 22 | test_cfg, pretrained, init_cfg) 23 | -------------------------------------------------------------------------------- /mmdet/models/detectors/paa.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from ..builder import DETECTORS 3 | from .single_stage import SingleStageDetector 4 | 5 | 6 | @DETECTORS.register_module() 7 | class PAA(SingleStageDetector): 8 | """Implementation of `PAA `_.""" 9 | 10 | def __init__(self, 11 | backbone, 12 | neck, 13 | bbox_head, 14 | train_cfg=None, 15 | test_cfg=None, 16 | pretrained=None, 17 | init_cfg=None): 18 | super(PAA, self).__init__(backbone, neck, bbox_head, train_cfg, 19 | test_cfg, pretrained, init_cfg) 20 | -------------------------------------------------------------------------------- /mmdet/models/detectors/panoptic_fpn.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from ..builder import DETECTORS 3 | from .panoptic_two_stage_segmentor import TwoStagePanopticSegmentor 4 | 5 | 6 | @DETECTORS.register_module() 7 | class PanopticFPN(TwoStagePanopticSegmentor): 8 | r"""Implementation of `Panoptic feature pyramid 9 | networks `_""" 10 | 11 | def __init__( 12 | self, 13 | backbone, 14 | neck=None, 15 | rpn_head=None, 16 | roi_head=None, 17 | train_cfg=None, 18 | test_cfg=None, 19 | pretrained=None, 20 | init_cfg=None, 21 | # for panoptic segmentation 22 | semantic_head=None, 23 | panoptic_fusion_head=None): 24 | super(PanopticFPN, self).__init__( 25 | backbone=backbone, 26 | neck=neck, 27 | rpn_head=rpn_head, 28 | roi_head=roi_head, 29 | train_cfg=train_cfg, 30 | test_cfg=test_cfg, 31 | pretrained=pretrained, 32 | init_cfg=init_cfg, 33 | semantic_head=semantic_head, 34 | panoptic_fusion_head=panoptic_fusion_head) 35 | -------------------------------------------------------------------------------- /mmdet/models/detectors/point_rend.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from ..builder import DETECTORS 3 | from .two_stage import TwoStageDetector 4 | 5 | 6 | @DETECTORS.register_module() 7 | class PointRend(TwoStageDetector): 8 | """PointRend: Image Segmentation as Rendering 9 | 10 | This detector is the implementation of 11 | `PointRend `_. 12 | 13 | """ 14 | 15 | def __init__(self, 16 | backbone, 17 | rpn_head, 18 | roi_head, 19 | train_cfg, 20 | test_cfg, 21 | neck=None, 22 | pretrained=None, 23 | init_cfg=None): 24 | super(PointRend, self).__init__( 25 | backbone=backbone, 26 | neck=neck, 27 | rpn_head=rpn_head, 28 | roi_head=roi_head, 29 | train_cfg=train_cfg, 30 | test_cfg=test_cfg, 31 | pretrained=pretrained, 32 | init_cfg=init_cfg) 33 | -------------------------------------------------------------------------------- /mmdet/models/detectors/queryinst.py: -------------------------------------------------------------------------------- 1 | from ..builder import DETECTORS 2 | from .sparse_rcnn import SparseRCNN 3 | 4 | 5 | @DETECTORS.register_module() 6 | class QueryInst(SparseRCNN): 7 | r"""Implementation of 8 | `Instances as Queries `_""" 9 | 10 | def __init__(self, 11 | backbone, 12 | rpn_head, 13 | roi_head, 14 | train_cfg, 15 | test_cfg, 16 | neck=None, 17 | pretrained=None, 18 | init_cfg=None): 19 | super(QueryInst, self).__init__( 20 | backbone=backbone, 21 | neck=neck, 22 | rpn_head=rpn_head, 23 | roi_head=roi_head, 24 | train_cfg=train_cfg, 25 | test_cfg=test_cfg, 26 | pretrained=pretrained, 27 | init_cfg=init_cfg) 28 | -------------------------------------------------------------------------------- /mmdet/models/detectors/reppoints_detector.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from ..builder import DETECTORS 3 | from .single_stage import SingleStageDetector 4 | 5 | 6 | @DETECTORS.register_module() 7 | class RepPointsDetector(SingleStageDetector): 8 | """RepPoints: Point Set Representation for Object Detection. 9 | 10 | This detector is the implementation of: 11 | - RepPoints detector (https://arxiv.org/pdf/1904.11490) 12 | """ 13 | 14 | def __init__(self, 15 | backbone, 16 | neck, 17 | bbox_head, 18 | train_cfg=None, 19 | test_cfg=None, 20 | pretrained=None, 21 | init_cfg=None): 22 | super(RepPointsDetector, 23 | self).__init__(backbone, neck, bbox_head, train_cfg, test_cfg, 24 | pretrained, init_cfg) 25 | -------------------------------------------------------------------------------- /mmdet/models/detectors/retinanet.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from ..builder import DETECTORS 3 | from .single_stage import SingleStageDetector 4 | 5 | 6 | @DETECTORS.register_module() 7 | class RetinaNet(SingleStageDetector): 8 | """Implementation of `RetinaNet `_""" 9 | 10 | def __init__(self, 11 | backbone, 12 | neck, 13 | bbox_head, 14 | train_cfg=None, 15 | test_cfg=None, 16 | pretrained=None, 17 | init_cfg=None): 18 | super(RetinaNet, self).__init__(backbone, neck, bbox_head, train_cfg, 19 | test_cfg, pretrained, init_cfg) 20 | -------------------------------------------------------------------------------- /mmdet/models/detectors/scnet.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from ..builder import DETECTORS 3 | from .cascade_rcnn import CascadeRCNN 4 | 5 | 6 | @DETECTORS.register_module() 7 | class SCNet(CascadeRCNN): 8 | """Implementation of `SCNet `_""" 9 | 10 | def __init__(self, **kwargs): 11 | super(SCNet, self).__init__(**kwargs) 12 | -------------------------------------------------------------------------------- /mmdet/models/detectors/solo.py: -------------------------------------------------------------------------------- 1 | from ..builder import DETECTORS 2 | from .single_stage_instance_seg import SingleStageInstanceSegmentor 3 | 4 | 5 | @DETECTORS.register_module() 6 | class SOLO(SingleStageInstanceSegmentor): 7 | """`SOLO: Segmenting Objects by Locations 8 | `_ 9 | 10 | """ 11 | 12 | def __init__(self, 13 | backbone, 14 | neck=None, 15 | bbox_head=None, 16 | mask_head=None, 17 | train_cfg=None, 18 | test_cfg=None, 19 | init_cfg=None, 20 | pretrained=None): 21 | super().__init__( 22 | backbone=backbone, 23 | neck=neck, 24 | bbox_head=bbox_head, 25 | mask_head=mask_head, 26 | train_cfg=train_cfg, 27 | test_cfg=test_cfg, 28 | init_cfg=init_cfg, 29 | pretrained=pretrained) 30 | -------------------------------------------------------------------------------- /mmdet/models/detectors/vfnet.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from ..builder import DETECTORS 3 | from .single_stage import SingleStageDetector 4 | 5 | 6 | @DETECTORS.register_module() 7 | class VFNet(SingleStageDetector): 8 | """Implementation of `VarifocalNet 9 | (VFNet).`_""" 10 | 11 | def __init__(self, 12 | backbone, 13 | neck, 14 | bbox_head, 15 | train_cfg=None, 16 | test_cfg=None, 17 | pretrained=None, 18 | init_cfg=None): 19 | super(VFNet, self).__init__(backbone, neck, bbox_head, train_cfg, 20 | test_cfg, pretrained, init_cfg) 21 | -------------------------------------------------------------------------------- /mmdet/models/detectors/yolo.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | # Copyright (c) 2019 Western Digital Corporation or its affiliates. 3 | import torch 4 | 5 | from ..builder import DETECTORS 6 | from .single_stage import SingleStageDetector 7 | 8 | 9 | @DETECTORS.register_module() 10 | class YOLOV3(SingleStageDetector): 11 | 12 | def __init__(self, 13 | backbone, 14 | neck, 15 | bbox_head, 16 | train_cfg=None, 17 | test_cfg=None, 18 | pretrained=None, 19 | init_cfg=None): 20 | super(YOLOV3, self).__init__(backbone, neck, bbox_head, train_cfg, 21 | test_cfg, pretrained, init_cfg) 22 | 23 | def onnx_export(self, img, img_metas): 24 | """Test function for exporting to ONNX, without test time augmentation. 25 | 26 | Args: 27 | img (torch.Tensor): input images. 28 | img_metas (list[dict]): List of image information. 29 | 30 | Returns: 31 | tuple[Tensor, Tensor]: dets of shape [N, num_det, 5] 32 | and class labels of shape [N, num_det]. 33 | """ 34 | x = self.extract_feat(img) 35 | outs = self.bbox_head.forward(x) 36 | # get shape as tensor 37 | img_shape = torch._shape_as_tensor(img)[2:] 38 | img_metas[0]['img_shape_for_onnx'] = img_shape 39 | 40 | det_bboxes, det_labels = self.bbox_head.onnx_export(*outs, img_metas) 41 | 42 | return det_bboxes, det_labels 43 | -------------------------------------------------------------------------------- /mmdet/models/detectors/yolof.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from ..builder import DETECTORS 3 | from .single_stage import SingleStageDetector 4 | 5 | 6 | @DETECTORS.register_module() 7 | class YOLOF(SingleStageDetector): 8 | r"""Implementation of `You Only Look One-level Feature 9 | `_""" 10 | 11 | def __init__(self, 12 | backbone, 13 | neck, 14 | bbox_head, 15 | train_cfg=None, 16 | test_cfg=None, 17 | pretrained=None): 18 | super(YOLOF, self).__init__(backbone, neck, bbox_head, train_cfg, 19 | test_cfg, pretrained) 20 | -------------------------------------------------------------------------------- /mmdet/models/losses/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/losses/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/losses/__pycache__/accuracy.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/losses/__pycache__/accuracy.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/losses/__pycache__/ae_loss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/losses/__pycache__/ae_loss.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/losses/__pycache__/balanced_l1_loss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/losses/__pycache__/balanced_l1_loss.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/losses/__pycache__/cross_entropy_loss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/losses/__pycache__/cross_entropy_loss.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/losses/__pycache__/dice_loss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/losses/__pycache__/dice_loss.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/losses/__pycache__/focal_loss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/losses/__pycache__/focal_loss.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/losses/__pycache__/gaussian_focal_loss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/losses/__pycache__/gaussian_focal_loss.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/losses/__pycache__/gfocal_loss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/losses/__pycache__/gfocal_loss.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/losses/__pycache__/ghm_loss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/losses/__pycache__/ghm_loss.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/losses/__pycache__/iou_loss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/losses/__pycache__/iou_loss.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/losses/__pycache__/kd_loss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/losses/__pycache__/kd_loss.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/losses/__pycache__/mse_loss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/losses/__pycache__/mse_loss.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/losses/__pycache__/pisa_loss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/losses/__pycache__/pisa_loss.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/losses/__pycache__/seesaw_loss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/losses/__pycache__/seesaw_loss.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/losses/__pycache__/smooth_l1_loss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/losses/__pycache__/smooth_l1_loss.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/losses/__pycache__/utils.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/losses/__pycache__/utils.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/losses/__pycache__/varifocal_loss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/losses/__pycache__/varifocal_loss.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/module/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/module/__init__.py -------------------------------------------------------------------------------- /mmdet/models/module/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/module/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/module/__pycache__/heatmap.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/module/__pycache__/heatmap.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/necks/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .bfp import BFP 3 | from .channel_mapper import ChannelMapper 4 | from .ct_resnet_neck import CTResNetNeck 5 | from .dilated_encoder import DilatedEncoder 6 | from .fpg import FPG 7 | from .fpn import FPN 8 | from .fpn_carafe import FPN_CARAFE 9 | from .hrfpn import HRFPN 10 | from .nas_fpn import NASFPN 11 | from .nasfcos_fpn import NASFCOS_FPN 12 | from .pafpn import PAFPN 13 | from .rfp import RFP 14 | from .ssd_neck import SSDNeck 15 | from .yolo_neck import YOLOV3Neck 16 | from .yolox_pafpn import YOLOXPAFPN 17 | from .ssfpn import SSFPN 18 | 19 | __all__ = [ 20 | 'FPN', 'BFP', 'ChannelMapper', 'HRFPN', 'NASFPN', 'FPN_CARAFE', 'PAFPN', 21 | 'NASFCOS_FPN', 'RFP', 'YOLOV3Neck', 'FPG', 'DilatedEncoder', 22 | 'CTResNetNeck', 'SSDNeck', 'YOLOXPAFPN','SSFPN' 23 | ] 24 | -------------------------------------------------------------------------------- /mmdet/models/necks/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/necks/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/necks/__pycache__/bfp.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/necks/__pycache__/bfp.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/necks/__pycache__/channel_mapper.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/necks/__pycache__/channel_mapper.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/necks/__pycache__/ct_resnet_neck.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/necks/__pycache__/ct_resnet_neck.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/necks/__pycache__/dilated_encoder.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/necks/__pycache__/dilated_encoder.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/necks/__pycache__/fpg.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/necks/__pycache__/fpg.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/necks/__pycache__/fpn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/necks/__pycache__/fpn.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/necks/__pycache__/fpn_carafe.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/necks/__pycache__/fpn_carafe.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/necks/__pycache__/hrfpn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/necks/__pycache__/hrfpn.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/necks/__pycache__/nas_fpn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/necks/__pycache__/nas_fpn.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/necks/__pycache__/nasfcos_fpn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/necks/__pycache__/nasfcos_fpn.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/necks/__pycache__/pafpn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/necks/__pycache__/pafpn.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/necks/__pycache__/rfp.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/necks/__pycache__/rfp.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/necks/__pycache__/ssd_neck.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/necks/__pycache__/ssd_neck.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/necks/__pycache__/ssfpn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/necks/__pycache__/ssfpn.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/necks/__pycache__/yolo_neck.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/necks/__pycache__/yolo_neck.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/necks/__pycache__/yolox_pafpn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/necks/__pycache__/yolox_pafpn.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/plugins/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .dropblock import DropBlock 3 | 4 | __all__ = ['DropBlock'] 5 | -------------------------------------------------------------------------------- /mmdet/models/plugins/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/plugins/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/plugins/__pycache__/dropblock.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/plugins/__pycache__/dropblock.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/__pycache__/base_roi_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/__pycache__/base_roi_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/__pycache__/cascade_roi_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/__pycache__/cascade_roi_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/__pycache__/double_roi_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/__pycache__/double_roi_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/__pycache__/dynamic_roi_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/__pycache__/dynamic_roi_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/__pycache__/grid_roi_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/__pycache__/grid_roi_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/__pycache__/htc_roi_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/__pycache__/htc_roi_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/__pycache__/mask_scoring_roi_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/__pycache__/mask_scoring_roi_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/__pycache__/pisa_roi_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/__pycache__/pisa_roi_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/__pycache__/point_rend_roi_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/__pycache__/point_rend_roi_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/__pycache__/scnet_roi_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/__pycache__/scnet_roi_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/__pycache__/sparse_roi_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/__pycache__/sparse_roi_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/__pycache__/standard_roi_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/__pycache__/standard_roi_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/__pycache__/test_mixins.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/__pycache__/test_mixins.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/__pycache__/trident_roi_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/__pycache__/trident_roi_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/bbox_heads/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .bbox_head import BBoxHead 3 | from .convfc_bbox_head import (ConvFCBBoxHead, Shared2FCBBoxHead, 4 | Shared4Conv1FCBBoxHead) 5 | from .dii_head import DIIHead 6 | from .double_bbox_head import DoubleConvFCBBoxHead 7 | from .sabl_head import SABLHead 8 | from .scnet_bbox_head import SCNetBBoxHead 9 | 10 | __all__ = [ 11 | 'BBoxHead', 'ConvFCBBoxHead', 'Shared2FCBBoxHead', 12 | 'Shared4Conv1FCBBoxHead', 'DoubleConvFCBBoxHead', 'SABLHead', 'DIIHead', 13 | 'SCNetBBoxHead' 14 | ] 15 | -------------------------------------------------------------------------------- /mmdet/models/roi_heads/bbox_heads/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/bbox_heads/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/bbox_heads/__pycache__/bbox_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/bbox_heads/__pycache__/bbox_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/bbox_heads/__pycache__/convfc_bbox_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/bbox_heads/__pycache__/convfc_bbox_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/bbox_heads/__pycache__/dii_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/bbox_heads/__pycache__/dii_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/bbox_heads/__pycache__/double_bbox_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/bbox_heads/__pycache__/double_bbox_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/bbox_heads/__pycache__/sabl_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/bbox_heads/__pycache__/sabl_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/bbox_heads/__pycache__/scnet_bbox_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/bbox_heads/__pycache__/scnet_bbox_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/double_roi_head.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from ..builder import HEADS 3 | from .standard_roi_head import StandardRoIHead 4 | 5 | 6 | @HEADS.register_module() 7 | class DoubleHeadRoIHead(StandardRoIHead): 8 | """RoI head for Double Head RCNN. 9 | 10 | https://arxiv.org/abs/1904.06493 11 | """ 12 | 13 | def __init__(self, reg_roi_scale_factor, **kwargs): 14 | super(DoubleHeadRoIHead, self).__init__(**kwargs) 15 | self.reg_roi_scale_factor = reg_roi_scale_factor 16 | 17 | def _bbox_forward(self, x, rois): 18 | """Box head forward function used in both training and testing time.""" 19 | bbox_cls_feats = self.bbox_roi_extractor( 20 | x[:self.bbox_roi_extractor.num_inputs], rois) 21 | bbox_reg_feats = self.bbox_roi_extractor( 22 | x[:self.bbox_roi_extractor.num_inputs], 23 | rois, 24 | roi_scale_factor=self.reg_roi_scale_factor) 25 | if self.with_shared_head: 26 | bbox_cls_feats = self.shared_head(bbox_cls_feats) 27 | bbox_reg_feats = self.shared_head(bbox_reg_feats) 28 | cls_score, bbox_pred = self.bbox_head(bbox_cls_feats, bbox_reg_feats) 29 | 30 | bbox_results = dict( 31 | cls_score=cls_score, 32 | bbox_pred=bbox_pred, 33 | bbox_feats=bbox_cls_feats) 34 | return bbox_results 35 | -------------------------------------------------------------------------------- /mmdet/models/roi_heads/mask_heads/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .coarse_mask_head import CoarseMaskHead 3 | from .dynamic_mask_head import DynamicMaskHead 4 | from .fcn_mask_head import FCNMaskHead 5 | from .feature_relay_head import FeatureRelayHead 6 | from .fused_semantic_head import FusedSemanticHead 7 | from .global_context_head import GlobalContextHead 8 | from .grid_head import GridHead 9 | from .htc_mask_head import HTCMaskHead 10 | from .mask_point_head import MaskPointHead 11 | from .maskiou_head import MaskIoUHead 12 | from .scnet_mask_head import SCNetMaskHead 13 | from .scnet_semantic_head import SCNetSemanticHead 14 | 15 | __all__ = [ 16 | 'FCNMaskHead', 'HTCMaskHead', 'FusedSemanticHead', 'GridHead', 17 | 'MaskIoUHead', 'CoarseMaskHead', 'MaskPointHead', 'SCNetMaskHead', 18 | 'SCNetSemanticHead', 'GlobalContextHead', 'FeatureRelayHead', 19 | 'DynamicMaskHead' 20 | ] 21 | -------------------------------------------------------------------------------- /mmdet/models/roi_heads/mask_heads/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/mask_heads/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/mask_heads/__pycache__/coarse_mask_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/mask_heads/__pycache__/coarse_mask_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/mask_heads/__pycache__/dynamic_mask_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/mask_heads/__pycache__/dynamic_mask_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/mask_heads/__pycache__/fcn_mask_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/mask_heads/__pycache__/fcn_mask_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/mask_heads/__pycache__/feature_relay_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/mask_heads/__pycache__/feature_relay_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/mask_heads/__pycache__/fused_semantic_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/mask_heads/__pycache__/fused_semantic_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/mask_heads/__pycache__/global_context_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/mask_heads/__pycache__/global_context_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/mask_heads/__pycache__/grid_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/mask_heads/__pycache__/grid_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/mask_heads/__pycache__/htc_mask_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/mask_heads/__pycache__/htc_mask_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/mask_heads/__pycache__/mask_point_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/mask_heads/__pycache__/mask_point_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/mask_heads/__pycache__/maskiou_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/mask_heads/__pycache__/maskiou_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/mask_heads/__pycache__/scnet_mask_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/mask_heads/__pycache__/scnet_mask_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/mask_heads/__pycache__/scnet_semantic_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/mask_heads/__pycache__/scnet_semantic_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/mask_heads/htc_mask_head.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from mmcv.cnn import ConvModule 3 | 4 | from mmdet.models.builder import HEADS 5 | from .fcn_mask_head import FCNMaskHead 6 | 7 | 8 | @HEADS.register_module() 9 | class HTCMaskHead(FCNMaskHead): 10 | 11 | def __init__(self, with_conv_res=True, *args, **kwargs): 12 | super(HTCMaskHead, self).__init__(*args, **kwargs) 13 | self.with_conv_res = with_conv_res 14 | if self.with_conv_res: 15 | self.conv_res = ConvModule( 16 | self.conv_out_channels, 17 | self.conv_out_channels, 18 | 1, 19 | conv_cfg=self.conv_cfg, 20 | norm_cfg=self.norm_cfg) 21 | 22 | def forward(self, x, res_feat=None, return_logits=True, return_feat=True): 23 | if res_feat is not None: 24 | assert self.with_conv_res 25 | res_feat = self.conv_res(res_feat) 26 | x = x + res_feat 27 | for conv in self.convs: 28 | x = conv(x) 29 | res_feat = x 30 | outs = [] 31 | if return_logits: 32 | x = self.upsample(x) 33 | if self.upsample_method == 'deconv': 34 | x = self.relu(x) 35 | mask_pred = self.conv_logits(x) 36 | outs.append(mask_pred) 37 | if return_feat: 38 | outs.append(res_feat) 39 | return outs if len(outs) > 1 else outs[0] 40 | -------------------------------------------------------------------------------- /mmdet/models/roi_heads/mask_heads/scnet_mask_head.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from mmdet.models.builder import HEADS 3 | from mmdet.models.utils import ResLayer, SimplifiedBasicBlock 4 | from .fcn_mask_head import FCNMaskHead 5 | 6 | 7 | @HEADS.register_module() 8 | class SCNetMaskHead(FCNMaskHead): 9 | """Mask head for `SCNet `_. 10 | 11 | Args: 12 | conv_to_res (bool, optional): if True, change the conv layers to 13 | ``SimplifiedBasicBlock``. 14 | """ 15 | 16 | def __init__(self, conv_to_res=True, **kwargs): 17 | super(SCNetMaskHead, self).__init__(**kwargs) 18 | self.conv_to_res = conv_to_res 19 | if conv_to_res: 20 | assert self.conv_kernel_size == 3 21 | self.num_res_blocks = self.num_convs // 2 22 | self.convs = ResLayer( 23 | SimplifiedBasicBlock, 24 | self.in_channels, 25 | self.conv_out_channels, 26 | self.num_res_blocks, 27 | conv_cfg=self.conv_cfg, 28 | norm_cfg=self.norm_cfg) 29 | -------------------------------------------------------------------------------- /mmdet/models/roi_heads/mask_heads/scnet_semantic_head.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from mmdet.models.builder import HEADS 3 | from mmdet.models.utils import ResLayer, SimplifiedBasicBlock 4 | from .fused_semantic_head import FusedSemanticHead 5 | 6 | 7 | @HEADS.register_module() 8 | class SCNetSemanticHead(FusedSemanticHead): 9 | """Mask head for `SCNet `_. 10 | 11 | Args: 12 | conv_to_res (bool, optional): if True, change the conv layers to 13 | ``SimplifiedBasicBlock``. 14 | """ 15 | 16 | def __init__(self, conv_to_res=True, **kwargs): 17 | super(SCNetSemanticHead, self).__init__(**kwargs) 18 | self.conv_to_res = conv_to_res 19 | if self.conv_to_res: 20 | num_res_blocks = self.num_convs // 2 21 | self.convs = ResLayer( 22 | SimplifiedBasicBlock, 23 | self.in_channels, 24 | self.conv_out_channels, 25 | num_res_blocks, 26 | conv_cfg=self.conv_cfg, 27 | norm_cfg=self.norm_cfg) 28 | self.num_convs = num_res_blocks 29 | -------------------------------------------------------------------------------- /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/roi_heads/roi_extractors/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/roi_extractors/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/roi_extractors/__pycache__/base_roi_extractor.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/roi_extractors/__pycache__/base_roi_extractor.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/roi_extractors/__pycache__/generic_roi_extractor.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/roi_extractors/__pycache__/generic_roi_extractor.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/roi_extractors/__pycache__/single_level_roi_extractor.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/roi_extractors/__pycache__/single_level_roi_extractor.cpython-37.pyc -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /mmdet/models/roi_heads/shared_heads/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/shared_heads/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/roi_heads/shared_heads/__pycache__/res_layer.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/roi_heads/shared_heads/__pycache__/res_layer.cpython-37.pyc -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /mmdet/models/seg_heads/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/seg_heads/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/seg_heads/__pycache__/base_semantic_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/seg_heads/__pycache__/base_semantic_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/seg_heads/__pycache__/panoptic_fpn_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/seg_heads/__pycache__/panoptic_fpn_head.cpython-37.pyc -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /mmdet/models/seg_heads/panoptic_fusion_heads/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/seg_heads/panoptic_fusion_heads/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/seg_heads/panoptic_fusion_heads/__pycache__/base_panoptic_fusion_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/seg_heads/panoptic_fusion_heads/__pycache__/base_panoptic_fusion_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/seg_heads/panoptic_fusion_heads/__pycache__/heuristic_fusion_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/seg_heads/panoptic_fusion_heads/__pycache__/heuristic_fusion_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/utils/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .brick_wrappers import AdaptiveAvgPool2d, adaptive_avg_pool2d 3 | from .builder import build_linear_layer, build_transformer 4 | from .ckpt_convert import pvt_convert 5 | from .conv_upsample import ConvUpsample 6 | from .csp_layer import CSPLayer 7 | from .gaussian_target import gaussian_radius, gen_gaussian_target 8 | from .inverted_residual import InvertedResidual 9 | from .make_divisible import make_divisible 10 | from .misc import interpolate_as 11 | from .normed_predictor import NormedConv2d, NormedLinear 12 | from .positional_encoding import (LearnedPositionalEncoding, 13 | SinePositionalEncoding) 14 | from .res_layer import ResLayer, SimplifiedBasicBlock 15 | from .se_layer import SELayer 16 | from .transformer import (DetrTransformerDecoder, DetrTransformerDecoderLayer, 17 | DynamicConv, PatchEmbed, Transformer, nchw_to_nlc, 18 | nlc_to_nchw) 19 | 20 | __all__ = [ 21 | 'ResLayer', 'gaussian_radius', 'gen_gaussian_target', 22 | 'DetrTransformerDecoderLayer', 'DetrTransformerDecoder', 'Transformer', 23 | 'build_transformer', 'build_linear_layer', 'SinePositionalEncoding', 24 | 'LearnedPositionalEncoding', 'DynamicConv', 'SimplifiedBasicBlock', 25 | 'NormedLinear', 'NormedConv2d', 'make_divisible', 'InvertedResidual', 26 | 'SELayer', 'interpolate_as', 'ConvUpsample', 'CSPLayer', 27 | 'adaptive_avg_pool2d', 'AdaptiveAvgPool2d', 'PatchEmbed', 'nchw_to_nlc', 28 | 'nlc_to_nchw', 'pvt_convert' 29 | ] 30 | -------------------------------------------------------------------------------- /mmdet/models/utils/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/utils/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/utils/__pycache__/brick_wrappers.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/utils/__pycache__/brick_wrappers.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/utils/__pycache__/builder.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/utils/__pycache__/builder.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/utils/__pycache__/ckpt_convert.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/utils/__pycache__/ckpt_convert.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/utils/__pycache__/conv_upsample.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/utils/__pycache__/conv_upsample.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/utils/__pycache__/csp_layer.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/utils/__pycache__/csp_layer.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/utils/__pycache__/gaussian_target.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/utils/__pycache__/gaussian_target.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/utils/__pycache__/inverted_residual.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/utils/__pycache__/inverted_residual.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/utils/__pycache__/make_divisible.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/utils/__pycache__/make_divisible.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/utils/__pycache__/misc.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/utils/__pycache__/misc.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/utils/__pycache__/normed_predictor.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/utils/__pycache__/normed_predictor.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/utils/__pycache__/positional_encoding.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/utils/__pycache__/positional_encoding.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/utils/__pycache__/res_layer.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/utils/__pycache__/res_layer.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/utils/__pycache__/se_layer.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/utils/__pycache__/se_layer.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/utils/__pycache__/transformer.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/models/utils/__pycache__/transformer.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/models/utils/make_divisible.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | def make_divisible(value, divisor, min_value=None, min_ratio=0.9): 3 | """Make divisible function. 4 | 5 | This function rounds the channel number to the nearest value that can be 6 | divisible by the divisor. It is taken from the original tf repo. It ensures 7 | that all layers have a channel number that is divisible by divisor. It can 8 | be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py # noqa 9 | 10 | Args: 11 | value (int): The original channel number. 12 | divisor (int): The divisor to fully divide the channel number. 13 | min_value (int): The minimum value of the output channel. 14 | Default: None, means that the minimum value equal to the divisor. 15 | min_ratio (float): The minimum ratio of the rounded channel number to 16 | the original channel number. Default: 0.9. 17 | 18 | Returns: 19 | int: The modified output channel number. 20 | """ 21 | 22 | if min_value is None: 23 | min_value = divisor 24 | new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) 25 | # Make sure that round down does not go down by more than (1-min_ratio). 26 | if new_value < min_ratio * value: 27 | new_value += divisor 28 | return new_value 29 | -------------------------------------------------------------------------------- /mmdet/utils/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .collect_env import collect_env 3 | from .logger import get_root_logger 4 | 5 | __all__ = ['get_root_logger', 'collect_env'] 6 | -------------------------------------------------------------------------------- /mmdet/utils/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/utils/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/utils/__pycache__/collect_env.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/utils/__pycache__/collect_env.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/utils/__pycache__/contextmanagers.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/utils/__pycache__/contextmanagers.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/utils/__pycache__/logger.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/utils/__pycache__/logger.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/utils/__pycache__/util_mixins.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/utils/__pycache__/util_mixins.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/utils/__pycache__/util_random.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/mmdet/utils/__pycache__/util_random.cpython-37.pyc -------------------------------------------------------------------------------- /mmdet/utils/collect_env.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from mmcv.utils import collect_env as collect_base_env 3 | from mmcv.utils import get_git_hash 4 | 5 | import mmdet 6 | 7 | 8 | def collect_env(): 9 | """Collect the information of the running environments.""" 10 | env_info = collect_base_env() 11 | env_info['MMDetection'] = mmdet.__version__ + '+' + get_git_hash()[:7] 12 | return env_info 13 | 14 | 15 | if __name__ == '__main__': 16 | for name, val in collect_env().items(): 17 | print(f'{name}: {val}') 18 | -------------------------------------------------------------------------------- /mmdet/utils/logger.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | import logging 3 | 4 | from mmcv.utils import get_logger 5 | 6 | 7 | def get_root_logger(log_file=None, log_level=logging.INFO): 8 | """Get root logger. 9 | 10 | Args: 11 | log_file (str, optional): File path of log. Defaults to None. 12 | log_level (int, optional): The level of logger. 13 | Defaults to logging.INFO. 14 | 15 | Returns: 16 | :obj:`logging.Logger`: The obtained logger 17 | """ 18 | logger = get_logger(name='mmdet', log_file=log_file, log_level=log_level) 19 | 20 | return logger 21 | -------------------------------------------------------------------------------- /mmdet/utils/profiling.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | import contextlib 3 | import sys 4 | import time 5 | 6 | import torch 7 | 8 | if sys.version_info >= (3, 7): 9 | 10 | @contextlib.contextmanager 11 | def profile_time(trace_name, 12 | name, 13 | enabled=True, 14 | stream=None, 15 | end_stream=None): 16 | """Print time spent by CPU and GPU. 17 | 18 | Useful as a temporary context manager to find sweet spots of code 19 | suitable for async implementation. 20 | """ 21 | if (not enabled) or not torch.cuda.is_available(): 22 | yield 23 | return 24 | stream = stream if stream else torch.cuda.current_stream() 25 | end_stream = end_stream if end_stream else stream 26 | start = torch.cuda.Event(enable_timing=True) 27 | end = torch.cuda.Event(enable_timing=True) 28 | stream.record_event(start) 29 | try: 30 | cpu_start = time.monotonic() 31 | yield 32 | finally: 33 | cpu_end = time.monotonic() 34 | end_stream.record_event(end) 35 | end.synchronize() 36 | cpu_time = (cpu_end - cpu_start) * 1000 37 | gpu_time = start.elapsed_time(end) 38 | msg = f'{trace_name} {name} cpu_time {cpu_time:.2f} ms ' 39 | msg += f'gpu_time {gpu_time:.2f} ms stream {stream}' 40 | print(msg, end_stream) 41 | -------------------------------------------------------------------------------- /mmdet/utils/util_random.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | """Helpers for random number generators.""" 3 | import numpy as np 4 | 5 | 6 | def ensure_rng(rng=None): 7 | """Coerces input into a random number generator. 8 | 9 | If the input is None, then a global random state is returned. 10 | 11 | If the input is a numeric value, then that is used as a seed to construct a 12 | random state. Otherwise the input is returned as-is. 13 | 14 | Adapted from [1]_. 15 | 16 | Args: 17 | rng (int | numpy.random.RandomState | None): 18 | if None, then defaults to the global rng. Otherwise this can be an 19 | integer or a RandomState class 20 | Returns: 21 | (numpy.random.RandomState) : rng - 22 | a numpy random number generator 23 | 24 | References: 25 | .. [1] https://gitlab.kitware.com/computer-vision/kwarray/blob/master/kwarray/util_random.py#L270 # noqa: E501 26 | """ 27 | 28 | if rng is None: 29 | rng = np.random.mtrand._rand 30 | elif isinstance(rng, int): 31 | rng = np.random.RandomState(rng) 32 | else: 33 | rng = rng 34 | return rng 35 | -------------------------------------------------------------------------------- /mmdet/version.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | 3 | __version__ = '2.19.0' 4 | short_version = __version__ 5 | 6 | 7 | def parse_version_info(version_str): 8 | version_info = [] 9 | for x in version_str.split('.'): 10 | if x.isdigit(): 11 | version_info.append(int(x)) 12 | elif x.find('rc') != -1: 13 | patch_version = x.split('rc') 14 | version_info.append(int(patch_version[0])) 15 | version_info.append(f'rc{patch_version[1]}') 16 | return tuple(version_info) 17 | 18 | 19 | version_info = parse_version_info(__version__) 20 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | -r requirements/build.txt 2 | -r requirements/optional.txt 3 | -r requirements/runtime.txt 4 | -r requirements/tests.txt 5 | -------------------------------------------------------------------------------- /requirements/build.txt: -------------------------------------------------------------------------------- 1 | # These must be installed before building mmdetection 2 | cython 3 | numpy 4 | -------------------------------------------------------------------------------- /requirements/docs.txt: -------------------------------------------------------------------------------- 1 | docutils==0.16.0 2 | -e git+https://github.com/open-mmlab/pytorch_sphinx_theme.git#egg=pytorch_sphinx_theme 3 | recommonmark 4 | sphinx==4.0.2 5 | sphinx-copybutton 6 | sphinx_markdown_tables 7 | sphinx_rtd_theme==0.5.2 8 | -------------------------------------------------------------------------------- /requirements/mminstall.txt: -------------------------------------------------------------------------------- 1 | mmcv-full>=1.3.17 2 | -------------------------------------------------------------------------------- /requirements/optional.txt: -------------------------------------------------------------------------------- 1 | cityscapesscripts 2 | imagecorruptions 3 | scipy 4 | sklearn 5 | -------------------------------------------------------------------------------- /requirements/readthedocs.txt: -------------------------------------------------------------------------------- 1 | mmcv 2 | torch 3 | torchvision 4 | -------------------------------------------------------------------------------- /requirements/runtime.txt: -------------------------------------------------------------------------------- 1 | matplotlib 2 | numpy 3 | pycocotools; platform_system == "Linux" 4 | pycocotools-windows; platform_system == "Windows" 5 | six 6 | terminaltables 7 | -------------------------------------------------------------------------------- /requirements/tests.txt: -------------------------------------------------------------------------------- 1 | asynctest 2 | codecov 3 | flake8 4 | interrogate 5 | isort==4.3.21 6 | # Note: used for kwarray.group_items, this may be ported to mmcv in the future. 7 | kwarray 8 | -e git+https://github.com/open-mmlab/mmtracking#egg=mmtrack 9 | onnx==1.7.0 10 | onnxruntime>=1.8.0 11 | pytest 12 | ubelt 13 | xdoctest>=0.10.0 14 | yapf 15 | -------------------------------------------------------------------------------- /tests/data/VOCdevkit/VOC2007/Annotations/000001.xml: -------------------------------------------------------------------------------- 1 | 2 | VOC2007 3 | 000001.jpg 4 | 5 | The VOC2007 Database 6 | PASCAL VOC2007 7 | flickr 8 | 341012865 9 | 10 | 11 | Fried Camels 12 | Jinky the Fruit Bat 13 | 14 | 15 | 353 16 | 500 17 | 3 18 | 19 | 0 20 | 21 | dog 22 | Left 23 | 1 24 | 0 25 | 26 | 48 27 | 240 28 | 195 29 | 371 30 | 31 | 32 | 33 | person 34 | Left 35 | 1 36 | 0 37 | 38 | 8 39 | 12 40 | 352 41 | 498 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /tests/data/VOCdevkit/VOC2007/ImageSets/Main/test.txt: -------------------------------------------------------------------------------- 1 | 000001 2 | -------------------------------------------------------------------------------- /tests/data/VOCdevkit/VOC2007/ImageSets/Main/trainval.txt: -------------------------------------------------------------------------------- 1 | 000001 2 | -------------------------------------------------------------------------------- /tests/data/VOCdevkit/VOC2007/JPEGImages/000001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/tests/data/VOCdevkit/VOC2007/JPEGImages/000001.jpg -------------------------------------------------------------------------------- /tests/data/VOCdevkit/VOC2012/Annotations/000001.xml: -------------------------------------------------------------------------------- 1 | 2 | VOC2007 3 | 000002.jpg 4 | 5 | The VOC2007 Database 6 | PASCAL VOC2007 7 | flickr 8 | 329145082 9 | 10 | 11 | hiromori2 12 | Hiroyuki Mori 13 | 14 | 15 | 335 16 | 500 17 | 3 18 | 19 | 0 20 | 21 | train 22 | Unspecified 23 | 0 24 | 0 25 | 26 | 139 27 | 200 28 | 207 29 | 301 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /tests/data/VOCdevkit/VOC2012/ImageSets/Main/test.txt: -------------------------------------------------------------------------------- 1 | 000001 2 | -------------------------------------------------------------------------------- /tests/data/VOCdevkit/VOC2012/ImageSets/Main/trainval.txt: -------------------------------------------------------------------------------- 1 | 000001 2 | -------------------------------------------------------------------------------- /tests/data/VOCdevkit/VOC2012/JPEGImages/000001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/tests/data/VOCdevkit/VOC2012/JPEGImages/000001.jpg -------------------------------------------------------------------------------- /tests/data/color.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/tests/data/color.jpg -------------------------------------------------------------------------------- /tests/data/configs_mmtrack/selsa_faster_rcnn_r101_dc5_1x.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | './faster_rcnn_r50_dc5.py', './mot_challenge.py', 3 | '../../../configs/_base_/default_runtime.py' 4 | ] 5 | model = dict( 6 | type='SELSA', 7 | pretrains=None, 8 | detector=dict( 9 | backbone=dict(depth=18, base_channels=2), 10 | roi_head=dict( 11 | type='SelsaRoIHead', 12 | bbox_head=dict( 13 | type='SelsaBBoxHead', 14 | num_shared_fcs=2, 15 | aggregator=dict( 16 | type='SelsaAggregator', 17 | in_channels=32, 18 | num_attention_blocks=16))))) 19 | 20 | # dataset settings 21 | data = dict( 22 | val=dict( 23 | ref_img_sampler=dict( 24 | _delete_=True, 25 | num_ref_imgs=14, 26 | frame_range=[-7, 7], 27 | method='test_with_adaptive_stride')), 28 | test=dict( 29 | ref_img_sampler=dict( 30 | _delete_=True, 31 | num_ref_imgs=14, 32 | frame_range=[-7, 7], 33 | method='test_with_adaptive_stride'))) 34 | 35 | # optimizer 36 | optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0001) 37 | optimizer_config = dict( 38 | _delete_=True, grad_clip=dict(max_norm=35, norm_type=2)) 39 | # learning policy 40 | lr_config = dict( 41 | policy='step', 42 | warmup='linear', 43 | warmup_iters=500, 44 | warmup_ratio=1.0 / 3, 45 | step=[2, 5]) 46 | # runtime settings 47 | total_epochs = 7 48 | evaluation = dict(metric=['bbox'], interval=7) 49 | -------------------------------------------------------------------------------- /tests/data/custom_dataset/images/000001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/tests/data/custom_dataset/images/000001.jpg -------------------------------------------------------------------------------- /tests/data/custom_dataset/images/000001.xml: -------------------------------------------------------------------------------- 1 | 2 | VOC2007 3 | 000001.jpg 4 | 5 | The VOC2007 Database 6 | PASCAL VOC2007 7 | flickr 8 | 341012865 9 | 10 | 11 | Fried Camels 12 | Jinky the Fruit Bat 13 | 14 | 15 | 353 16 | 500 17 | 3 18 | 19 | 0 20 | 21 | dog 22 | Left 23 | 1 24 | 0 25 | 26 | 48 27 | 240 28 | 195 29 | 371 30 | 31 | 32 | 33 | person 34 | Left 35 | 1 36 | 0 37 | 38 | 8 39 | 12 40 | 352 41 | 498 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /tests/data/custom_dataset/test.txt: -------------------------------------------------------------------------------- 1 | 000001 2 | -------------------------------------------------------------------------------- /tests/data/custom_dataset/trainval.txt: -------------------------------------------------------------------------------- 1 | 000001 2 | -------------------------------------------------------------------------------- /tests/data/gray.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/tests/data/gray.jpg -------------------------------------------------------------------------------- /tests/test_data/test_datasets/test_coco_dataset.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | import os.path as osp 3 | import tempfile 4 | 5 | import mmcv 6 | import pytest 7 | 8 | from mmdet.datasets import CocoDataset 9 | 10 | 11 | def _create_ids_error_coco_json(json_name): 12 | image = { 13 | 'id': 0, 14 | 'width': 640, 15 | 'height': 640, 16 | 'file_name': 'fake_name.jpg', 17 | } 18 | 19 | annotation_1 = { 20 | 'id': 1, 21 | 'image_id': 0, 22 | 'category_id': 0, 23 | 'area': 400, 24 | 'bbox': [50, 60, 20, 20], 25 | 'iscrowd': 0, 26 | } 27 | 28 | annotation_2 = { 29 | 'id': 1, 30 | 'image_id': 0, 31 | 'category_id': 0, 32 | 'area': 900, 33 | 'bbox': [100, 120, 30, 30], 34 | 'iscrowd': 0, 35 | } 36 | 37 | categories = [{ 38 | 'id': 0, 39 | 'name': 'car', 40 | 'supercategory': 'car', 41 | }] 42 | 43 | fake_json = { 44 | 'images': [image], 45 | 'annotations': [annotation_1, annotation_2], 46 | 'categories': categories 47 | } 48 | mmcv.dump(fake_json, json_name) 49 | 50 | 51 | def test_coco_annotation_ids_unique(): 52 | tmp_dir = tempfile.TemporaryDirectory() 53 | fake_json_file = osp.join(tmp_dir.name, 'fake_data.json') 54 | _create_ids_error_coco_json(fake_json_file) 55 | 56 | # test annotation ids not unique error 57 | with pytest.raises(AssertionError): 58 | CocoDataset(ann_file=fake_json_file, classes=('car', ), pipeline=[]) 59 | -------------------------------------------------------------------------------- /tests/test_data/test_datasets/test_xml_dataset.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | import pytest 3 | 4 | from mmdet.datasets import DATASETS 5 | 6 | 7 | def test_xml_dataset(): 8 | dataconfig = { 9 | 'ann_file': 'data/VOCdevkit/VOC2007/ImageSets/Main/test.txt', 10 | 'img_prefix': 'data/VOCdevkit/VOC2007/', 11 | 'pipeline': [{ 12 | 'type': 'LoadImageFromFile' 13 | }] 14 | } 15 | XMLDataset = DATASETS.get('XMLDataset') 16 | 17 | class XMLDatasetSubClass(XMLDataset): 18 | CLASSES = None 19 | 20 | # get_ann_info and _filter_imgs of XMLDataset 21 | # would use self.CLASSES, we added CLASSES not NONE 22 | with pytest.raises(AssertionError): 23 | XMLDatasetSubClass(**dataconfig) 24 | -------------------------------------------------------------------------------- /tests/test_data/test_pipelines/test_formatting.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | import os.path as osp 3 | 4 | from mmcv.utils import build_from_cfg 5 | 6 | from mmdet.datasets.builder import PIPELINES 7 | 8 | 9 | def test_default_format_bundle(): 10 | results = dict( 11 | img_prefix=osp.join(osp.dirname(__file__), '../../data'), 12 | img_info=dict(filename='color.jpg')) 13 | load = dict(type='LoadImageFromFile') 14 | load = build_from_cfg(load, PIPELINES) 15 | bundle = dict(type='DefaultFormatBundle') 16 | bundle = build_from_cfg(bundle, PIPELINES) 17 | results = load(results) 18 | assert 'pad_shape' not in results 19 | assert 'scale_factor' not in results 20 | assert 'img_norm_cfg' not in results 21 | results = bundle(results) 22 | assert 'pad_shape' in results 23 | assert 'scale_factor' in results 24 | assert 'img_norm_cfg' in results 25 | -------------------------------------------------------------------------------- /tests/test_data/test_pipelines/test_transform/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .utils import check_result_same, construct_toy_data, create_random_bboxes 3 | 4 | __all__ = ['create_random_bboxes', 'construct_toy_data', 'check_result_same'] 5 | -------------------------------------------------------------------------------- /tests/test_metrics/test_recall.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | from mmdet.core.evaluation.recall import eval_recalls 4 | 5 | det_bboxes = np.array([ 6 | [0, 0, 10, 10], 7 | [10, 10, 20, 20], 8 | [32, 32, 38, 42], 9 | ]) 10 | gt_bboxes = np.array([[0, 0, 10, 20], [0, 10, 10, 19], [10, 10, 20, 20]]) 11 | gt_ignore = np.array([[5, 5, 10, 20], [6, 10, 10, 19]]) 12 | 13 | 14 | def test_eval_recalls(): 15 | gts = [gt_bboxes, gt_bboxes, gt_bboxes] 16 | proposals = [det_bboxes, det_bboxes, det_bboxes] 17 | 18 | recall = eval_recalls( 19 | gts, proposals, proposal_nums=2, use_legacy_coordinate=True) 20 | assert recall.shape == (1, 1) 21 | assert 0.66 < recall[0][0] < 0.667 22 | recall = eval_recalls( 23 | gts, proposals, proposal_nums=2, use_legacy_coordinate=False) 24 | assert recall.shape == (1, 1) 25 | assert 0.66 < recall[0][0] < 0.667 26 | 27 | recall = eval_recalls( 28 | gts, proposals, proposal_nums=2, use_legacy_coordinate=True) 29 | assert recall.shape == (1, 1) 30 | assert 0.66 < recall[0][0] < 0.667 31 | recall = eval_recalls( 32 | gts, 33 | proposals, 34 | iou_thrs=[0.1, 0.9], 35 | proposal_nums=2, 36 | use_legacy_coordinate=False) 37 | assert recall.shape == (1, 2) 38 | assert recall[0][1] <= recall[0][0] 39 | recall = eval_recalls( 40 | gts, 41 | proposals, 42 | iou_thrs=[0.1, 0.9], 43 | proposal_nums=2, 44 | use_legacy_coordinate=True) 45 | assert recall.shape == (1, 2) 46 | assert recall[0][1] <= recall[0][0] 47 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/test_models/test_backbones/utils.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from torch.nn.modules import GroupNorm 3 | from torch.nn.modules.batchnorm import _BatchNorm 4 | 5 | from mmdet.models.backbones.res2net import Bottle2neck 6 | from mmdet.models.backbones.resnet import BasicBlock, Bottleneck 7 | from mmdet.models.backbones.resnext import Bottleneck as BottleneckX 8 | from mmdet.models.utils import SimplifiedBasicBlock 9 | 10 | 11 | def is_block(modules): 12 | """Check if is ResNet building block.""" 13 | if isinstance(modules, (BasicBlock, Bottleneck, BottleneckX, Bottle2neck, 14 | SimplifiedBasicBlock)): 15 | return True 16 | return False 17 | 18 | 19 | def is_norm(modules): 20 | """Check if is one of the norms.""" 21 | if isinstance(modules, (GroupNorm, _BatchNorm)): 22 | return True 23 | return False 24 | 25 | 26 | def check_norm_state(modules, train_state): 27 | """Check if norm layer is in correct train state.""" 28 | for mod in modules: 29 | if isinstance(mod, _BatchNorm): 30 | if mod.training != train_state: 31 | return False 32 | return True 33 | -------------------------------------------------------------------------------- /tests/test_models/test_plugins.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | import pytest 3 | import torch 4 | 5 | from mmdet.models.plugins import DropBlock 6 | 7 | 8 | def test_dropblock(): 9 | feat = torch.rand(1, 1, 11, 11) 10 | drop_prob = 1.0 11 | dropblock = DropBlock(drop_prob, block_size=11, warmup_iters=0) 12 | out_feat = dropblock(feat) 13 | assert (out_feat == 0).all() and out_feat.shape == feat.shape 14 | drop_prob = 0.5 15 | dropblock = DropBlock(drop_prob, block_size=5, warmup_iters=0) 16 | out_feat = dropblock(feat) 17 | assert out_feat.shape == feat.shape 18 | 19 | # drop_prob must be (0,1] 20 | with pytest.raises(AssertionError): 21 | DropBlock(1.5, 3) 22 | 23 | # block_size cannot be an even number 24 | with pytest.raises(AssertionError): 25 | DropBlock(0.5, 2) 26 | 27 | # warmup_iters cannot be less than 0 28 | with pytest.raises(AssertionError): 29 | DropBlock(0.5, 3, -1) 30 | -------------------------------------------------------------------------------- /tests/test_models/test_roi_heads/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .utils import _dummy_bbox_sampling 3 | 4 | __all__ = ['_dummy_bbox_sampling'] 5 | -------------------------------------------------------------------------------- /tests/test_models/test_roi_heads/utils.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | import torch 3 | 4 | from mmdet.core import build_assigner, build_sampler 5 | 6 | 7 | def _dummy_bbox_sampling(proposal_list, gt_bboxes, gt_labels): 8 | """Create sample results that can be passed to BBoxHead.get_targets.""" 9 | num_imgs = 1 10 | feat = torch.rand(1, 1, 3, 3) 11 | assign_config = dict( 12 | type='MaxIoUAssigner', 13 | pos_iou_thr=0.5, 14 | neg_iou_thr=0.5, 15 | min_pos_iou=0.5, 16 | ignore_iof_thr=-1) 17 | sampler_config = dict( 18 | type='RandomSampler', 19 | num=512, 20 | pos_fraction=0.25, 21 | neg_pos_ub=-1, 22 | add_gt_as_proposals=True) 23 | bbox_assigner = build_assigner(assign_config) 24 | bbox_sampler = build_sampler(sampler_config) 25 | gt_bboxes_ignore = [None for _ in range(num_imgs)] 26 | sampling_results = [] 27 | for i in range(num_imgs): 28 | assign_result = bbox_assigner.assign(proposal_list[i], gt_bboxes[i], 29 | gt_bboxes_ignore[i], gt_labels[i]) 30 | sampling_result = bbox_sampler.sample( 31 | assign_result, 32 | proposal_list[i], 33 | gt_bboxes[i], 34 | gt_labels[i], 35 | feats=feat) 36 | sampling_results.append(sampling_result) 37 | 38 | return sampling_results 39 | -------------------------------------------------------------------------------- /tests/test_models/test_utils/test_conv_upsample.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | import pytest 3 | import torch 4 | 5 | from mmdet.models.utils import ConvUpsample 6 | 7 | 8 | @pytest.mark.parametrize('num_layers', [0, 1, 2]) 9 | def test_conv_upsample(num_layers): 10 | num_upsample = num_layers if num_layers > 0 else 0 11 | num_layers = num_layers if num_layers > 0 else 1 12 | layer = ConvUpsample( 13 | 10, 14 | 5, 15 | num_layers=num_layers, 16 | num_upsample=num_upsample, 17 | conv_cfg=None, 18 | norm_cfg=None) 19 | 20 | size = 5 21 | x = torch.randn((1, 10, size, size)) 22 | size = size * pow(2, num_upsample) 23 | x = layer(x) 24 | assert x.shape[-2:] == (size, size) 25 | -------------------------------------------------------------------------------- /tests/test_models/test_utils/test_model_misc.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | import numpy as np 3 | import torch 4 | 5 | from mmdet.models.utils import interpolate_as 6 | 7 | 8 | def test_interpolate_as(): 9 | source = torch.rand((1, 5, 4, 4)) 10 | target = torch.rand((1, 1, 16, 16)) 11 | 12 | # Test 4D source and target 13 | result = interpolate_as(source, target) 14 | assert result.shape == torch.Size((1, 5, 16, 16)) 15 | 16 | # Test 3D target 17 | result = interpolate_as(source, target.squeeze(0)) 18 | assert result.shape == torch.Size((1, 5, 16, 16)) 19 | 20 | # Test 3D source 21 | result = interpolate_as(source.squeeze(0), target) 22 | assert result.shape == torch.Size((5, 16, 16)) 23 | 24 | # Test type(target) == np.ndarray 25 | target = np.random.rand(16, 16) 26 | result = interpolate_as(source.squeeze(0), target) 27 | assert result.shape == torch.Size((5, 16, 16)) 28 | -------------------------------------------------------------------------------- /tests/test_models/test_utils/test_se_layer.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | import pytest 3 | import torch 4 | 5 | from mmdet.models.utils import SELayer 6 | 7 | 8 | def test_se_layer(): 9 | with pytest.raises(AssertionError): 10 | # act_cfg sequence length must equal to 2 11 | SELayer(channels=32, act_cfg=(dict(type='ReLU'), )) 12 | 13 | with pytest.raises(AssertionError): 14 | # act_cfg sequence must be a tuple of dict 15 | SELayer(channels=32, act_cfg=[dict(type='ReLU'), dict(type='ReLU')]) 16 | 17 | # Test SELayer forward 18 | layer = SELayer(channels=32) 19 | layer.init_weights() 20 | layer.train() 21 | 22 | x = torch.randn((1, 32, 10, 10)) 23 | x_out = layer(x) 24 | assert x_out.shape == torch.Size((1, 32, 10, 10)) 25 | -------------------------------------------------------------------------------- /tests/test_onnx/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from .utils import ort_validate 3 | 4 | __all__ = ['ort_validate'] 5 | -------------------------------------------------------------------------------- /tests/test_onnx/data/fsaf_head_get_bboxes.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/tests/test_onnx/data/fsaf_head_get_bboxes.pkl -------------------------------------------------------------------------------- /tests/test_onnx/data/retina_head_get_bboxes.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/tests/test_onnx/data/retina_head_get_bboxes.pkl -------------------------------------------------------------------------------- /tests/test_onnx/data/ssd_head_get_bboxes.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/tests/test_onnx/data/ssd_head_get_bboxes.pkl -------------------------------------------------------------------------------- /tests/test_onnx/data/yolov3_head_get_bboxes.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/tests/test_onnx/data/yolov3_head_get_bboxes.pkl -------------------------------------------------------------------------------- /tests/test_onnx/data/yolov3_neck.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MingboHong/SSPNet/f2d0f42273945577a5c6497fd2b384cb545f8f66/tests/test_onnx/data/yolov3_neck.pkl -------------------------------------------------------------------------------- /tests/test_utils/test_version.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | from mmdet import digit_version 3 | 4 | 5 | def test_version_check(): 6 | assert digit_version('1.0.5') > digit_version('1.0.5rc0') 7 | assert digit_version('1.0.5') > digit_version('1.0.4rc0') 8 | assert digit_version('1.0.5') > digit_version('1.0rc0') 9 | assert digit_version('1.0.0') > digit_version('0.6.2') 10 | assert digit_version('1.0.0') > digit_version('0.2.16') 11 | assert digit_version('1.0.5rc0') > digit_version('1.0.0rc0') 12 | assert digit_version('1.0.0rc1') > digit_version('1.0.0rc0') 13 | assert digit_version('1.0.0rc2') > digit_version('1.0.0rc0') 14 | assert digit_version('1.0.0rc2') > digit_version('1.0.0rc1') 15 | assert digit_version('1.0.1rc1') > digit_version('1.0.0rc1') 16 | assert digit_version('1.0.0') > digit_version('1.0.0rc1') 17 | -------------------------------------------------------------------------------- /tools/dist_test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CONFIG=$1 4 | CHECKPOINT=$2 5 | GPUS=$3 6 | PORT=${PORT:-29500} 7 | 8 | PYTHONPATH="$(dirname $0)/..":$PYTHONPATH \ 9 | python -m torch.distributed.launch --nproc_per_node=$GPUS --master_port=$PORT \ 10 | $(dirname "$0")/test.py $CONFIG $CHECKPOINT --launcher pytorch ${@:4} 11 | -------------------------------------------------------------------------------- /tools/dist_train.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")/train.py $CONFIG --launcher pytorch ${@:3} 10 | -------------------------------------------------------------------------------- /tools/model_converters/publish_model.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | import argparse 3 | import subprocess 4 | 5 | import torch 6 | 7 | 8 | def parse_args(): 9 | parser = argparse.ArgumentParser( 10 | description='Process a checkpoint to be published') 11 | parser.add_argument('in_file', help='input checkpoint filename') 12 | parser.add_argument('out_file', help='output checkpoint filename') 13 | args = parser.parse_args() 14 | return args 15 | 16 | 17 | def process_checkpoint(in_file, out_file): 18 | checkpoint = torch.load(in_file, map_location='cpu') 19 | # remove optimizer for smaller file size 20 | if 'optimizer' in checkpoint: 21 | del checkpoint['optimizer'] 22 | # if it is necessary to remove some sensitive data in checkpoint['meta'], 23 | # add the code here. 24 | if torch.__version__ >= '1.6': 25 | torch.save(checkpoint, out_file, _use_new_zipfile_serialization=False) 26 | else: 27 | torch.save(checkpoint, out_file) 28 | sha = subprocess.check_output(['sha256sum', out_file]).decode() 29 | if out_file.endswith('.pth'): 30 | out_file_name = out_file[:-4] 31 | else: 32 | out_file_name = out_file 33 | final_file = out_file_name + f'-{sha[:8]}.pth' 34 | subprocess.Popen(['mv', out_file, final_file]) 35 | 36 | 37 | def main(): 38 | args = parse_args() 39 | process_checkpoint(args.in_file, args.out_file) 40 | 41 | 42 | if __name__ == '__main__': 43 | main() 44 | -------------------------------------------------------------------------------- /tools/model_converters/selfsup2mmdet.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | import argparse 3 | from collections import OrderedDict 4 | 5 | import torch 6 | 7 | 8 | def moco_convert(src, dst): 9 | """Convert keys in pycls pretrained moco models to mmdet style.""" 10 | # load caffe model 11 | moco_model = torch.load(src) 12 | blobs = moco_model['state_dict'] 13 | # convert to pytorch style 14 | state_dict = OrderedDict() 15 | for k, v in blobs.items(): 16 | if not k.startswith('module.encoder_q.'): 17 | continue 18 | old_k = k 19 | k = k.replace('module.encoder_q.', '') 20 | state_dict[k] = v 21 | print(old_k, '->', k) 22 | # save checkpoint 23 | checkpoint = dict() 24 | checkpoint['state_dict'] = state_dict 25 | torch.save(checkpoint, dst) 26 | 27 | 28 | def main(): 29 | parser = argparse.ArgumentParser(description='Convert model keys') 30 | parser.add_argument('src', help='src detectron model path') 31 | parser.add_argument('dst', help='save path') 32 | parser.add_argument( 33 | '--selfsup', type=str, choices=['moco', 'swav'], help='save path') 34 | args = parser.parse_args() 35 | if args.selfsup == 'moco': 36 | moco_convert(args.src, args.dst) 37 | elif args.selfsup == 'swav': 38 | print('SWAV does not need to convert the keys') 39 | 40 | 41 | if __name__ == '__main__': 42 | main() 43 | -------------------------------------------------------------------------------- /tools/slurm_test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -x 4 | 5 | PARTITION=$1 6 | JOB_NAME=$2 7 | CONFIG=$3 8 | CHECKPOINT=$4 9 | GPUS=${GPUS:-8} 10 | GPUS_PER_NODE=${GPUS_PER_NODE:-8} 11 | CPUS_PER_TASK=${CPUS_PER_TASK:-5} 12 | PY_ARGS=${@:5} 13 | SRUN_ARGS=${SRUN_ARGS:-""} 14 | 15 | PYTHONPATH="$(dirname $0)/..":$PYTHONPATH \ 16 | srun -p ${PARTITION} \ 17 | --job-name=${JOB_NAME} \ 18 | --gres=gpu:${GPUS_PER_NODE} \ 19 | --ntasks=${GPUS} \ 20 | --ntasks-per-node=${GPUS_PER_NODE} \ 21 | --cpus-per-task=${CPUS_PER_TASK} \ 22 | --kill-on-bad-exit=1 \ 23 | ${SRUN_ARGS} \ 24 | python -u tools/test.py ${CONFIG} ${CHECKPOINT} --launcher="slurm" ${PY_ARGS} 25 | -------------------------------------------------------------------------------- /tools/slurm_train.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -x 4 | 5 | PARTITION=$1 6 | JOB_NAME=$2 7 | CONFIG=$3 8 | WORK_DIR=$4 9 | GPUS=${GPUS:-8} 10 | GPUS_PER_NODE=${GPUS_PER_NODE:-8} 11 | CPUS_PER_TASK=${CPUS_PER_TASK:-5} 12 | SRUN_ARGS=${SRUN_ARGS:-""} 13 | PY_ARGS=${@:5} 14 | 15 | PYTHONPATH="$(dirname $0)/..":$PYTHONPATH \ 16 | srun -p ${PARTITION} \ 17 | --job-name=${JOB_NAME} \ 18 | --gres=gpu:${GPUS_PER_NODE} \ 19 | --ntasks=${GPUS} \ 20 | --ntasks-per-node=${GPUS_PER_NODE} \ 21 | --cpus-per-task=${CPUS_PER_TASK} \ 22 | --kill-on-bad-exit=1 \ 23 | ${SRUN_ARGS} \ 24 | python -u tools/train.py ${CONFIG} --work-dir=${WORK_DIR} --launcher="slurm" ${PY_ARGS} 25 | --------------------------------------------------------------------------------