├── run.sh ├── code ├── .idea │ ├── .gitignore │ ├── vcs.xml │ ├── inspectionProfiles │ │ └── profiles_settings.xml │ ├── modules.xml │ └── code.iml ├── mmdet │ ├── models │ │ ├── dense_heads │ │ │ ├── .txt │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── atss_head.cpython-37.pyc │ │ │ │ ├── fcos_head.cpython-37.pyc │ │ │ │ ├── fsaf_head.cpython-37.pyc │ │ │ │ ├── gfl_head.cpython-37.pyc │ │ │ │ ├── paa_head.cpython-37.pyc │ │ │ │ ├── rpn_head.cpython-37.pyc │ │ │ │ ├── ssd_head.cpython-37.pyc │ │ │ │ ├── yolo_head.cpython-37.pyc │ │ │ │ ├── anchor_head.cpython-37.pyc │ │ │ │ ├── corner_head.cpython-37.pyc │ │ │ │ ├── fovea_head.cpython-37.pyc │ │ │ │ ├── ga_rpn_head.cpython-37.pyc │ │ │ │ ├── nasfcos_head.cpython-37.pyc │ │ │ │ ├── retina_head.cpython-37.pyc │ │ │ │ ├── vfnet_head.cpython-37.pyc │ │ │ │ ├── yolact_head.cpython-37.pyc │ │ │ │ ├── ga_retina_head.cpython-37.pyc │ │ │ │ ├── pisa_ssd_head.cpython-37.pyc │ │ │ │ ├── reppoints_head.cpython-37.pyc │ │ │ │ ├── rpn_test_mixin.cpython-37.pyc │ │ │ │ ├── anchor_free_head.cpython-37.pyc │ │ │ │ ├── base_dense_head.cpython-37.pyc │ │ │ │ ├── cascade_rpn_head.cpython-37.pyc │ │ │ │ ├── centripetal_head.cpython-37.pyc │ │ │ │ ├── dense_test_mixins.cpython-37.pyc │ │ │ │ ├── retina_sepbn_head.cpython-37.pyc │ │ │ │ ├── sabl_retina_head.cpython-37.pyc │ │ │ │ ├── transformer_head.cpython-37.pyc │ │ │ │ ├── embedding_rpn_head.cpython-37.pyc │ │ │ │ ├── guided_anchor_head.cpython-37.pyc │ │ │ │ ├── pisa_retinanet_head.cpython-37.pyc │ │ │ │ └── free_anchor_retina_head.cpython-37.pyc │ │ │ └── __init__.py │ │ ├── roi_heads │ │ │ ├── shared_heads │ │ │ │ ├── __init__.py │ │ │ │ └── __pycache__ │ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ │ └── res_layer.cpython-37.pyc │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── test_mixins.cpython-37.pyc │ │ │ │ ├── base_roi_head.cpython-37.pyc │ │ │ │ ├── grid_roi_head.cpython-37.pyc │ │ │ │ ├── htc_roi_head.cpython-37.pyc │ │ │ │ ├── pisa_roi_head.cpython-37.pyc │ │ │ │ ├── scnet_roi_head.cpython-37.pyc │ │ │ │ ├── cascade_roi_head.cpython-37.pyc │ │ │ │ ├── double_roi_head.cpython-37.pyc │ │ │ │ ├── dynamic_roi_head.cpython-37.pyc │ │ │ │ ├── sparse_roi_head.cpython-37.pyc │ │ │ │ ├── trident_roi_head.cpython-37.pyc │ │ │ │ ├── point_rend_roi_head.cpython-37.pyc │ │ │ │ ├── standard_roi_head.cpython-37.pyc │ │ │ │ └── mask_scoring_roi_head.cpython-37.pyc │ │ │ ├── bbox_heads │ │ │ │ ├── __pycache__ │ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ │ ├── dii_head.cpython-37.pyc │ │ │ │ │ ├── bbox_head.cpython-37.pyc │ │ │ │ │ ├── sabl_head.cpython-37.pyc │ │ │ │ │ ├── scnet_bbox_head.cpython-37.pyc │ │ │ │ │ ├── convfc_bbox_head.cpython-37.pyc │ │ │ │ │ └── double_bbox_head.cpython-37.pyc │ │ │ │ └── __init__.py │ │ │ ├── mask_heads │ │ │ │ ├── __pycache__ │ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ │ ├── grid_head.cpython-37.pyc │ │ │ │ │ ├── fcn_mask_head.cpython-37.pyc │ │ │ │ │ ├── htc_mask_head.cpython-37.pyc │ │ │ │ │ ├── maskiou_head.cpython-37.pyc │ │ │ │ │ ├── mask_point_head.cpython-37.pyc │ │ │ │ │ ├── scnet_mask_head.cpython-37.pyc │ │ │ │ │ ├── coarse_mask_head.cpython-37.pyc │ │ │ │ │ ├── feature_relay_head.cpython-37.pyc │ │ │ │ │ ├── fused_semantic_head.cpython-37.pyc │ │ │ │ │ ├── global_context_head.cpython-37.pyc │ │ │ │ │ └── scnet_semantic_head.cpython-37.pyc │ │ │ │ ├── __init__.py │ │ │ │ ├── scnet_mask_head.py │ │ │ │ ├── scnet_semantic_head.py │ │ │ │ └── htc_mask_head.py │ │ │ ├── roi_extractors │ │ │ │ ├── __pycache__ │ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ │ ├── base_roi_extractor.cpython-37.pyc │ │ │ │ │ ├── generic_roi_extractor.cpython-37.pyc │ │ │ │ │ └── single_level_roi_extractor.cpython-37.pyc │ │ │ │ └── __init__.py │ │ │ ├── double_roi_head.py │ │ │ └── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-37.pyc │ │ │ └── builder.cpython-37.pyc │ │ ├── necks │ │ │ ├── __pycache__ │ │ │ │ ├── bfp.cpython-37.pyc │ │ │ │ ├── fpg.cpython-37.pyc │ │ │ │ ├── fpn.cpython-37.pyc │ │ │ │ ├── rfp.cpython-37.pyc │ │ │ │ ├── hrfpn.cpython-37.pyc │ │ │ │ ├── pafpn.cpython-37.pyc │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── nas_fpn.cpython-37.pyc │ │ │ │ ├── ssd_neck.cpython-37.pyc │ │ │ │ ├── fpn_carafe.cpython-37.pyc │ │ │ │ ├── yolo_neck.cpython-37.pyc │ │ │ │ ├── nasfcos_fpn.cpython-37.pyc │ │ │ │ └── channel_mapper.cpython-37.pyc │ │ │ ├── __init__.py │ │ │ └── .ipynb_checkpoints │ │ │ │ └── __init__-checkpoint.py │ │ ├── backbones │ │ │ ├── __pycache__ │ │ │ │ ├── vgg.cpython-37.pyc │ │ │ │ ├── hrnet.cpython-37.pyc │ │ │ │ ├── regnet.cpython-37.pyc │ │ │ │ ├── resnet.cpython-37.pyc │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── darknet.cpython-37.pyc │ │ │ │ ├── hourglass.cpython-37.pyc │ │ │ │ ├── res2net.cpython-37.pyc │ │ │ │ ├── resnest.cpython-37.pyc │ │ │ │ ├── resnext.cpython-37.pyc │ │ │ │ ├── ssd_res50.cpython-37.pyc │ │ │ │ ├── ssd_vgg.cpython-37.pyc │ │ │ │ ├── base_backbone.cpython-37.pyc │ │ │ │ ├── trident_resnet.cpython-37.pyc │ │ │ │ ├── detectors_resnet.cpython-37.pyc │ │ │ │ └── detectors_resnext.cpython-37.pyc │ │ │ ├── __init__.py │ │ │ ├── .ipynb_checkpoints │ │ │ │ └── __init__-checkpoint.py │ │ │ └── base_backbone.py │ │ ├── detectors │ │ │ ├── __pycache__ │ │ │ │ ├── atss.cpython-37.pyc │ │ │ │ ├── base.cpython-37.pyc │ │ │ │ ├── detr.cpython-37.pyc │ │ │ │ ├── fcos.cpython-37.pyc │ │ │ │ ├── fsaf.cpython-37.pyc │ │ │ │ ├── gfl.cpython-37.pyc │ │ │ │ ├── htc.cpython-37.pyc │ │ │ │ ├── paa.cpython-37.pyc │ │ │ │ ├── rpn.cpython-37.pyc │ │ │ │ ├── yolo.cpython-37.pyc │ │ │ │ ├── fovea.cpython-37.pyc │ │ │ │ ├── scnet.cpython-37.pyc │ │ │ │ ├── vfnet.cpython-37.pyc │ │ │ │ ├── yolact.cpython-37.pyc │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── cornernet.cpython-37.pyc │ │ │ │ ├── fast_rcnn.cpython-37.pyc │ │ │ │ ├── grid_rcnn.cpython-37.pyc │ │ │ │ ├── mask_rcnn.cpython-37.pyc │ │ │ │ ├── nasfcos.cpython-37.pyc │ │ │ │ ├── retinanet.cpython-37.pyc │ │ │ │ ├── two_stage.cpython-37.pyc │ │ │ │ ├── faster_rcnn.cpython-37.pyc │ │ │ │ ├── point_rend.cpython-37.pyc │ │ │ │ ├── sparse_rcnn.cpython-37.pyc │ │ │ │ ├── cascade_rcnn.cpython-37.pyc │ │ │ │ ├── single_stage.cpython-37.pyc │ │ │ │ ├── mask_scoring_rcnn.cpython-37.pyc │ │ │ │ ├── reppoints_detector.cpython-37.pyc │ │ │ │ ├── trident_faster_rcnn.cpython-37.pyc │ │ │ │ └── scnet.cpython-37.pyc.140471741611440 │ │ │ ├── scnet.py │ │ │ ├── htc.py │ │ │ ├── gfl.py │ │ │ ├── atss.py │ │ │ ├── fcos.py │ │ │ ├── fsaf.py │ │ │ ├── paa.py │ │ │ ├── fovea.py │ │ │ ├── yolo.py │ │ │ ├── retinanet.py │ │ │ ├── .ipynb_checkpoints │ │ │ │ ├── atss-checkpoint.py │ │ │ │ ├── vfnet-checkpoint.py │ │ │ │ ├── __init__-checkpoint.py │ │ │ │ └── cascade_rcnn-checkpoint.py │ │ │ ├── vfnet.py │ │ │ ├── nasfcos.py │ │ │ ├── mask_rcnn.py │ │ │ ├── reppoints_detector.py │ │ │ ├── faster_rcnn.py │ │ │ ├── mask_scoring_rcnn.py │ │ │ ├── point_rend.py │ │ │ ├── grid_rcnn.py │ │ │ ├── __init__.py │ │ │ ├── cascade_rcnn.py │ │ │ └── detr.py │ │ ├── losses │ │ │ ├── __pycache__ │ │ │ │ ├── ae_loss.cpython-37.pyc │ │ │ │ ├── utils.cpython-37.pyc │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── accuracy.cpython-37.pyc │ │ │ │ ├── ghm_loss.cpython-37.pyc │ │ │ │ ├── iou_loss.cpython-37.pyc │ │ │ │ ├── mse_loss.cpython-37.pyc │ │ │ │ ├── pisa_loss.cpython-37.pyc │ │ │ │ ├── focal_loss.cpython-37.pyc │ │ │ │ ├── gfocal_loss.cpython-37.pyc │ │ │ │ ├── smooth_l1_loss.cpython-37.pyc │ │ │ │ ├── varifocal_loss.cpython-37.pyc │ │ │ │ ├── balanced_l1_loss.cpython-37.pyc │ │ │ │ ├── cross_entropy_loss.cpython-37.pyc │ │ │ │ └── gaussian_focal_loss.cpython-37.pyc │ │ │ ├── __init__.py │ │ │ └── mse_loss.py │ │ ├── utils │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── builder.cpython-37.pyc │ │ │ │ ├── res_layer.cpython-37.pyc │ │ │ │ ├── transformer.cpython-37.pyc │ │ │ │ ├── gaussian_target.cpython-37.pyc │ │ │ │ └── positional_encoding.cpython-37.pyc │ │ │ ├── builder.py │ │ │ └── __init__.py │ │ ├── __init__.py │ │ └── .ipynb_checkpoints │ │ │ └── __init__-checkpoint.py │ ├── __pycache__ │ │ ├── __init__.cpython-37.pyc │ │ └── version.cpython-37.pyc │ ├── apis │ │ ├── __pycache__ │ │ │ ├── test.cpython-37.pyc │ │ │ ├── train.cpython-37.pyc │ │ │ ├── __init__.cpython-37.pyc │ │ │ └── inference.cpython-37.pyc │ │ ├── __init__.py │ │ └── .ipynb_checkpoints │ │ │ └── __init__-checkpoint.py │ ├── utils │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── logger.cpython-37.pyc │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── collect_env.cpython-37.pyc │ │ │ ├── util_mixins.cpython-37.pyc │ │ │ └── contextmanagers.cpython-37.pyc │ │ ├── .ipynb_checkpoints │ │ │ └── __init__-checkpoint.py │ │ ├── collect_env.py │ │ ├── logger.py │ │ ├── util_random.py │ │ └── profiling.py │ ├── core │ │ ├── __pycache__ │ │ │ └── __init__.cpython-37.pyc │ │ ├── mask │ │ │ ├── __pycache__ │ │ │ │ ├── utils.cpython-37.pyc │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── mask_target.cpython-37.pyc │ │ │ │ └── structures.cpython-37.pyc │ │ │ └── __init__.py │ │ ├── utils │ │ │ ├── __pycache__ │ │ │ │ ├── misc.cpython-37.pyc │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ └── dist_utils.cpython-37.pyc │ │ │ ├── __init__.py │ │ │ └── .ipynb_checkpoints │ │ │ │ └── __init__-checkpoint.py │ │ ├── anchor │ │ │ ├── __pycache__ │ │ │ │ ├── utils.cpython-37.pyc │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── builder.cpython-37.pyc │ │ │ │ ├── anchor_generator.cpython-37.pyc │ │ │ │ └── point_generator.cpython-37.pyc │ │ │ ├── builder.py │ │ │ ├── .ipynb_checkpoints │ │ │ │ ├── builder-checkpoint.py │ │ │ │ └── point_generator-checkpoint.py │ │ │ ├── __init__.py │ │ │ └── point_generator.py │ │ ├── bbox │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── builder.cpython-37.pyc │ │ │ │ └── transforms.cpython-37.pyc │ │ │ ├── coder │ │ │ │ ├── __pycache__ │ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ │ ├── base_bbox_coder.cpython-37.pyc │ │ │ │ │ ├── tblr_bbox_coder.cpython-37.pyc │ │ │ │ │ ├── yolo_bbox_coder.cpython-37.pyc │ │ │ │ │ ├── pseudo_bbox_coder.cpython-37.pyc │ │ │ │ │ ├── bucketing_bbox_coder.cpython-37.pyc │ │ │ │ │ ├── delta_xywh_bbox_coder.cpython-37.pyc │ │ │ │ │ └── legacy_delta_xywh_bbox_coder.cpython-37.pyc │ │ │ │ ├── base_bbox_coder.py │ │ │ │ ├── __init__.py │ │ │ │ └── pseudo_bbox_coder.py │ │ │ ├── assigners │ │ │ │ ├── __pycache__ │ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ │ ├── assign_result.cpython-37.pyc │ │ │ │ │ ├── atss_assigner.cpython-37.pyc │ │ │ │ │ ├── base_assigner.cpython-37.pyc │ │ │ │ │ ├── grid_assigner.cpython-37.pyc │ │ │ │ │ ├── max_iou_assigner.cpython-37.pyc │ │ │ │ │ ├── point_assigner.cpython-37.pyc │ │ │ │ │ ├── region_assigner.cpython-37.pyc │ │ │ │ │ ├── hungarian_assigner.cpython-37.pyc │ │ │ │ │ ├── approx_max_iou_assigner.cpython-37.pyc │ │ │ │ │ └── center_region_assigner.cpython-37.pyc │ │ │ │ ├── base_assigner.py │ │ │ │ └── __init__.py │ │ │ ├── samplers │ │ │ │ ├── __pycache__ │ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ │ ├── base_sampler.cpython-37.pyc │ │ │ │ │ ├── ohem_sampler.cpython-37.pyc │ │ │ │ │ ├── pseudo_sampler.cpython-37.pyc │ │ │ │ │ ├── random_sampler.cpython-37.pyc │ │ │ │ │ ├── combined_sampler.cpython-37.pyc │ │ │ │ │ ├── sampling_result.cpython-37.pyc │ │ │ │ │ ├── score_hlr_sampler.cpython-37.pyc │ │ │ │ │ ├── iou_balanced_neg_sampler.cpython-37.pyc │ │ │ │ │ └── instance_balanced_pos_sampler.cpython-37.pyc │ │ │ │ ├── __init__.py │ │ │ │ ├── combined_sampler.py │ │ │ │ └── pseudo_sampler.py │ │ │ ├── match_costs │ │ │ │ ├── __pycache__ │ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ │ ├── builder.cpython-37.pyc │ │ │ │ │ └── match_cost.cpython-37.pyc │ │ │ │ ├── __init__.py │ │ │ │ └── builder.py │ │ │ ├── iou_calculators │ │ │ │ ├── __pycache__ │ │ │ │ │ ├── builder.cpython-37.pyc │ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ │ └── iou2d_calculator.cpython-37.pyc │ │ │ │ ├── __init__.py │ │ │ │ └── builder.py │ │ │ ├── builder.py │ │ │ ├── .ipynb_checkpoints │ │ │ │ ├── builder-checkpoint.py │ │ │ │ └── demodata-checkpoint.py │ │ │ ├── demodata.py │ │ │ └── __init__.py │ │ ├── export │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ └── pytorch2onnx.cpython-37.pyc │ │ │ └── __init__.py │ │ ├── evaluation │ │ │ ├── __pycache__ │ │ │ │ ├── mean_ap.cpython-37.pyc │ │ │ │ ├── recall.cpython-37.pyc │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── eval_hooks.cpython-37.pyc │ │ │ │ ├── class_names.cpython-37.pyc │ │ │ │ └── bbox_overlaps.cpython-37.pyc │ │ │ ├── __init__.py │ │ │ ├── .ipynb_checkpoints │ │ │ │ └── __init__-checkpoint.py │ │ │ └── bbox_overlaps.py │ │ ├── visualization │ │ │ ├── __pycache__ │ │ │ │ ├── image.cpython-37.pyc │ │ │ │ └── __init__.cpython-37.pyc │ │ │ └── __init__.py │ │ ├── post_processing │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── bbox_nms.cpython-37.pyc │ │ │ │ └── merge_augs.cpython-37.pyc │ │ │ └── __init__.py │ │ ├── __init__.py │ │ └── .ipynb_checkpoints │ │ │ └── __init__-checkpoint.py │ ├── datasets │ │ ├── __pycache__ │ │ │ ├── coco.cpython-37.pyc │ │ │ ├── lvis.cpython-37.pyc │ │ │ ├── voc.cpython-37.pyc │ │ │ ├── builder.cpython-37.pyc │ │ │ ├── custom.cpython-37.pyc │ │ │ ├── utils.cpython-37.pyc │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── xml_style.cpython-37.pyc │ │ │ ├── cityscapes.cpython-37.pyc │ │ │ ├── deepfashion.cpython-37.pyc │ │ │ ├── underwater.cpython-37.pyc │ │ │ ├── wider_face.cpython-37.pyc │ │ │ └── dataset_wrappers.cpython-37.pyc │ │ ├── pipelines │ │ │ ├── __pycache__ │ │ │ │ ├── compose.cpython-37.pyc │ │ │ │ ├── loading.cpython-37.pyc │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── formating.cpython-37.pyc │ │ │ │ ├── auto_augment.cpython-37.pyc │ │ │ │ ├── instaboost.cpython-37.pyc │ │ │ │ ├── transforms.cpython-37.pyc │ │ │ │ └── test_time_aug.cpython-37.pyc │ │ │ ├── compose.py │ │ │ ├── .ipynb_checkpoints │ │ │ │ ├── compose-checkpoint.py │ │ │ │ └── __init__-checkpoint.py │ │ │ └── __init__.py │ │ ├── samplers │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── group_sampler.cpython-37.pyc │ │ │ │ └── distributed_sampler.cpython-37.pyc │ │ │ ├── __init__.py │ │ │ └── distributed_sampler.py │ │ ├── deepfashion.py │ │ ├── __init__.py │ │ ├── .ipynb_checkpoints │ │ │ └── __init__-checkpoint.py │ │ └── wider_face.py │ ├── version.py │ └── __init__.py ├── requirements │ ├── readthedocs.txt │ ├── docs.txt │ ├── runtime.txt │ ├── build.txt │ ├── optional.txt │ └── tests.txt ├── requirements.txt ├── train_model2.sh ├── train_model4.sh ├── train_model1.sh ├── train_model3.sh ├── train_model7.sh ├── train_model6.sh ├── train_model5.sh ├── tools │ ├── dist_train.sh │ ├── dist_test.sh │ ├── .ipynb_checkpoints │ │ ├── dist_test-checkpoint.sh │ │ ├── slurm_test-checkpoint.sh │ │ ├── coco_eval-checkpoint.py │ │ ├── publish_model-checkpoint.py │ │ └── voc_eval-checkpoint.py │ ├── slurm_test.sh │ ├── slurm_train.sh │ ├── coco_eval.py │ ├── publish_model.py │ ├── model_converters │ │ └── publish_model.py │ ├── upgrade_model_version.py │ ├── voc_eval.py │ ├── data_process │ │ ├── split_data.py │ │ ├── .ipynb_checkpoints │ │ │ ├── split_data-checkpoint.py │ │ │ ├── generate_test_json-checkpoint.py │ │ │ └── split_data_clean-checkpoint.py │ │ ├── generate_test_json.py │ │ └── split_data_clean.py │ └── get_flops.py ├── setup.cfg └── download_weight.sh ├── requirements.txt ├── main.sh ├── train.sh └── Dockerfile /run.sh: -------------------------------------------------------------------------------- 1 | sh main.sh -------------------------------------------------------------------------------- /code/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /code/mmdet/models/dense_heads/.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | albumentations 2 | ensemble_boxes 3 | timm -------------------------------------------------------------------------------- /code/requirements/readthedocs.txt: -------------------------------------------------------------------------------- 1 | mmcv 2 | torch 3 | torchvision 4 | -------------------------------------------------------------------------------- /code/requirements/docs.txt: -------------------------------------------------------------------------------- 1 | recommonmark 2 | sphinx 3 | sphinx_markdown_tables 4 | sphinx_rtd_theme 5 | -------------------------------------------------------------------------------- /code/requirements/runtime.txt: -------------------------------------------------------------------------------- 1 | matplotlib 2 | mmpycocotools 3 | numpy 4 | six 5 | terminaltables 6 | -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/shared_heads/__init__.py: -------------------------------------------------------------------------------- 1 | from .res_layer import ResLayer 2 | 3 | __all__ = ['ResLayer'] 4 | -------------------------------------------------------------------------------- /code/requirements/build.txt: -------------------------------------------------------------------------------- 1 | # These must be installed before building mmdetection 2 | cython 3 | numpy 4 | timm 5 | ensemble_boxes -------------------------------------------------------------------------------- /code/requirements/optional.txt: -------------------------------------------------------------------------------- 1 | albumentations>=0.3.2 2 | cityscapesscripts 3 | imagecorruptions 4 | mmlvis 5 | scipy 6 | sklearn 7 | -------------------------------------------------------------------------------- /code/requirements.txt: -------------------------------------------------------------------------------- 1 | -r requirements/build.txt 2 | -r requirements/optional.txt 3 | -r requirements/runtime.txt 4 | -r requirements/tests.txt 5 | -------------------------------------------------------------------------------- /code/mmdet/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/__pycache__/version.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/__pycache__/version.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/apis/__pycache__/test.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/apis/__pycache__/test.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/apis/__pycache__/train.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/apis/__pycache__/train.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/utils/__init__.py: -------------------------------------------------------------------------------- 1 | from .collect_env import collect_env 2 | from .logger import get_root_logger 3 | 4 | __all__ = ['get_root_logger', 'collect_env'] 5 | -------------------------------------------------------------------------------- /code/mmdet/apis/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/apis/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/datasets/__pycache__/coco.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/datasets/__pycache__/coco.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/datasets/__pycache__/lvis.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/datasets/__pycache__/lvis.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/datasets/__pycache__/voc.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/datasets/__pycache__/voc.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/utils/__pycache__/logger.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/utils/__pycache__/logger.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/apis/__pycache__/inference.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/apis/__pycache__/inference.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/mask/__pycache__/utils.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/mask/__pycache__/utils.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/utils/__pycache__/misc.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/utils/__pycache__/misc.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/datasets/__pycache__/builder.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/datasets/__pycache__/builder.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/datasets/__pycache__/custom.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/datasets/__pycache__/custom.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/datasets/__pycache__/utils.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/datasets/__pycache__/utils.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/__pycache__/builder.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/__pycache__/builder.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/necks/__pycache__/bfp.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/necks/__pycache__/bfp.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/necks/__pycache__/fpg.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/necks/__pycache__/fpg.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/necks/__pycache__/fpn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/necks/__pycache__/fpn.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/necks/__pycache__/rfp.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/necks/__pycache__/rfp.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/utils/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/utils/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/anchor/__pycache__/utils.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/anchor/__pycache__/utils.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/__pycache__/builder.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/__pycache__/builder.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/mask/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/mask/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/datasets/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/datasets/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/datasets/__pycache__/xml_style.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/datasets/__pycache__/xml_style.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/necks/__pycache__/hrfpn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/necks/__pycache__/hrfpn.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/necks/__pycache__/pafpn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/necks/__pycache__/pafpn.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/utils/__pycache__/collect_env.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/utils/__pycache__/collect_env.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/utils/__pycache__/util_mixins.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/utils/__pycache__/util_mixins.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/anchor/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/anchor/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/anchor/__pycache__/builder.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/anchor/__pycache__/builder.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/__pycache__/transforms.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/__pycache__/transforms.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/export/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/export/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/mask/__pycache__/mask_target.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/mask/__pycache__/mask_target.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/mask/__pycache__/structures.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/mask/__pycache__/structures.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/utils/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/utils/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/utils/__pycache__/dist_utils.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/utils/__pycache__/dist_utils.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/datasets/__pycache__/cityscapes.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/datasets/__pycache__/cityscapes.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/datasets/__pycache__/deepfashion.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/datasets/__pycache__/deepfashion.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/datasets/__pycache__/underwater.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/datasets/__pycache__/underwater.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/datasets/__pycache__/wider_face.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/datasets/__pycache__/wider_face.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/backbones/__pycache__/vgg.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/backbones/__pycache__/vgg.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/detectors/__pycache__/atss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/detectors/__pycache__/atss.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/detectors/__pycache__/base.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/detectors/__pycache__/base.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/detectors/__pycache__/detr.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/detectors/__pycache__/detr.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/detectors/__pycache__/fcos.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/detectors/__pycache__/fcos.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/detectors/__pycache__/fsaf.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/detectors/__pycache__/fsaf.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/detectors/__pycache__/gfl.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/detectors/__pycache__/gfl.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/detectors/__pycache__/htc.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/detectors/__pycache__/htc.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/detectors/__pycache__/paa.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/detectors/__pycache__/paa.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/detectors/__pycache__/rpn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/detectors/__pycache__/rpn.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/detectors/__pycache__/yolo.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/detectors/__pycache__/yolo.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/losses/__pycache__/ae_loss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/losses/__pycache__/ae_loss.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/losses/__pycache__/utils.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/losses/__pycache__/utils.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/necks/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/necks/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/necks/__pycache__/nas_fpn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/necks/__pycache__/nas_fpn.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/necks/__pycache__/ssd_neck.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/necks/__pycache__/ssd_neck.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/utils/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/utils/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/utils/__pycache__/builder.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/utils/__pycache__/builder.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/utils/__pycache__/contextmanagers.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/utils/__pycache__/contextmanagers.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/evaluation/__pycache__/mean_ap.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/evaluation/__pycache__/mean_ap.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/evaluation/__pycache__/recall.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/evaluation/__pycache__/recall.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/backbones/__pycache__/hrnet.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/backbones/__pycache__/hrnet.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/backbones/__pycache__/regnet.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/backbones/__pycache__/regnet.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/backbones/__pycache__/resnet.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/backbones/__pycache__/resnet.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/detectors/__pycache__/fovea.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/detectors/__pycache__/fovea.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/detectors/__pycache__/scnet.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/detectors/__pycache__/scnet.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/detectors/__pycache__/vfnet.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/detectors/__pycache__/vfnet.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/detectors/__pycache__/yolact.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/detectors/__pycache__/yolact.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/losses/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/losses/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/losses/__pycache__/accuracy.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/losses/__pycache__/accuracy.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/losses/__pycache__/ghm_loss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/losses/__pycache__/ghm_loss.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/losses/__pycache__/iou_loss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/losses/__pycache__/iou_loss.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/losses/__pycache__/mse_loss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/losses/__pycache__/mse_loss.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/losses/__pycache__/pisa_loss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/losses/__pycache__/pisa_loss.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/necks/__pycache__/fpn_carafe.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/necks/__pycache__/fpn_carafe.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/necks/__pycache__/yolo_neck.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/necks/__pycache__/yolo_neck.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/utils/__pycache__/res_layer.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/utils/__pycache__/res_layer.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/coder/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/coder/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/evaluation/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/evaluation/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/evaluation/__pycache__/eval_hooks.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/evaluation/__pycache__/eval_hooks.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/export/__pycache__/pytorch2onnx.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/export/__pycache__/pytorch2onnx.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/visualization/__pycache__/image.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/visualization/__pycache__/image.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/datasets/__pycache__/dataset_wrappers.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/datasets/__pycache__/dataset_wrappers.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/datasets/pipelines/__pycache__/compose.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/datasets/pipelines/__pycache__/compose.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/datasets/pipelines/__pycache__/loading.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/datasets/pipelines/__pycache__/loading.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/datasets/samplers/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/datasets/samplers/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/backbones/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/backbones/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/backbones/__pycache__/darknet.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/backbones/__pycache__/darknet.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/backbones/__pycache__/hourglass.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/backbones/__pycache__/hourglass.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/backbones/__pycache__/res2net.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/backbones/__pycache__/res2net.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/backbones/__pycache__/resnest.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/backbones/__pycache__/resnest.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/backbones/__pycache__/resnext.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/backbones/__pycache__/resnext.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/backbones/__pycache__/ssd_res50.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/backbones/__pycache__/ssd_res50.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/backbones/__pycache__/ssd_vgg.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/backbones/__pycache__/ssd_vgg.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/detectors/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/detectors/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/detectors/__pycache__/cornernet.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/detectors/__pycache__/cornernet.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/detectors/__pycache__/fast_rcnn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/detectors/__pycache__/fast_rcnn.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/detectors/__pycache__/grid_rcnn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/detectors/__pycache__/grid_rcnn.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/detectors/__pycache__/mask_rcnn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/detectors/__pycache__/mask_rcnn.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/detectors/__pycache__/nasfcos.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/detectors/__pycache__/nasfcos.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/detectors/__pycache__/retinanet.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/detectors/__pycache__/retinanet.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/detectors/__pycache__/two_stage.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/detectors/__pycache__/two_stage.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/losses/__pycache__/focal_loss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/losses/__pycache__/focal_loss.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/losses/__pycache__/gfocal_loss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/losses/__pycache__/gfocal_loss.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/necks/__pycache__/nasfcos_fpn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/necks/__pycache__/nasfcos_fpn.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/utils/__pycache__/transformer.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/utils/__pycache__/transformer.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/utils/.ipynb_checkpoints/__init__-checkpoint.py: -------------------------------------------------------------------------------- 1 | from .collect_env import collect_env 2 | from .logger import get_root_logger 3 | 4 | __all__ = ['get_root_logger', 'collect_env'] 5 | -------------------------------------------------------------------------------- /code/mmdet/core/anchor/__pycache__/anchor_generator.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/anchor/__pycache__/anchor_generator.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/anchor/__pycache__/point_generator.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/anchor/__pycache__/point_generator.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/assigners/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/assigners/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/samplers/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/samplers/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/evaluation/__pycache__/class_names.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/evaluation/__pycache__/class_names.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/visualization/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/visualization/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/datasets/pipelines/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/datasets/pipelines/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/datasets/pipelines/__pycache__/formating.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/datasets/pipelines/__pycache__/formating.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/dense_heads/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/dense_heads/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/dense_heads/__pycache__/atss_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/dense_heads/__pycache__/atss_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/dense_heads/__pycache__/fcos_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/dense_heads/__pycache__/fcos_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/dense_heads/__pycache__/fsaf_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/dense_heads/__pycache__/fsaf_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/dense_heads/__pycache__/gfl_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/dense_heads/__pycache__/gfl_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/dense_heads/__pycache__/paa_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/dense_heads/__pycache__/paa_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/dense_heads/__pycache__/rpn_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/dense_heads/__pycache__/rpn_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/dense_heads/__pycache__/ssd_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/dense_heads/__pycache__/ssd_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/dense_heads/__pycache__/yolo_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/dense_heads/__pycache__/yolo_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/detectors/__pycache__/faster_rcnn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/detectors/__pycache__/faster_rcnn.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/detectors/__pycache__/point_rend.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/detectors/__pycache__/point_rend.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/detectors/__pycache__/sparse_rcnn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/detectors/__pycache__/sparse_rcnn.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/losses/__pycache__/smooth_l1_loss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/losses/__pycache__/smooth_l1_loss.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/losses/__pycache__/varifocal_loss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/losses/__pycache__/varifocal_loss.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/necks/__pycache__/channel_mapper.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/necks/__pycache__/channel_mapper.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/__pycache__/test_mixins.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/__pycache__/test_mixins.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/utils/__pycache__/gaussian_target.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/utils/__pycache__/gaussian_target.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/coder/__pycache__/base_bbox_coder.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/coder/__pycache__/base_bbox_coder.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/coder/__pycache__/tblr_bbox_coder.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/coder/__pycache__/tblr_bbox_coder.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/coder/__pycache__/yolo_bbox_coder.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/coder/__pycache__/yolo_bbox_coder.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/match_costs/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/match_costs/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/match_costs/__pycache__/builder.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/match_costs/__pycache__/builder.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/samplers/__pycache__/base_sampler.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/samplers/__pycache__/base_sampler.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/samplers/__pycache__/ohem_sampler.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/samplers/__pycache__/ohem_sampler.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/evaluation/__pycache__/bbox_overlaps.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/evaluation/__pycache__/bbox_overlaps.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/post_processing/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/post_processing/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/post_processing/__pycache__/bbox_nms.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/post_processing/__pycache__/bbox_nms.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/post_processing/__pycache__/merge_augs.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/post_processing/__pycache__/merge_augs.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/datasets/pipelines/__pycache__/auto_augment.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/datasets/pipelines/__pycache__/auto_augment.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/datasets/pipelines/__pycache__/instaboost.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/datasets/pipelines/__pycache__/instaboost.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/datasets/pipelines/__pycache__/transforms.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/datasets/pipelines/__pycache__/transforms.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/datasets/samplers/__pycache__/group_sampler.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/datasets/samplers/__pycache__/group_sampler.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/backbones/__pycache__/base_backbone.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/backbones/__pycache__/base_backbone.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/backbones/__pycache__/trident_resnet.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/backbones/__pycache__/trident_resnet.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/dense_heads/__pycache__/anchor_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/dense_heads/__pycache__/anchor_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/dense_heads/__pycache__/corner_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/dense_heads/__pycache__/corner_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/dense_heads/__pycache__/fovea_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/dense_heads/__pycache__/fovea_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/dense_heads/__pycache__/ga_rpn_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/dense_heads/__pycache__/ga_rpn_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/dense_heads/__pycache__/nasfcos_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/dense_heads/__pycache__/nasfcos_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/dense_heads/__pycache__/retina_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/dense_heads/__pycache__/retina_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/dense_heads/__pycache__/vfnet_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/dense_heads/__pycache__/vfnet_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/dense_heads/__pycache__/yolact_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/dense_heads/__pycache__/yolact_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/detectors/__pycache__/cascade_rcnn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/detectors/__pycache__/cascade_rcnn.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/detectors/__pycache__/single_stage.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/detectors/__pycache__/single_stage.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/losses/__pycache__/balanced_l1_loss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/losses/__pycache__/balanced_l1_loss.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/__pycache__/base_roi_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/__pycache__/base_roi_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/__pycache__/grid_roi_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/__pycache__/grid_roi_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/__pycache__/htc_roi_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/__pycache__/htc_roi_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/__pycache__/pisa_roi_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/__pycache__/pisa_roi_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/__pycache__/scnet_roi_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/__pycache__/scnet_roi_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/assigners/__pycache__/assign_result.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/assigners/__pycache__/assign_result.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/assigners/__pycache__/atss_assigner.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/assigners/__pycache__/atss_assigner.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/assigners/__pycache__/base_assigner.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/assigners/__pycache__/base_assigner.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/assigners/__pycache__/grid_assigner.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/assigners/__pycache__/grid_assigner.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/coder/__pycache__/pseudo_bbox_coder.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/coder/__pycache__/pseudo_bbox_coder.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/iou_calculators/__pycache__/builder.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/iou_calculators/__pycache__/builder.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/match_costs/__pycache__/match_cost.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/match_costs/__pycache__/match_cost.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/samplers/__pycache__/pseudo_sampler.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/samplers/__pycache__/pseudo_sampler.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/samplers/__pycache__/random_sampler.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/samplers/__pycache__/random_sampler.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/datasets/pipelines/__pycache__/test_time_aug.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/datasets/pipelines/__pycache__/test_time_aug.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/backbones/__pycache__/detectors_resnet.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/backbones/__pycache__/detectors_resnet.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/dense_heads/__pycache__/ga_retina_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/dense_heads/__pycache__/ga_retina_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/dense_heads/__pycache__/pisa_ssd_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/dense_heads/__pycache__/pisa_ssd_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/dense_heads/__pycache__/reppoints_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/dense_heads/__pycache__/reppoints_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/dense_heads/__pycache__/rpn_test_mixin.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/dense_heads/__pycache__/rpn_test_mixin.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/losses/__pycache__/cross_entropy_loss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/losses/__pycache__/cross_entropy_loss.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/losses/__pycache__/gaussian_focal_loss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/losses/__pycache__/gaussian_focal_loss.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/__pycache__/cascade_roi_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/__pycache__/cascade_roi_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/__pycache__/double_roi_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/__pycache__/double_roi_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/__pycache__/dynamic_roi_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/__pycache__/dynamic_roi_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/__pycache__/sparse_roi_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/__pycache__/sparse_roi_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/__pycache__/trident_roi_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/__pycache__/trident_roi_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/utils/__pycache__/positional_encoding.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/utils/__pycache__/positional_encoding.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/assigners/__pycache__/max_iou_assigner.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/assigners/__pycache__/max_iou_assigner.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/assigners/__pycache__/point_assigner.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/assigners/__pycache__/point_assigner.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/assigners/__pycache__/region_assigner.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/assigners/__pycache__/region_assigner.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/coder/__pycache__/bucketing_bbox_coder.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/coder/__pycache__/bucketing_bbox_coder.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/iou_calculators/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/iou_calculators/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/samplers/__pycache__/combined_sampler.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/samplers/__pycache__/combined_sampler.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/samplers/__pycache__/sampling_result.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/samplers/__pycache__/sampling_result.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/samplers/__pycache__/score_hlr_sampler.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/samplers/__pycache__/score_hlr_sampler.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/backbones/__pycache__/detectors_resnext.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/backbones/__pycache__/detectors_resnext.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/dense_heads/__pycache__/anchor_free_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/dense_heads/__pycache__/anchor_free_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/dense_heads/__pycache__/base_dense_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/dense_heads/__pycache__/base_dense_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/dense_heads/__pycache__/cascade_rpn_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/dense_heads/__pycache__/cascade_rpn_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/dense_heads/__pycache__/centripetal_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/dense_heads/__pycache__/centripetal_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/dense_heads/__pycache__/dense_test_mixins.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/dense_heads/__pycache__/dense_test_mixins.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/dense_heads/__pycache__/retina_sepbn_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/dense_heads/__pycache__/retina_sepbn_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/dense_heads/__pycache__/sabl_retina_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/dense_heads/__pycache__/sabl_retina_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/dense_heads/__pycache__/transformer_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/dense_heads/__pycache__/transformer_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/detectors/__pycache__/mask_scoring_rcnn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/detectors/__pycache__/mask_scoring_rcnn.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/detectors/__pycache__/reppoints_detector.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/detectors/__pycache__/reppoints_detector.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/detectors/__pycache__/trident_faster_rcnn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/detectors/__pycache__/trident_faster_rcnn.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/__pycache__/point_rend_roi_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/__pycache__/point_rend_roi_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/__pycache__/standard_roi_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/__pycache__/standard_roi_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/bbox_heads/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/bbox_heads/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/bbox_heads/__pycache__/dii_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/bbox_heads/__pycache__/dii_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/mask_heads/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/mask_heads/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/assigners/__pycache__/hungarian_assigner.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/assigners/__pycache__/hungarian_assigner.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/coder/__pycache__/delta_xywh_bbox_coder.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/coder/__pycache__/delta_xywh_bbox_coder.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/datasets/samplers/__pycache__/distributed_sampler.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/datasets/samplers/__pycache__/distributed_sampler.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/dense_heads/__pycache__/embedding_rpn_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/dense_heads/__pycache__/embedding_rpn_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/dense_heads/__pycache__/guided_anchor_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/dense_heads/__pycache__/guided_anchor_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/dense_heads/__pycache__/pisa_retinanet_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/dense_heads/__pycache__/pisa_retinanet_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/detectors/__pycache__/scnet.cpython-37.pyc.140471741611440: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/detectors/__pycache__/scnet.cpython-37.pyc.140471741611440 -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/__pycache__/mask_scoring_roi_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/__pycache__/mask_scoring_roi_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/bbox_heads/__pycache__/bbox_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/bbox_heads/__pycache__/bbox_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/bbox_heads/__pycache__/sabl_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/bbox_heads/__pycache__/sabl_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/mask_heads/__pycache__/grid_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/mask_heads/__pycache__/grid_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/shared_heads/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/shared_heads/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/mask_heads/__pycache__/fcn_mask_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/mask_heads/__pycache__/fcn_mask_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/mask_heads/__pycache__/htc_mask_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/mask_heads/__pycache__/htc_mask_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/mask_heads/__pycache__/maskiou_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/mask_heads/__pycache__/maskiou_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/roi_extractors/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/roi_extractors/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/shared_heads/__pycache__/res_layer.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/shared_heads/__pycache__/res_layer.cpython-37.pyc -------------------------------------------------------------------------------- /code/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /code/mmdet/core/bbox/assigners/__pycache__/approx_max_iou_assigner.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/assigners/__pycache__/approx_max_iou_assigner.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/assigners/__pycache__/center_region_assigner.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/assigners/__pycache__/center_region_assigner.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/iou_calculators/__pycache__/iou2d_calculator.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/iou_calculators/__pycache__/iou2d_calculator.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/samplers/__pycache__/iou_balanced_neg_sampler.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/samplers/__pycache__/iou_balanced_neg_sampler.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/dense_heads/__pycache__/free_anchor_retina_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/dense_heads/__pycache__/free_anchor_retina_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/bbox_heads/__pycache__/scnet_bbox_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/bbox_heads/__pycache__/scnet_bbox_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/mask_heads/__pycache__/mask_point_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/mask_heads/__pycache__/mask_point_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/mask_heads/__pycache__/scnet_mask_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/mask_heads/__pycache__/scnet_mask_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/coder/__pycache__/legacy_delta_xywh_bbox_coder.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/coder/__pycache__/legacy_delta_xywh_bbox_coder.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/bbox_heads/__pycache__/convfc_bbox_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/bbox_heads/__pycache__/convfc_bbox_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/bbox_heads/__pycache__/double_bbox_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/bbox_heads/__pycache__/double_bbox_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/mask_heads/__pycache__/coarse_mask_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/mask_heads/__pycache__/coarse_mask_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/mask_heads/__pycache__/feature_relay_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/mask_heads/__pycache__/feature_relay_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/bbox/iou_calculators/__init__.py: -------------------------------------------------------------------------------- 1 | from .builder import build_iou_calculator 2 | from .iou2d_calculator import BboxOverlaps2D, bbox_overlaps 3 | 4 | __all__ = ['build_iou_calculator', 'BboxOverlaps2D', 'bbox_overlaps'] 5 | -------------------------------------------------------------------------------- /code/mmdet/core/bbox/samplers/__pycache__/instance_balanced_pos_sampler.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/core/bbox/samplers/__pycache__/instance_balanced_pos_sampler.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/mask_heads/__pycache__/fused_semantic_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/mask_heads/__pycache__/fused_semantic_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/mask_heads/__pycache__/global_context_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/mask_heads/__pycache__/global_context_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/mask_heads/__pycache__/scnet_semantic_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/mask_heads/__pycache__/scnet_semantic_head.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/core/visualization/__init__.py: -------------------------------------------------------------------------------- 1 | from .image import (color_val_matplotlib, imshow_det_bboxes, 2 | imshow_gt_det_bboxes) 3 | 4 | __all__ = ['imshow_det_bboxes', 'imshow_gt_det_bboxes', 'color_val_matplotlib'] 5 | -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/roi_extractors/__pycache__/base_roi_extractor.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/roi_extractors/__pycache__/base_roi_extractor.cpython-37.pyc -------------------------------------------------------------------------------- /code/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/roi_extractors/__pycache__/generic_roi_extractor.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/roi_extractors/__pycache__/generic_roi_extractor.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/datasets/samplers/__init__.py: -------------------------------------------------------------------------------- 1 | from .distributed_sampler import DistributedSampler 2 | from .group_sampler import DistributedGroupSampler, GroupSampler 3 | 4 | __all__ = ['DistributedSampler', 'DistributedGroupSampler', 'GroupSampler'] 5 | -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/roi_extractors/__pycache__/single_level_roi_extractor.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwl-max/road_object_detection/HEAD/code/mmdet/models/roi_heads/roi_extractors/__pycache__/single_level_roi_extractor.cpython-37.pyc -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/roi_extractors/__init__.py: -------------------------------------------------------------------------------- 1 | from .generic_roi_extractor import GenericRoIExtractor 2 | from .single_level_roi_extractor import SingleRoIExtractor 3 | 4 | __all__ = [ 5 | 'SingleRoIExtractor', 6 | 'GenericRoIExtractor', 7 | ] 8 | -------------------------------------------------------------------------------- /code/train_model2.sh: -------------------------------------------------------------------------------- 1 | python tools/train.py configs/cascade_rcnn_s101_dcn_fpn.py --no-validate 2 | sleep 1 3 | 4 | echo "训练完成" 5 | mv /data/user_data/cascade_rcnn_s101_dcn_fpn_gc_box_casiou0.55-0.75_e20/epoch_20.pth /data/code/ensemble_configs/s101_20-bd7b757b.pth 6 | -------------------------------------------------------------------------------- /code/train_model4.sh: -------------------------------------------------------------------------------- 1 | python tools/train.py configs/cascade_rcnn_r101_dcn_fpn.py --no-validate 2 | sleep 1 3 | 4 | echo "训练完成" 5 | mv /data/user_data/cascade_rcnn_r101_dcn_fpn_casiou0.55-0.75_gc_box_e20/epoch_20.pth /data/code/ensemble_configs/r101_20-db83ab64.pth 6 | -------------------------------------------------------------------------------- /code/mmdet/core/anchor/builder.py: -------------------------------------------------------------------------------- 1 | from mmcv.utils import Registry, build_from_cfg 2 | 3 | ANCHOR_GENERATORS = Registry('Anchor generator') 4 | 5 | 6 | def build_anchor_generator(cfg, default_args=None): 7 | return build_from_cfg(cfg, ANCHOR_GENERATORS, default_args) 8 | -------------------------------------------------------------------------------- /code/train_model1.sh: -------------------------------------------------------------------------------- 1 | python tools/train.py configs/cascade_rcnn_r50_rfp_carafe_sac.py --no-validate 2 | sleep 1 3 | 4 | echo "训练完成" 5 | mv /data/user_data/cascade_rcnn_r50_rfp_carafe_sac_gc_box_e20/epoch_20.pth /data/code/ensemble_configs/detectors_r50_e20-0bd921e5.pth 6 | -------------------------------------------------------------------------------- /code/train_model3.sh: -------------------------------------------------------------------------------- 1 | python tools/train.py configs/cascade_rcnn_r2_101_dcn_fpn.py --no-validate 2 | sleep 1 3 | 4 | echo "训练完成" 5 | mv /data/user_data/cascade_rcnn_r2_101_dcn_fpn_casiou0.55-0.75-gc_box_e20/epoch_20.pth /data/code/ensemble_configs/r2_101_20-487bd3ea.pth 6 | -------------------------------------------------------------------------------- /code/train_model7.sh: -------------------------------------------------------------------------------- 1 | python tools/train.py configs/cascade_rcnn_swin_base_fpn.py --no-validate 2 | sleep 1 3 | 4 | echo "训练完成" 5 | mv /data/user_data/cascade_rcnn_swin_base_fpn_casiou0.55-0.75_gc_box_e20/epoch_20.pth /data/code/ensemble_configs/swin_base_e20-b06c4eb6.pth 6 | -------------------------------------------------------------------------------- /code/train_model6.sh: -------------------------------------------------------------------------------- 1 | python tools/train.py configs/cascade_rcnn_swin_small_fpn.py --no-validate 2 | sleep 1 3 | 4 | echo "训练完成" 5 | mv /data/user_data/cascade_rcnn_swin_small_fpn_casiou0.55-0.75_gc_box_e20/epoch_20.pth /data/code/ensemble_configs/swin_small_e20-0df8a664.pth 6 | -------------------------------------------------------------------------------- /main.sh: -------------------------------------------------------------------------------- 1 | echo "生成testB.json" 2 | cd /data/code/ 3 | python tools/data_process/generate_test_json.py 4 | sleep 1 5 | 6 | echo "开始预测" 7 | python tools/predict_ensemble.py 8 | echo "预测完成!" 9 | 10 | cp /data/prediction_result/result.segm.json /data/prediction_result/result.json -------------------------------------------------------------------------------- /code/train_model5.sh: -------------------------------------------------------------------------------- 1 | python tools/train.py configs/cascade_rcnn_x101_32x4d_dcn_fpn.py --no-validate 2 | sleep 1 3 | 4 | echo "训练完成" 5 | mv /data/user_data/cascade_rcnn_x101_32x4d_dcn_fpn_casiou0.55-0.75_gc_box_e20/epoch_20.pth /data/code/ensemble_configs/x101_32x4d_20-f11fb360.pth 6 | -------------------------------------------------------------------------------- /code/mmdet/core/bbox/match_costs/__init__.py: -------------------------------------------------------------------------------- 1 | from .builder import build_match_cost 2 | from .match_cost import BBoxL1Cost, ClassificationCost, FocalLossCost, IoUCost 3 | 4 | __all__ = [ 5 | 'build_match_cost', 'ClassificationCost', 'BBoxL1Cost', 'IoUCost', 6 | 'FocalLossCost' 7 | ] 8 | -------------------------------------------------------------------------------- /code/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 | onnx==1.7.0 9 | onnxruntime==1.5.1 10 | pytest 11 | ubelt 12 | xdoctest>=0.10.0 13 | yapf 14 | -------------------------------------------------------------------------------- /code/mmdet/core/bbox/match_costs/builder.py: -------------------------------------------------------------------------------- 1 | from mmcv.utils import Registry, build_from_cfg 2 | 3 | MATCH_COST = Registry('Match Cost') 4 | 5 | 6 | def build_match_cost(cfg, default_args=None): 7 | """Builder of IoU calculator.""" 8 | return build_from_cfg(cfg, MATCH_COST, default_args) 9 | -------------------------------------------------------------------------------- /code/mmdet/core/anchor/.ipynb_checkpoints/builder-checkpoint.py: -------------------------------------------------------------------------------- 1 | from mmcv.utils import Registry, build_from_cfg 2 | 3 | ANCHOR_GENERATORS = Registry('Anchor generator') 4 | 5 | 6 | def build_anchor_generator(cfg, default_args=None): 7 | return build_from_cfg(cfg, ANCHOR_GENERATORS, default_args) 8 | -------------------------------------------------------------------------------- /code/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /code/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 | -------------------------------------------------------------------------------- /code/mmdet/core/bbox/iou_calculators/builder.py: -------------------------------------------------------------------------------- 1 | from mmcv.utils import Registry, build_from_cfg 2 | 3 | IOU_CALCULATORS = Registry('IoU calculator') 4 | 5 | 6 | def build_iou_calculator(cfg, default_args=None): 7 | """Builder of IoU calculator.""" 8 | return build_from_cfg(cfg, IOU_CALCULATORS, default_args) 9 | -------------------------------------------------------------------------------- /code/mmdet/core/export/__init__.py: -------------------------------------------------------------------------------- 1 | from .pytorch2onnx import (build_model_from_cfg, 2 | generate_inputs_and_wrap_model, 3 | preprocess_example_input) 4 | 5 | __all__ = [ 6 | 'build_model_from_cfg', 'generate_inputs_and_wrap_model', 7 | 'preprocess_example_input' 8 | ] 9 | -------------------------------------------------------------------------------- /code/mmdet/core/utils/__init__.py: -------------------------------------------------------------------------------- 1 | from .dist_utils import DistOptimizerHook, allreduce_grads, reduce_mean 2 | from .misc import mask2ndarray, multi_apply, unmap 3 | from .swa_hook import SWAHook 4 | __all__ = [ 5 | 'allreduce_grads', 'DistOptimizerHook', 'reduce_mean', 'multi_apply', 6 | 'unmap', 'mask2ndarray', 'SWAHook' 7 | ] 8 | -------------------------------------------------------------------------------- /code/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 | -------------------------------------------------------------------------------- /code/mmdet/core/__init__.py: -------------------------------------------------------------------------------- 1 | from .anchor import * # noqa: F401, F403 2 | from .bbox import * # noqa: F401, F403 3 | from .evaluation import * # noqa: F401, F403 4 | from .export import * # noqa: F401, F403 5 | from .mask import * # noqa: F401, F403 6 | from .post_processing import * # noqa: F401, F403 7 | from .utils import * # noqa: F401, F403 8 | -------------------------------------------------------------------------------- /code/mmdet/core/mask/__init__.py: -------------------------------------------------------------------------------- 1 | from .mask_target import mask_target 2 | from .structures import BaseInstanceMasks, BitmapMasks, PolygonMasks 3 | from .utils import encode_mask_results, split_combined_polys 4 | 5 | __all__ = [ 6 | 'split_combined_polys', 'mask_target', 'BaseInstanceMasks', 'BitmapMasks', 7 | 'PolygonMasks', 'encode_mask_results' 8 | ] 9 | -------------------------------------------------------------------------------- /code/mmdet/models/detectors/scnet.py: -------------------------------------------------------------------------------- 1 | from ..builder import DETECTORS 2 | from .cascade_rcnn import CascadeRCNN 3 | 4 | 5 | @DETECTORS.register_module() 6 | class SCNet(CascadeRCNN): 7 | """Implementation of `SCNet `_""" 8 | 9 | def __init__(self, **kwargs): 10 | super(SCNet, self).__init__(**kwargs) 11 | -------------------------------------------------------------------------------- /code/mmdet/core/utils/.ipynb_checkpoints/__init__-checkpoint.py: -------------------------------------------------------------------------------- 1 | from .dist_utils import DistOptimizerHook, allreduce_grads, reduce_mean 2 | from .misc import mask2ndarray, multi_apply, unmap 3 | from .swa_hook import SWAHook 4 | __all__ = [ 5 | 'allreduce_grads', 'DistOptimizerHook', 'reduce_mean', 'multi_apply', 6 | 'unmap', 'mask2ndarray', 'SWAHook' 7 | ] 8 | -------------------------------------------------------------------------------- /code/tools/.ipynb_checkpoints/dist_test-checkpoint.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 | -------------------------------------------------------------------------------- /code/mmdet/core/post_processing/__init__.py: -------------------------------------------------------------------------------- 1 | from .bbox_nms import fast_nms, multiclass_nms 2 | from .merge_augs import (merge_aug_bboxes, merge_aug_masks, 3 | merge_aug_proposals, merge_aug_scores) 4 | 5 | __all__ = [ 6 | 'multiclass_nms', 'merge_aug_proposals', 'merge_aug_bboxes', 7 | 'merge_aug_scores', 'merge_aug_masks', 'fast_nms' 8 | ] 9 | -------------------------------------------------------------------------------- /code/mmdet/core/.ipynb_checkpoints/__init__-checkpoint.py: -------------------------------------------------------------------------------- 1 | from .anchor import * # noqa: F401, F403 2 | from .bbox import * # noqa: F401, F403 3 | from .evaluation import * # noqa: F401, F403 4 | from .export import * # noqa: F401, F403 5 | from .mask import * # noqa: F401, F403 6 | from .post_processing import * # noqa: F401, F403 7 | from .utils import * # noqa: F401, F403 8 | -------------------------------------------------------------------------------- /code/mmdet/datasets/deepfashion.py: -------------------------------------------------------------------------------- 1 | from .builder import DATASETS 2 | from .coco import CocoDataset 3 | 4 | 5 | @DATASETS.register_module() 6 | class DeepFashionDataset(CocoDataset): 7 | 8 | CLASSES = ('top', 'skirt', 'leggings', 'dress', 'outer', 'pants', 'bag', 9 | 'neckwear', 'headwear', 'eyeglass', 'belt', 'footwear', 'hair', 10 | 'skin', 'face') 11 | -------------------------------------------------------------------------------- /code/mmdet/core/bbox/assigners/base_assigner.py: -------------------------------------------------------------------------------- 1 | from abc import ABCMeta, abstractmethod 2 | 3 | 4 | class BaseAssigner(metaclass=ABCMeta): 5 | """Base assigner that assigns boxes to ground truth boxes.""" 6 | 7 | @abstractmethod 8 | def assign(self, bboxes, gt_bboxes, gt_bboxes_ignore=None, gt_labels=None): 9 | """Assign boxes to either a ground truth boxe or a negative boxes.""" 10 | pass 11 | -------------------------------------------------------------------------------- /code/.idea/code.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 12 | -------------------------------------------------------------------------------- /code/mmdet/utils/collect_env.py: -------------------------------------------------------------------------------- 1 | from mmcv.utils import collect_env as collect_base_env 2 | from mmcv.utils import get_git_hash 3 | 4 | import mmdet 5 | 6 | 7 | def collect_env(): 8 | """Collect the information of the running environments.""" 9 | env_info = collect_base_env() 10 | env_info['MMDetection'] = mmdet.__version__ + '+' + get_git_hash()[:7] 11 | return env_info 12 | 13 | 14 | if __name__ == '__main__': 15 | for name, val in collect_env().items(): 16 | print(f'{name}: {val}') 17 | -------------------------------------------------------------------------------- /code/setup.cfg: -------------------------------------------------------------------------------- 1 | [isort] 2 | line_length = 79 3 | multi_line_output = 0 4 | known_standard_library = setuptools 5 | known_first_party = mmdet 6 | known_third_party = PIL,asynctest,cityscapesscripts,cv2,gather_models,matplotlib,mmcv,numpy,onnx,onnxruntime,pycocotools,pytest,seaborn,six,terminaltables,torch 7 | no_lines_before = STDLIB,LOCALFOLDER 8 | default_section = THIRDPARTY 9 | 10 | [yapf] 11 | BASED_ON_STYLE = pep8 12 | BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF = true 13 | SPLIT_BEFORE_EXPRESSION_AFTER_OPENING_PAREN = true 14 | -------------------------------------------------------------------------------- /code/mmdet/models/utils/builder.py: -------------------------------------------------------------------------------- 1 | from mmcv.utils import Registry, build_from_cfg 2 | 3 | TRANSFORMER = Registry('Transformer') 4 | POSITIONAL_ENCODING = Registry('Position encoding') 5 | 6 | 7 | def build_transformer(cfg, default_args=None): 8 | """Builder for Transformer.""" 9 | return build_from_cfg(cfg, TRANSFORMER, default_args) 10 | 11 | 12 | def build_positional_encoding(cfg, default_args=None): 13 | """Builder for Position Encoding.""" 14 | return build_from_cfg(cfg, POSITIONAL_ENCODING, default_args) 15 | -------------------------------------------------------------------------------- /code/mmdet/models/detectors/htc.py: -------------------------------------------------------------------------------- 1 | from ..builder import DETECTORS 2 | from .cascade_rcnn import CascadeRCNN 3 | 4 | 5 | @DETECTORS.register_module() 6 | class HybridTaskCascade(CascadeRCNN): 7 | """Implementation of `HTC `_""" 8 | 9 | def __init__(self, **kwargs): 10 | super(HybridTaskCascade, self).__init__(**kwargs) 11 | 12 | @property 13 | def with_semantic(self): 14 | """bool: whether the detector has a semantic head""" 15 | return self.roi_head.with_semantic 16 | -------------------------------------------------------------------------------- /code/mmdet/models/detectors/gfl.py: -------------------------------------------------------------------------------- 1 | from ..builder import DETECTORS 2 | from .single_stage import SingleStageDetector 3 | 4 | 5 | @DETECTORS.register_module() 6 | class GFL(SingleStageDetector): 7 | 8 | def __init__(self, 9 | backbone, 10 | neck, 11 | bbox_head, 12 | train_cfg=None, 13 | test_cfg=None, 14 | pretrained=None): 15 | super(GFL, self).__init__(backbone, neck, bbox_head, train_cfg, 16 | test_cfg, pretrained) 17 | -------------------------------------------------------------------------------- /code/mmdet/apis/__init__.py: -------------------------------------------------------------------------------- 1 | from .inference import (async_inference_detector, inference_detector, 2 | init_detector, show_result_pyplot, adaptive_inference_detector) 3 | from .test import multi_gpu_test, single_gpu_test 4 | from .train import get_root_logger, set_random_seed, train_detector 5 | 6 | __all__ = [ 7 | 'get_root_logger', 'set_random_seed', 'train_detector', 'init_detector', 8 | 'async_inference_detector', 'inference_detector', 'show_result_pyplot', 9 | 'multi_gpu_test', 'single_gpu_test', 'adaptive_inference_detector' 10 | ] 11 | -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/bbox_heads/__init__.py: -------------------------------------------------------------------------------- 1 | from .bbox_head import BBoxHead 2 | from .convfc_bbox_head import (ConvFCBBoxHead, Shared2FCBBoxHead, 3 | Shared4Conv1FCBBoxHead) 4 | from .dii_head import DIIHead 5 | from .double_bbox_head import DoubleConvFCBBoxHead 6 | from .sabl_head import SABLHead 7 | from .scnet_bbox_head import SCNetBBoxHead 8 | 9 | __all__ = [ 10 | 'BBoxHead', 'ConvFCBBoxHead', 'Shared2FCBBoxHead', 11 | 'Shared4Conv1FCBBoxHead', 'DoubleConvFCBBoxHead', 'SABLHead', 'DIIHead', 12 | 'SCNetBBoxHead' 13 | ] 14 | -------------------------------------------------------------------------------- /code/mmdet/utils/logger.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | from mmcv.utils import get_logger 4 | 5 | 6 | def get_root_logger(log_file=None, log_level=logging.INFO): 7 | """Get root logger. 8 | 9 | Args: 10 | log_file (str, optional): File path of log. Defaults to None. 11 | log_level (int, optional): The level of logger. 12 | Defaults to logging.INFO. 13 | 14 | Returns: 15 | :obj:`logging.Logger`: The obtained logger 16 | """ 17 | logger = get_logger(name='mmdet', log_file=log_file, log_level=log_level) 18 | 19 | return logger 20 | -------------------------------------------------------------------------------- /code/mmdet/core/anchor/__init__.py: -------------------------------------------------------------------------------- 1 | from .anchor_generator import (AnchorGenerator, LegacyAnchorGenerator, 2 | YOLOAnchorGenerator) 3 | from .builder import ANCHOR_GENERATORS, build_anchor_generator 4 | from .point_generator import PointGenerator 5 | from .utils import anchor_inside_flags, calc_region, images_to_levels 6 | 7 | __all__ = [ 8 | 'AnchorGenerator', 'LegacyAnchorGenerator', 'anchor_inside_flags', 9 | 'PointGenerator', 'images_to_levels', 'calc_region', 10 | 'build_anchor_generator', 'ANCHOR_GENERATORS', 'YOLOAnchorGenerator' 11 | ] 12 | -------------------------------------------------------------------------------- /code/mmdet/core/bbox/coder/base_bbox_coder.py: -------------------------------------------------------------------------------- 1 | from abc import ABCMeta, abstractmethod 2 | 3 | 4 | class BaseBBoxCoder(metaclass=ABCMeta): 5 | """Base bounding box coder.""" 6 | 7 | def __init__(self, **kwargs): 8 | pass 9 | 10 | @abstractmethod 11 | def encode(self, bboxes, gt_bboxes): 12 | """Encode deltas between bboxes and ground truth boxes.""" 13 | pass 14 | 15 | @abstractmethod 16 | def decode(self, bboxes, bboxes_pred): 17 | """Decode the predicted bboxes according to prediction and base 18 | boxes.""" 19 | pass 20 | -------------------------------------------------------------------------------- /code/mmdet/apis/.ipynb_checkpoints/__init__-checkpoint.py: -------------------------------------------------------------------------------- 1 | from .inference import (async_inference_detector, inference_detector, 2 | init_detector, show_result_pyplot, adaptive_inference_detector) 3 | from .test import multi_gpu_test, single_gpu_test 4 | from .train import get_root_logger, set_random_seed, train_detector 5 | 6 | __all__ = [ 7 | 'get_root_logger', 'set_random_seed', 'train_detector', 'init_detector', 8 | 'async_inference_detector', 'inference_detector', 'show_result_pyplot', 9 | 'multi_gpu_test', 'single_gpu_test', 'adaptive_inference_detector' 10 | ] 11 | -------------------------------------------------------------------------------- /code/mmdet/core/bbox/coder/__init__.py: -------------------------------------------------------------------------------- 1 | from .base_bbox_coder import BaseBBoxCoder 2 | from .bucketing_bbox_coder import BucketingBBoxCoder 3 | from .delta_xywh_bbox_coder import DeltaXYWHBBoxCoder 4 | from .legacy_delta_xywh_bbox_coder import LegacyDeltaXYWHBBoxCoder 5 | from .pseudo_bbox_coder import PseudoBBoxCoder 6 | from .tblr_bbox_coder import TBLRBBoxCoder 7 | from .yolo_bbox_coder import YOLOBBoxCoder 8 | 9 | __all__ = [ 10 | 'BaseBBoxCoder', 'PseudoBBoxCoder', 'DeltaXYWHBBoxCoder', 11 | 'LegacyDeltaXYWHBBoxCoder', 'TBLRBBoxCoder', 'YOLOBBoxCoder', 12 | 'BucketingBBoxCoder' 13 | ] 14 | -------------------------------------------------------------------------------- /code/mmdet/version.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Open-MMLab. All rights reserved. 2 | 3 | __version__ = '2.10.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 | -------------------------------------------------------------------------------- /code/mmdet/core/bbox/coder/pseudo_bbox_coder.py: -------------------------------------------------------------------------------- 1 | from ..builder import BBOX_CODERS 2 | from .base_bbox_coder import BaseBBoxCoder 3 | 4 | 5 | @BBOX_CODERS.register_module() 6 | class PseudoBBoxCoder(BaseBBoxCoder): 7 | """Pseudo bounding box coder.""" 8 | 9 | def __init__(self, **kwargs): 10 | super(BaseBBoxCoder, self).__init__(**kwargs) 11 | 12 | def encode(self, bboxes, gt_bboxes): 13 | """torch.Tensor: return the given ``bboxes``""" 14 | return gt_bboxes 15 | 16 | def decode(self, bboxes, pred_bboxes): 17 | """torch.Tensor: return the given ``pred_bboxes``""" 18 | return pred_bboxes 19 | -------------------------------------------------------------------------------- /code/mmdet/models/detectors/atss.py: -------------------------------------------------------------------------------- 1 | from ..builder import DETECTORS 2 | from .single_stage import SingleStageDetector 3 | 4 | 5 | @DETECTORS.register_module() 6 | class ATSS(SingleStageDetector): 7 | """Implementation of `ATSS `_.""" 8 | 9 | def __init__(self, 10 | backbone, 11 | neck, 12 | bbox_head, 13 | train_cfg=None, 14 | test_cfg=None, 15 | pretrained=None): 16 | super(ATSS, self).__init__(backbone, neck, bbox_head, train_cfg, 17 | test_cfg, pretrained) 18 | -------------------------------------------------------------------------------- /code/mmdet/models/detectors/fcos.py: -------------------------------------------------------------------------------- 1 | from ..builder import DETECTORS 2 | from .single_stage import SingleStageDetector 3 | 4 | 5 | @DETECTORS.register_module() 6 | class FCOS(SingleStageDetector): 7 | """Implementation of `FCOS `_""" 8 | 9 | def __init__(self, 10 | backbone, 11 | neck, 12 | bbox_head, 13 | train_cfg=None, 14 | test_cfg=None, 15 | pretrained=None): 16 | super(FCOS, self).__init__(backbone, neck, bbox_head, train_cfg, 17 | test_cfg, pretrained) 18 | -------------------------------------------------------------------------------- /code/mmdet/models/detectors/fsaf.py: -------------------------------------------------------------------------------- 1 | from ..builder import DETECTORS 2 | from .single_stage import SingleStageDetector 3 | 4 | 5 | @DETECTORS.register_module() 6 | class FSAF(SingleStageDetector): 7 | """Implementation of `FSAF `_""" 8 | 9 | def __init__(self, 10 | backbone, 11 | neck, 12 | bbox_head, 13 | train_cfg=None, 14 | test_cfg=None, 15 | pretrained=None): 16 | super(FSAF, self).__init__(backbone, neck, bbox_head, train_cfg, 17 | test_cfg, pretrained) 18 | -------------------------------------------------------------------------------- /code/mmdet/models/detectors/paa.py: -------------------------------------------------------------------------------- 1 | from ..builder import DETECTORS 2 | from .single_stage import SingleStageDetector 3 | 4 | 5 | @DETECTORS.register_module() 6 | class PAA(SingleStageDetector): 7 | """Implementation of `PAA `_.""" 8 | 9 | def __init__(self, 10 | backbone, 11 | neck, 12 | bbox_head, 13 | train_cfg=None, 14 | test_cfg=None, 15 | pretrained=None): 16 | super(PAA, self).__init__(backbone, neck, bbox_head, train_cfg, 17 | test_cfg, pretrained) 18 | -------------------------------------------------------------------------------- /code/mmdet/models/detectors/fovea.py: -------------------------------------------------------------------------------- 1 | from ..builder import DETECTORS 2 | from .single_stage import SingleStageDetector 3 | 4 | 5 | @DETECTORS.register_module() 6 | class FOVEA(SingleStageDetector): 7 | """Implementation of `FoveaBox `_""" 8 | 9 | def __init__(self, 10 | backbone, 11 | neck, 12 | bbox_head, 13 | train_cfg=None, 14 | test_cfg=None, 15 | pretrained=None): 16 | super(FOVEA, self).__init__(backbone, neck, bbox_head, train_cfg, 17 | test_cfg, pretrained) 18 | -------------------------------------------------------------------------------- /code/mmdet/models/detectors/yolo.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019 Western Digital Corporation or its affiliates. 2 | 3 | from ..builder import DETECTORS 4 | from .single_stage import SingleStageDetector 5 | 6 | 7 | @DETECTORS.register_module() 8 | class YOLOV3(SingleStageDetector): 9 | 10 | def __init__(self, 11 | backbone, 12 | neck, 13 | bbox_head, 14 | train_cfg=None, 15 | test_cfg=None, 16 | pretrained=None): 17 | super(YOLOV3, self).__init__(backbone, neck, bbox_head, train_cfg, 18 | test_cfg, pretrained) 19 | -------------------------------------------------------------------------------- /code/mmdet/models/detectors/retinanet.py: -------------------------------------------------------------------------------- 1 | from ..builder import DETECTORS 2 | from .single_stage import SingleStageDetector 3 | 4 | 5 | @DETECTORS.register_module() 6 | class RetinaNet(SingleStageDetector): 7 | """Implementation of `RetinaNet `_""" 8 | 9 | def __init__(self, 10 | backbone, 11 | neck, 12 | bbox_head, 13 | train_cfg=None, 14 | test_cfg=None, 15 | pretrained=None): 16 | super(RetinaNet, self).__init__(backbone, neck, bbox_head, train_cfg, 17 | test_cfg, pretrained) 18 | -------------------------------------------------------------------------------- /code/mmdet/models/detectors/.ipynb_checkpoints/atss-checkpoint.py: -------------------------------------------------------------------------------- 1 | from ..builder import DETECTORS 2 | from .single_stage import SingleStageDetector 3 | 4 | 5 | @DETECTORS.register_module() 6 | class ATSS(SingleStageDetector): 7 | """Implementation of `ATSS `_.""" 8 | 9 | def __init__(self, 10 | backbone, 11 | neck, 12 | bbox_head, 13 | train_cfg=None, 14 | test_cfg=None, 15 | pretrained=None): 16 | super(ATSS, self).__init__(backbone, neck, bbox_head, train_cfg, 17 | test_cfg, pretrained) 18 | -------------------------------------------------------------------------------- /code/mmdet/models/detectors/vfnet.py: -------------------------------------------------------------------------------- 1 | from ..builder import DETECTORS 2 | from .single_stage import SingleStageDetector 3 | 4 | 5 | @DETECTORS.register_module() 6 | class VFNet(SingleStageDetector): 7 | """Implementation of `VarifocalNet 8 | (VFNet).`_""" 9 | 10 | def __init__(self, 11 | backbone, 12 | neck, 13 | bbox_head, 14 | train_cfg=None, 15 | test_cfg=None, 16 | pretrained=None): 17 | super(VFNet, self).__init__(backbone, neck, bbox_head, train_cfg, 18 | test_cfg, pretrained) 19 | -------------------------------------------------------------------------------- /train.sh: -------------------------------------------------------------------------------- 1 | #echo "开始下载coco模型权重" 2 | #cd /data/code 3 | #sh download_weight.sh 4 | #sleep 1 5 | #echo "coco权重下载完成" 6 | 7 | echo "开始训练第一个模型" 8 | cd /data/code 9 | sh train_model1.sh 10 | sleep 1 11 | 12 | echo "开始训练第二个模型" 13 | cd /data/code 14 | sh train_model2.sh 15 | sleep 1 16 | 17 | echo "开始训练第三个模型" 18 | cd /data/code 19 | sh train_model3.sh 20 | sleep 1 21 | 22 | echo "开始训练第四个模型" 23 | cd /data/code 24 | sh train_model4.sh 25 | sleep 1 26 | 27 | echo "开始训练第五个模型" 28 | cd /data/code 29 | sh train_model5.sh 30 | sleep 1 31 | 32 | echo "开始训练第六个模型" 33 | cd /data/code 34 | sh train_model6.sh 35 | sleep 1 36 | 37 | echo "开始训练第七个模型" 38 | cd /data/code 39 | sh train_model7.sh 40 | -------------------------------------------------------------------------------- /code/mmdet/core/bbox/builder.py: -------------------------------------------------------------------------------- 1 | from mmcv.utils import Registry, build_from_cfg 2 | 3 | BBOX_ASSIGNERS = Registry('bbox_assigner') 4 | BBOX_SAMPLERS = Registry('bbox_sampler') 5 | BBOX_CODERS = Registry('bbox_coder') 6 | 7 | 8 | def build_assigner(cfg, **default_args): 9 | """Builder of box assigner.""" 10 | return build_from_cfg(cfg, BBOX_ASSIGNERS, default_args) 11 | 12 | 13 | def build_sampler(cfg, **default_args): 14 | """Builder of box sampler.""" 15 | return build_from_cfg(cfg, BBOX_SAMPLERS, default_args) 16 | 17 | 18 | def build_bbox_coder(cfg, **default_args): 19 | """Builder of box coder.""" 20 | return build_from_cfg(cfg, BBOX_CODERS, default_args) 21 | -------------------------------------------------------------------------------- /code/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 | -------------------------------------------------------------------------------- /code/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 | -------------------------------------------------------------------------------- /code/mmdet/models/detectors/.ipynb_checkpoints/vfnet-checkpoint.py: -------------------------------------------------------------------------------- 1 | from ..builder import DETECTORS 2 | from .single_stage import SingleStageDetector 3 | 4 | 5 | @DETECTORS.register_module() 6 | class VFNet(SingleStageDetector): 7 | """Implementation of `VarifocalNet 8 | (VFNet).`_""" 9 | 10 | def __init__(self, 11 | backbone, 12 | neck, 13 | bbox_head, 14 | train_cfg=None, 15 | test_cfg=None, 16 | pretrained=None): 17 | super(VFNet, self).__init__(backbone, neck, bbox_head, train_cfg, 18 | test_cfg, pretrained) 19 | -------------------------------------------------------------------------------- /code/mmdet/models/detectors/nasfcos.py: -------------------------------------------------------------------------------- 1 | from ..builder import DETECTORS 2 | from .single_stage import SingleStageDetector 3 | 4 | 5 | @DETECTORS.register_module() 6 | class NASFCOS(SingleStageDetector): 7 | """NAS-FCOS: Fast Neural Architecture Search for Object Detection. 8 | 9 | https://arxiv.org/abs/1906.0442 10 | """ 11 | 12 | def __init__(self, 13 | backbone, 14 | neck, 15 | bbox_head, 16 | train_cfg=None, 17 | test_cfg=None, 18 | pretrained=None): 19 | super(NASFCOS, self).__init__(backbone, neck, bbox_head, train_cfg, 20 | test_cfg, pretrained) 21 | -------------------------------------------------------------------------------- /code/mmdet/core/bbox/.ipynb_checkpoints/builder-checkpoint.py: -------------------------------------------------------------------------------- 1 | from mmcv.utils import Registry, build_from_cfg 2 | 3 | BBOX_ASSIGNERS = Registry('bbox_assigner') 4 | BBOX_SAMPLERS = Registry('bbox_sampler') 5 | BBOX_CODERS = Registry('bbox_coder') 6 | 7 | 8 | def build_assigner(cfg, **default_args): 9 | """Builder of box assigner.""" 10 | return build_from_cfg(cfg, BBOX_ASSIGNERS, default_args) 11 | 12 | 13 | def build_sampler(cfg, **default_args): 14 | """Builder of box sampler.""" 15 | return build_from_cfg(cfg, BBOX_SAMPLERS, default_args) 16 | 17 | 18 | def build_bbox_coder(cfg, **default_args): 19 | """Builder of box coder.""" 20 | return build_from_cfg(cfg, BBOX_CODERS, default_args) 21 | -------------------------------------------------------------------------------- /code/tools/.ipynb_checkpoints/slurm_test-checkpoint.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 | -------------------------------------------------------------------------------- /code/mmdet/core/bbox/samplers/__init__.py: -------------------------------------------------------------------------------- 1 | from .base_sampler import BaseSampler 2 | from .combined_sampler import CombinedSampler 3 | from .instance_balanced_pos_sampler import InstanceBalancedPosSampler 4 | from .iou_balanced_neg_sampler import IoUBalancedNegSampler 5 | from .ohem_sampler import OHEMSampler 6 | from .pseudo_sampler import PseudoSampler 7 | from .random_sampler import RandomSampler 8 | from .sampling_result import SamplingResult 9 | from .score_hlr_sampler import ScoreHLRSampler 10 | 11 | __all__ = [ 12 | 'BaseSampler', 'PseudoSampler', 'RandomSampler', 13 | 'InstanceBalancedPosSampler', 'IoUBalancedNegSampler', 'CombinedSampler', 14 | 'OHEMSampler', 'SamplingResult', 'ScoreHLRSampler' 15 | ] 16 | -------------------------------------------------------------------------------- /code/mmdet/models/necks/__init__.py: -------------------------------------------------------------------------------- 1 | from .bfp import BFP 2 | from .channel_mapper import ChannelMapper 3 | from .fpg import FPG 4 | from .fpn import FPN 5 | from .fpn_carafe import FPN_CARAFE 6 | from .hrfpn import HRFPN 7 | from .nas_fpn import NASFPN 8 | from .nasfcos_fpn import NASFCOS_FPN 9 | from .pafpn import PAFPN 10 | from .rfp import RFP, RFP_CARAFE, RFP_ACFPN 11 | from .yolo_neck import YOLOV3Neck 12 | from .ssd_neck import SSDNECK 13 | from .ssd_neck import SSDNECK512 14 | from .acfpn import ACFPN 15 | 16 | __all__ = [ 17 | 'FPN', 'BFP', 'ChannelMapper', 'HRFPN', 'NASFPN', 'FPN_CARAFE', 'PAFPN', 18 | 'NASFCOS_FPN', 'RFP', 'YOLOV3Neck', 'FPG', 'SSDNECK', 'SSDNECK512', 'ACFPN', 19 | 'RFP_CARAFE', 'RFP_ACFPN' 20 | ] 21 | -------------------------------------------------------------------------------- /code/mmdet/core/bbox/assigners/__init__.py: -------------------------------------------------------------------------------- 1 | from .approx_max_iou_assigner import ApproxMaxIoUAssigner 2 | from .assign_result import AssignResult 3 | from .atss_assigner import ATSSAssigner 4 | from .base_assigner import BaseAssigner 5 | from .center_region_assigner import CenterRegionAssigner 6 | from .grid_assigner import GridAssigner 7 | from .hungarian_assigner import HungarianAssigner 8 | from .max_iou_assigner import MaxIoUAssigner 9 | from .point_assigner import PointAssigner 10 | from .region_assigner import RegionAssigner 11 | 12 | __all__ = [ 13 | 'BaseAssigner', 'MaxIoUAssigner', 'ApproxMaxIoUAssigner', 'AssignResult', 14 | 'PointAssigner', 'ATSSAssigner', 'CenterRegionAssigner', 'GridAssigner', 15 | 'HungarianAssigner', 'RegionAssigner' 16 | ] 17 | -------------------------------------------------------------------------------- /code/mmdet/models/necks/.ipynb_checkpoints/__init__-checkpoint.py: -------------------------------------------------------------------------------- 1 | from .bfp import BFP 2 | from .channel_mapper import ChannelMapper 3 | from .fpg import FPG 4 | from .fpn import FPN 5 | from .fpn_carafe import FPN_CARAFE 6 | from .hrfpn import HRFPN 7 | from .nas_fpn import NASFPN 8 | from .nasfcos_fpn import NASFCOS_FPN 9 | from .pafpn import PAFPN 10 | from .rfp import RFP, RFP_CARAFE, RFP_ACFPN 11 | from .yolo_neck import YOLOV3Neck 12 | from .ssd_neck import SSDNECK 13 | from .ssd_neck import SSDNECK512 14 | from .acfpn import ACFPN 15 | 16 | __all__ = [ 17 | 'FPN', 'BFP', 'ChannelMapper', 'HRFPN', 'NASFPN', 'FPN_CARAFE', 'PAFPN', 18 | 'NASFCOS_FPN', 'RFP', 'YOLOV3Neck', 'FPG', 'SSDNECK', 'SSDNECK512', 'ACFPN', 19 | 'RFP_CARAFE', 'RFP_ACFPN' 20 | ] 21 | -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/mask_heads/__init__.py: -------------------------------------------------------------------------------- 1 | from .coarse_mask_head import CoarseMaskHead 2 | from .fcn_mask_head import FCNMaskHead 3 | from .feature_relay_head import FeatureRelayHead 4 | from .fused_semantic_head import FusedSemanticHead 5 | from .global_context_head import GlobalContextHead 6 | from .grid_head import GridHead 7 | from .htc_mask_head import HTCMaskHead 8 | from .mask_point_head import MaskPointHead 9 | from .maskiou_head import MaskIoUHead 10 | from .scnet_mask_head import SCNetMaskHead 11 | from .scnet_semantic_head import SCNetSemanticHead 12 | 13 | __all__ = [ 14 | 'FCNMaskHead', 'HTCMaskHead', 'FusedSemanticHead', 'GridHead', 15 | 'MaskIoUHead', 'CoarseMaskHead', 'MaskPointHead', 'SCNetMaskHead', 16 | 'SCNetSemanticHead', 'GlobalContextHead', 'FeatureRelayHead' 17 | ] 18 | -------------------------------------------------------------------------------- /code/mmdet/core/bbox/samplers/combined_sampler.py: -------------------------------------------------------------------------------- 1 | from ..builder import BBOX_SAMPLERS, build_sampler 2 | from .base_sampler import BaseSampler 3 | 4 | 5 | @BBOX_SAMPLERS.register_module() 6 | class CombinedSampler(BaseSampler): 7 | """A sampler that combines positive sampler and negative sampler.""" 8 | 9 | def __init__(self, pos_sampler, neg_sampler, **kwargs): 10 | super(CombinedSampler, self).__init__(**kwargs) 11 | self.pos_sampler = build_sampler(pos_sampler, **kwargs) 12 | self.neg_sampler = build_sampler(neg_sampler, **kwargs) 13 | 14 | def _sample_pos(self, **kwargs): 15 | """Sample positive samples.""" 16 | raise NotImplementedError 17 | 18 | def _sample_neg(self, **kwargs): 19 | """Sample negative samples.""" 20 | raise NotImplementedError 21 | -------------------------------------------------------------------------------- /code/mmdet/models/detectors/mask_rcnn.py: -------------------------------------------------------------------------------- 1 | from ..builder import DETECTORS 2 | from .two_stage import TwoStageDetector 3 | 4 | 5 | @DETECTORS.register_module() 6 | class MaskRCNN(TwoStageDetector): 7 | """Implementation of `Mask R-CNN `_""" 8 | 9 | def __init__(self, 10 | backbone, 11 | rpn_head, 12 | roi_head, 13 | train_cfg, 14 | test_cfg, 15 | neck=None, 16 | pretrained=None): 17 | super(MaskRCNN, self).__init__( 18 | backbone=backbone, 19 | neck=neck, 20 | rpn_head=rpn_head, 21 | roi_head=roi_head, 22 | train_cfg=train_cfg, 23 | test_cfg=test_cfg, 24 | pretrained=pretrained) 25 | -------------------------------------------------------------------------------- /code/mmdet/models/detectors/reppoints_detector.py: -------------------------------------------------------------------------------- 1 | from ..builder import DETECTORS 2 | from .single_stage import SingleStageDetector 3 | 4 | 5 | @DETECTORS.register_module() 6 | class RepPointsDetector(SingleStageDetector): 7 | """RepPoints: Point Set Representation for Object Detection. 8 | 9 | This detector is the implementation of: 10 | - RepPoints detector (https://arxiv.org/pdf/1904.11490) 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 | super(RepPointsDetector, 21 | self).__init__(backbone, neck, bbox_head, train_cfg, test_cfg, 22 | pretrained) 23 | -------------------------------------------------------------------------------- /code/mmdet/models/detectors/faster_rcnn.py: -------------------------------------------------------------------------------- 1 | from ..builder import DETECTORS 2 | from .two_stage import TwoStageDetector 3 | 4 | 5 | @DETECTORS.register_module() 6 | class FasterRCNN(TwoStageDetector): 7 | """Implementation of `Faster R-CNN `_""" 8 | 9 | def __init__(self, 10 | backbone, 11 | rpn_head, 12 | roi_head, 13 | train_cfg, 14 | test_cfg, 15 | neck=None, 16 | pretrained=None): 17 | super(FasterRCNN, self).__init__( 18 | backbone=backbone, 19 | neck=neck, 20 | rpn_head=rpn_head, 21 | roi_head=roi_head, 22 | train_cfg=train_cfg, 23 | test_cfg=test_cfg, 24 | pretrained=pretrained) 25 | -------------------------------------------------------------------------------- /code/mmdet/models/__init__.py: -------------------------------------------------------------------------------- 1 | from .backbones import * # noqa: F401,F403 2 | from .builder import (BACKBONES, DETECTORS, HEADS, LOSSES, NECKS, 3 | ROI_EXTRACTORS, SHARED_HEADS, build_backbone, 4 | build_detector, build_head, build_loss, build_neck, 5 | build_roi_extractor, build_shared_head) 6 | from .dense_heads import * # noqa: F401,F403 7 | from .detectors import * # noqa: F401,F403 8 | from .losses import * # noqa: F401,F403 9 | from .necks import * # noqa: F401,F403 10 | from .roi_heads import * # noqa: F401,F403 11 | 12 | __all__ = [ 13 | 'BACKBONES', 'NECKS', 'ROI_EXTRACTORS', 'SHARED_HEADS', 'HEADS', 'LOSSES', 14 | 'DETECTORS', 'build_backbone', 'build_neck', 'build_roi_extractor', 15 | 'build_shared_head', 'build_head', 'build_loss', 'build_detector' 16 | ] 17 | -------------------------------------------------------------------------------- /code/mmdet/models/detectors/mask_scoring_rcnn.py: -------------------------------------------------------------------------------- 1 | from ..builder import DETECTORS 2 | from .two_stage import TwoStageDetector 3 | 4 | 5 | @DETECTORS.register_module() 6 | class MaskScoringRCNN(TwoStageDetector): 7 | """Mask Scoring RCNN. 8 | 9 | https://arxiv.org/abs/1903.00241 10 | """ 11 | 12 | def __init__(self, 13 | backbone, 14 | rpn_head, 15 | roi_head, 16 | train_cfg, 17 | test_cfg, 18 | neck=None, 19 | pretrained=None): 20 | super(MaskScoringRCNN, self).__init__( 21 | backbone=backbone, 22 | neck=neck, 23 | rpn_head=rpn_head, 24 | roi_head=roi_head, 25 | train_cfg=train_cfg, 26 | test_cfg=test_cfg, 27 | pretrained=pretrained) 28 | -------------------------------------------------------------------------------- /code/mmdet/models/.ipynb_checkpoints/__init__-checkpoint.py: -------------------------------------------------------------------------------- 1 | from .backbones import * # noqa: F401,F403 2 | from .builder import (BACKBONES, DETECTORS, HEADS, LOSSES, NECKS, 3 | ROI_EXTRACTORS, SHARED_HEADS, build_backbone, 4 | build_detector, build_head, build_loss, build_neck, 5 | build_roi_extractor, build_shared_head) 6 | from .dense_heads import * # noqa: F401,F403 7 | from .detectors import * # noqa: F401,F403 8 | from .losses import * # noqa: F401,F403 9 | from .necks import * # noqa: F401,F403 10 | from .roi_heads import * # noqa: F401,F403 11 | 12 | __all__ = [ 13 | 'BACKBONES', 'NECKS', 'ROI_EXTRACTORS', 'SHARED_HEADS', 'HEADS', 'LOSSES', 14 | 'DETECTORS', 'build_backbone', 'build_neck', 'build_roi_extractor', 15 | 'build_shared_head', 'build_head', 'build_loss', 'build_detector' 16 | ] 17 | -------------------------------------------------------------------------------- /code/mmdet/models/detectors/point_rend.py: -------------------------------------------------------------------------------- 1 | from ..builder import DETECTORS 2 | from .two_stage import TwoStageDetector 3 | 4 | 5 | @DETECTORS.register_module() 6 | class PointRend(TwoStageDetector): 7 | """PointRend: Image Segmentation as Rendering 8 | 9 | This detector is the implementation of 10 | `PointRend `_. 11 | 12 | """ 13 | 14 | def __init__(self, 15 | backbone, 16 | rpn_head, 17 | roi_head, 18 | train_cfg, 19 | test_cfg, 20 | neck=None, 21 | pretrained=None): 22 | super(PointRend, 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 | -------------------------------------------------------------------------------- /code/mmdet/models/detectors/grid_rcnn.py: -------------------------------------------------------------------------------- 1 | from ..builder import DETECTORS 2 | from .two_stage import TwoStageDetector 3 | 4 | 5 | @DETECTORS.register_module() 6 | class GridRCNN(TwoStageDetector): 7 | """Grid R-CNN. 8 | 9 | This detector is the implementation of: 10 | - Grid R-CNN (https://arxiv.org/abs/1811.12030) 11 | - Grid R-CNN Plus: Faster and Better (https://arxiv.org/abs/1906.05688) 12 | """ 13 | 14 | def __init__(self, 15 | backbone, 16 | rpn_head, 17 | roi_head, 18 | train_cfg, 19 | test_cfg, 20 | neck=None, 21 | pretrained=None): 22 | super(GridRCNN, 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 | -------------------------------------------------------------------------------- /code/mmdet/models/backbones/__init__.py: -------------------------------------------------------------------------------- 1 | from .darknet import Darknet 2 | from .detectors_resnet import DetectoRS_ResNet, DetectoRS_ResNetV1d 3 | from .detectors_resnext import DetectoRS_ResNeXt 4 | from .hourglass import HourglassNet 5 | from .hrnet import HRNet 6 | from .regnet import RegNet 7 | from .res2net import Res2Net 8 | from .resnest import ResNeSt 9 | from .resnet import ResNet, ResNetV1d 10 | from .resnext import ResNeXt 11 | from .ssd_vgg import SSDVGG 12 | from .trident_resnet import TridentResNet 13 | from .ssd_res50 import SSDRES 14 | from .vgg import VGG 15 | from .detectors_resnest import DetectoRS_ResNeSt 16 | from .swin_transformer import SwinTransformer 17 | 18 | __all__ = [ 19 | 'RegNet', 'ResNet', 'ResNetV1d', 'ResNeXt', 'SSDVGG', 'HRNet', 'Res2Net', 20 | 'HourglassNet', 'DetectoRS_ResNet', 'DetectoRS_ResNeXt', 'Darknet', 21 | 'ResNeSt', 'TridentResNet', 'SSDRES', 'VGG', 'DetectoRS_ResNeSt', 'DetectoRS_ResNetV1d', 22 | 'SwinTransformer' 23 | ] 24 | -------------------------------------------------------------------------------- /code/mmdet/models/utils/__init__.py: -------------------------------------------------------------------------------- 1 | from .builder import build_positional_encoding, build_transformer 2 | from .gaussian_target import gaussian_radius, gen_gaussian_target 3 | from .positional_encoding import (LearnedPositionalEncoding, 4 | SinePositionalEncoding) 5 | from .res_layer import ResLayer, SimplifiedBasicBlock 6 | from .transformer import (FFN, DynamicConv, MultiheadAttention, Transformer, 7 | TransformerDecoder, TransformerDecoderLayer, 8 | TransformerEncoder, TransformerEncoderLayer) 9 | 10 | __all__ = [ 11 | 'ResLayer', 'gaussian_radius', 'gen_gaussian_target', 'MultiheadAttention', 12 | 'FFN', 'TransformerEncoderLayer', 'TransformerEncoder', 13 | 'TransformerDecoderLayer', 'TransformerDecoder', 'Transformer', 14 | 'build_transformer', 'build_positional_encoding', 'SinePositionalEncoding', 15 | 'LearnedPositionalEncoding', 'DynamicConv', 'SimplifiedBasicBlock' 16 | ] 17 | -------------------------------------------------------------------------------- /code/mmdet/__init__.py: -------------------------------------------------------------------------------- 1 | import mmcv 2 | 3 | from .version import __version__, short_version 4 | 5 | 6 | def digit_version(version_str): 7 | digit_version = [] 8 | for x in version_str.split('.'): 9 | if x.isdigit(): 10 | digit_version.append(int(x)) 11 | elif x.find('rc') != -1: 12 | patch_version = x.split('rc') 13 | digit_version.append(int(patch_version[0]) - 1) 14 | digit_version.append(int(patch_version[1])) 15 | return digit_version 16 | 17 | 18 | mmcv_minimum_version = '1.2.4' 19 | mmcv_maximum_version = '1.3' 20 | mmcv_version = digit_version(mmcv.__version__) 21 | 22 | 23 | assert (mmcv_version >= digit_version(mmcv_minimum_version) 24 | and mmcv_version <= digit_version(mmcv_maximum_version)), \ 25 | f'MMCV=={mmcv.__version__} is used but incompatible. ' \ 26 | f'Please install mmcv>={mmcv_minimum_version}, <={mmcv_maximum_version}.' 27 | 28 | __all__ = ['__version__', 'short_version'] 29 | -------------------------------------------------------------------------------- /code/mmdet/core/evaluation/__init__.py: -------------------------------------------------------------------------------- 1 | from .class_names import (cityscapes_classes, coco_classes, dataset_aliases, 2 | get_classes, imagenet_det_classes, road_classes, 3 | imagenet_vid_classes, voc_classes) 4 | from .eval_hooks import DistEvalHook, EvalHook 5 | from .mean_ap import average_precision, eval_map, print_map_summary 6 | from .recall import (eval_recalls, plot_iou_recall, plot_num_recall, 7 | print_recall_summary) 8 | from .coco_utils import coco_eval, fast_eval_recall, results2json 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', 'road_classes', 16 | 'coco_eval', 'fast_eval_recall', 'results2json' 17 | ] 18 | -------------------------------------------------------------------------------- /code/mmdet/models/backbones/.ipynb_checkpoints/__init__-checkpoint.py: -------------------------------------------------------------------------------- 1 | from .darknet import Darknet 2 | from .detectors_resnet import DetectoRS_ResNet, DetectoRS_ResNetV1d 3 | from .detectors_resnext import DetectoRS_ResNeXt 4 | from .hourglass import HourglassNet 5 | from .hrnet import HRNet 6 | from .regnet import RegNet 7 | from .res2net import Res2Net 8 | from .resnest import ResNeSt 9 | from .resnet import ResNet, ResNetV1d 10 | from .resnext import ResNeXt 11 | from .ssd_vgg import SSDVGG 12 | from .trident_resnet import TridentResNet 13 | from .ssd_res50 import SSDRES 14 | from .vgg import VGG 15 | from .detectors_resnest import DetectoRS_ResNeSt 16 | from .swin_transformer import SwinTransformer 17 | 18 | __all__ = [ 19 | 'RegNet', 'ResNet', 'ResNetV1d', 'ResNeXt', 'SSDVGG', 'HRNet', 'Res2Net', 20 | 'HourglassNet', 'DetectoRS_ResNet', 'DetectoRS_ResNeXt', 'Darknet', 21 | 'ResNeSt', 'TridentResNet', 'SSDRES', 'VGG', 'DetectoRS_ResNeSt', 'DetectoRS_ResNetV1d', 22 | 'SwinTransformer' 23 | ] 24 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # FROM registry.cn-shanghai.aliyuncs.com/tcc-public/pytorch:1.4-cuda10.1-py3 2 | ARG PYTORCH="1.6.0" 3 | ARG CUDA="10.1" 4 | ARG CUDNN="7" 5 | 6 | FROM pytorch/pytorch:${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel 7 | 8 | ENV TORCH_CUDA_ARCH_LIST="6.0 6.1 7.0+PTX" 9 | ENV TORCH_NVCC_FLAGS="-Xfatbin -compress-all" 10 | ENV CMAKE_PREFIX_PATH="$(dirname $(which conda))/../" 11 | 12 | RUN apt-get update && apt-get install -y ffmpeg libsm6 libxext6 git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 \ 13 | && apt-get clean \ 14 | && rm -rf /var/lib/apt/lists/* 15 | 16 | # Install MMCV 17 | RUN pip install mmcv-full==1.2.4 -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.6.0/index.html 18 | 19 | ## 把当前文件夹里的文件构建到镜像的/data下 20 | ADD . /data 21 | 22 | # Install MMDetection 23 | RUN conda clean --all 24 | WORKDIR /data 25 | ENV FORCE_CUDA="1" 26 | RUN pip install -r /data/code/requirements/build.txt 27 | RUN pip install --no-cache-dir -e /data/code 28 | 29 | # 镜像启动入口 30 | CMD /bin/sh /data/run.sh 31 | -------------------------------------------------------------------------------- /code/mmdet/core/evaluation/.ipynb_checkpoints/__init__-checkpoint.py: -------------------------------------------------------------------------------- 1 | from .class_names import (cityscapes_classes, coco_classes, dataset_aliases, 2 | get_classes, imagenet_det_classes, road_classes, 3 | imagenet_vid_classes, voc_classes) 4 | from .eval_hooks import DistEvalHook, EvalHook 5 | from .mean_ap import average_precision, eval_map, print_map_summary 6 | from .recall import (eval_recalls, plot_iou_recall, plot_num_recall, 7 | print_recall_summary) 8 | from .coco_utils import coco_eval, fast_eval_recall, results2json 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', 'road_classes', 16 | 'coco_eval', 'fast_eval_recall', 'results2json' 17 | ] 18 | -------------------------------------------------------------------------------- /code/tools/coco_eval.py: -------------------------------------------------------------------------------- 1 | from argparse import ArgumentParser 2 | 3 | from mmdet.core import coco_eval 4 | 5 | 6 | def main(): 7 | parser = ArgumentParser(description='COCO Evaluation') 8 | parser.add_argument('result', help='result file path') 9 | parser.add_argument('--ann', help='annotation file path') 10 | parser.add_argument( 11 | '--types', 12 | type=str, 13 | nargs='+', 14 | choices=['proposal_fast', 'proposal', 'bbox', 'segm', 'keypoint'], 15 | default=['bbox'], 16 | help='result types') 17 | parser.add_argument( 18 | '--max-dets', 19 | type=int, 20 | nargs='+', 21 | default=[100, 300, 1000], 22 | help='proposal numbers, only used for recall evaluation') 23 | parser.add_argument( 24 | '--classwise', action='store_true', help='whether eval class wise ap') 25 | args = parser.parse_args() 26 | coco_eval(args.result, args.types, args.ann, args.max_dets, args.classwise) 27 | 28 | 29 | if __name__ == '__main__': 30 | main() 31 | -------------------------------------------------------------------------------- /code/tools/.ipynb_checkpoints/coco_eval-checkpoint.py: -------------------------------------------------------------------------------- 1 | from argparse import ArgumentParser 2 | 3 | from mmdet.core import coco_eval 4 | 5 | 6 | def main(): 7 | parser = ArgumentParser(description='COCO Evaluation') 8 | parser.add_argument('result', help='result file path') 9 | parser.add_argument('--ann', help='annotation file path') 10 | parser.add_argument( 11 | '--types', 12 | type=str, 13 | nargs='+', 14 | choices=['proposal_fast', 'proposal', 'bbox', 'segm', 'keypoint'], 15 | default=['bbox'], 16 | help='result types') 17 | parser.add_argument( 18 | '--max-dets', 19 | type=int, 20 | nargs='+', 21 | default=[100, 300, 1000], 22 | help='proposal numbers, only used for recall evaluation') 23 | parser.add_argument( 24 | '--classwise', action='store_true', help='whether eval class wise ap') 25 | args = parser.parse_args() 26 | coco_eval(args.result, args.types, args.ann, args.max_dets, args.classwise) 27 | 28 | 29 | if __name__ == '__main__': 30 | main() 31 | -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/mask_heads/scnet_mask_head.py: -------------------------------------------------------------------------------- 1 | from mmdet.models.builder import HEADS 2 | from mmdet.models.utils import ResLayer, SimplifiedBasicBlock 3 | from .fcn_mask_head import FCNMaskHead 4 | 5 | 6 | @HEADS.register_module() 7 | class SCNetMaskHead(FCNMaskHead): 8 | """Mask head for `SCNet `_. 9 | 10 | Args: 11 | conv_to_res (bool, optional): if True, change the conv layers to 12 | ``SimplifiedBasicBlock``. 13 | """ 14 | 15 | def __init__(self, conv_to_res=True, **kwargs): 16 | super(SCNetMaskHead, self).__init__(**kwargs) 17 | self.conv_to_res = conv_to_res 18 | if conv_to_res: 19 | assert self.conv_kernel_size == 3 20 | self.num_res_blocks = self.num_convs // 2 21 | self.convs = ResLayer( 22 | SimplifiedBasicBlock, 23 | self.in_channels, 24 | self.conv_out_channels, 25 | self.num_res_blocks, 26 | conv_cfg=self.conv_cfg, 27 | norm_cfg=self.norm_cfg) 28 | -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/mask_heads/scnet_semantic_head.py: -------------------------------------------------------------------------------- 1 | from mmdet.models.builder import HEADS 2 | from mmdet.models.utils import ResLayer, SimplifiedBasicBlock 3 | from .fused_semantic_head import FusedSemanticHead 4 | 5 | 6 | @HEADS.register_module() 7 | class SCNetSemanticHead(FusedSemanticHead): 8 | """Mask head for `SCNet `_. 9 | 10 | Args: 11 | conv_to_res (bool, optional): if True, change the conv layers to 12 | ``SimplifiedBasicBlock``. 13 | """ 14 | 15 | def __init__(self, conv_to_res=True, **kwargs): 16 | super(SCNetSemanticHead, self).__init__(**kwargs) 17 | self.conv_to_res = conv_to_res 18 | if self.conv_to_res: 19 | num_res_blocks = self.num_convs // 2 20 | self.convs = ResLayer( 21 | SimplifiedBasicBlock, 22 | self.in_channels, 23 | self.conv_out_channels, 24 | num_res_blocks, 25 | conv_cfg=self.conv_cfg, 26 | norm_cfg=self.norm_cfg) 27 | self.num_convs = num_res_blocks 28 | -------------------------------------------------------------------------------- /code/mmdet/utils/util_random.py: -------------------------------------------------------------------------------- 1 | """Helpers for random number generators.""" 2 | import numpy as np 3 | 4 | 5 | def ensure_rng(rng=None): 6 | """Coerces input into a random number generator. 7 | 8 | If the input is None, then a global random state is returned. 9 | 10 | If the input is a numeric value, then that is used as a seed to construct a 11 | random state. Otherwise the input is returned as-is. 12 | 13 | Adapted from [1]_. 14 | 15 | Args: 16 | rng (int | numpy.random.RandomState | None): 17 | if None, then defaults to the global rng. Otherwise this can be an 18 | integer or a RandomState class 19 | Returns: 20 | (numpy.random.RandomState) : rng - 21 | a numpy random number generator 22 | 23 | References: 24 | .. [1] https://gitlab.kitware.com/computer-vision/kwarray/blob/master/kwarray/util_random.py#L270 # noqa: E501 25 | """ 26 | 27 | if rng is None: 28 | rng = np.random.mtrand._rand 29 | elif isinstance(rng, int): 30 | rng = np.random.RandomState(rng) 31 | else: 32 | rng = rng 33 | return rng 34 | -------------------------------------------------------------------------------- /code/tools/publish_model.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import subprocess 3 | 4 | import torch 5 | 6 | 7 | def parse_args(): 8 | parser = argparse.ArgumentParser( 9 | description='Process a checkpoint to be published') 10 | parser.add_argument('in_file', help='input checkpoint filename') 11 | parser.add_argument('out_file', help='output checkpoint filename') 12 | args = parser.parse_args() 13 | return args 14 | 15 | 16 | def process_checkpoint(in_file, out_file): 17 | checkpoint = torch.load(in_file, map_location='cpu') 18 | # remove optimizer for smaller file size 19 | if 'optimizer' in checkpoint: 20 | del checkpoint['optimizer'] 21 | # if it is necessary to remove some sensitive data in checkpoint['meta'], 22 | # add the code here. 23 | torch.save(checkpoint, out_file) 24 | sha = subprocess.check_output(['sha256sum', out_file]).decode() 25 | final_file = out_file.rstrip('.pth') + '-{}.pth'.format(sha[:8]) 26 | subprocess.Popen(['mv', out_file, final_file]) 27 | 28 | 29 | def main(): 30 | args = parse_args() 31 | process_checkpoint(args.in_file, args.out_file) 32 | 33 | 34 | if __name__ == '__main__': 35 | main() 36 | -------------------------------------------------------------------------------- /code/tools/.ipynb_checkpoints/publish_model-checkpoint.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import subprocess 3 | 4 | import torch 5 | 6 | 7 | def parse_args(): 8 | parser = argparse.ArgumentParser( 9 | description='Process a checkpoint to be published') 10 | parser.add_argument('in_file', help='input checkpoint filename') 11 | parser.add_argument('out_file', help='output checkpoint filename') 12 | args = parser.parse_args() 13 | return args 14 | 15 | 16 | def process_checkpoint(in_file, out_file): 17 | checkpoint = torch.load(in_file, map_location='cpu') 18 | # remove optimizer for smaller file size 19 | if 'optimizer' in checkpoint: 20 | del checkpoint['optimizer'] 21 | # if it is necessary to remove some sensitive data in checkpoint['meta'], 22 | # add the code here. 23 | torch.save(checkpoint, out_file) 24 | sha = subprocess.check_output(['sha256sum', out_file]).decode() 25 | final_file = out_file.rstrip('.pth') + '-{}.pth'.format(sha[:8]) 26 | subprocess.Popen(['mv', out_file, final_file]) 27 | 28 | 29 | def main(): 30 | args = parse_args() 31 | process_checkpoint(args.in_file, args.out_file) 32 | 33 | 34 | if __name__ == '__main__': 35 | main() 36 | -------------------------------------------------------------------------------- /code/tools/model_converters/publish_model.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import subprocess 3 | 4 | import torch 5 | 6 | 7 | def parse_args(): 8 | parser = argparse.ArgumentParser( 9 | description='Process a checkpoint to be published') 10 | parser.add_argument('in_file', help='input checkpoint filename') 11 | parser.add_argument('out_file', help='output checkpoint filename') 12 | args = parser.parse_args() 13 | return args 14 | 15 | 16 | def process_checkpoint(in_file, out_file): 17 | checkpoint = torch.load(in_file, map_location='cpu') 18 | # remove optimizer for smaller file size 19 | if 'optimizer' in checkpoint: 20 | del checkpoint['optimizer'] 21 | # if it is necessary to remove some sensitive data in checkpoint['meta'], 22 | # add the code here. 23 | torch.save(checkpoint, out_file) 24 | sha = subprocess.check_output(['sha256sum', out_file]).decode() 25 | if out_file.endswith('.pth'): 26 | out_file_name = out_file[:-4] 27 | else: 28 | out_file_name = out_file 29 | final_file = out_file_name + f'-{sha[:8]}.pth' 30 | subprocess.Popen(['mv', out_file, final_file]) 31 | 32 | 33 | def main(): 34 | args = parse_args() 35 | process_checkpoint(args.in_file, args.out_file) 36 | 37 | 38 | if __name__ == '__main__': 39 | main() 40 | -------------------------------------------------------------------------------- /code/mmdet/core/bbox/demodata.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import torch 3 | 4 | from mmdet.utils.util_random import ensure_rng 5 | 6 | 7 | def random_boxes(num=1, scale=1, rng=None): 8 | """Simple version of ``kwimage.Boxes.random`` 9 | 10 | Returns: 11 | Tensor: shape (n, 4) in x1, y1, x2, y2 format. 12 | 13 | References: 14 | https://gitlab.kitware.com/computer-vision/kwimage/blob/master/kwimage/structs/boxes.py#L1390 15 | 16 | Example: 17 | >>> num = 3 18 | >>> scale = 512 19 | >>> rng = 0 20 | >>> boxes = random_boxes(num, scale, rng) 21 | >>> print(boxes) 22 | tensor([[280.9925, 278.9802, 308.6148, 366.1769], 23 | [216.9113, 330.6978, 224.0446, 456.5878], 24 | [405.3632, 196.3221, 493.3953, 270.7942]]) 25 | """ 26 | rng = ensure_rng(rng) 27 | 28 | tlbr = rng.rand(num, 4).astype(np.float32) 29 | 30 | tl_x = np.minimum(tlbr[:, 0], tlbr[:, 2]) 31 | tl_y = np.minimum(tlbr[:, 1], tlbr[:, 3]) 32 | br_x = np.maximum(tlbr[:, 0], tlbr[:, 2]) 33 | br_y = np.maximum(tlbr[:, 1], tlbr[:, 3]) 34 | 35 | tlbr[:, 0] = tl_x * scale 36 | tlbr[:, 1] = tl_y * scale 37 | tlbr[:, 2] = br_x * scale 38 | tlbr[:, 3] = br_y * scale 39 | 40 | boxes = torch.from_numpy(tlbr) 41 | return boxes 42 | -------------------------------------------------------------------------------- /code/mmdet/core/bbox/.ipynb_checkpoints/demodata-checkpoint.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import torch 3 | 4 | from mmdet.utils.util_random import ensure_rng 5 | 6 | 7 | def random_boxes(num=1, scale=1, rng=None): 8 | """Simple version of ``kwimage.Boxes.random`` 9 | 10 | Returns: 11 | Tensor: shape (n, 4) in x1, y1, x2, y2 format. 12 | 13 | References: 14 | https://gitlab.kitware.com/computer-vision/kwimage/blob/master/kwimage/structs/boxes.py#L1390 15 | 16 | Example: 17 | >>> num = 3 18 | >>> scale = 512 19 | >>> rng = 0 20 | >>> boxes = random_boxes(num, scale, rng) 21 | >>> print(boxes) 22 | tensor([[280.9925, 278.9802, 308.6148, 366.1769], 23 | [216.9113, 330.6978, 224.0446, 456.5878], 24 | [405.3632, 196.3221, 493.3953, 270.7942]]) 25 | """ 26 | rng = ensure_rng(rng) 27 | 28 | tlbr = rng.rand(num, 4).astype(np.float32) 29 | 30 | tl_x = np.minimum(tlbr[:, 0], tlbr[:, 2]) 31 | tl_y = np.minimum(tlbr[:, 1], tlbr[:, 3]) 32 | br_x = np.maximum(tlbr[:, 0], tlbr[:, 2]) 33 | br_y = np.maximum(tlbr[:, 1], tlbr[:, 3]) 34 | 35 | tlbr[:, 0] = tl_x * scale 36 | tlbr[:, 1] = tl_y * scale 37 | tlbr[:, 2] = br_x * scale 38 | tlbr[:, 3] = br_y * scale 39 | 40 | boxes = torch.from_numpy(tlbr) 41 | return boxes 42 | -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/double_roi_head.py: -------------------------------------------------------------------------------- 1 | from ..builder import HEADS 2 | from .standard_roi_head import StandardRoIHead 3 | 4 | 5 | @HEADS.register_module() 6 | class DoubleHeadRoIHead(StandardRoIHead): 7 | """RoI head for Double Head RCNN. 8 | 9 | https://arxiv.org/abs/1904.06493 10 | """ 11 | 12 | def __init__(self, reg_roi_scale_factor, **kwargs): 13 | super(DoubleHeadRoIHead, self).__init__(**kwargs) 14 | self.reg_roi_scale_factor = reg_roi_scale_factor 15 | 16 | def _bbox_forward(self, x, rois): 17 | """Box head forward function used in both training and testing time.""" 18 | bbox_cls_feats = self.bbox_roi_extractor( 19 | x[:self.bbox_roi_extractor.num_inputs], rois) 20 | bbox_reg_feats = self.bbox_roi_extractor( 21 | x[:self.bbox_roi_extractor.num_inputs], 22 | rois, 23 | roi_scale_factor=self.reg_roi_scale_factor) 24 | if self.with_shared_head: 25 | bbox_cls_feats = self.shared_head(bbox_cls_feats) 26 | bbox_reg_feats = self.shared_head(bbox_reg_feats) 27 | cls_score, bbox_pred = self.bbox_head(bbox_cls_feats, bbox_reg_feats) 28 | 29 | bbox_results = dict( 30 | cls_score=cls_score, 31 | bbox_pred=bbox_pred, 32 | bbox_feats=bbox_cls_feats) 33 | return bbox_results 34 | -------------------------------------------------------------------------------- /code/download_weight.sh: -------------------------------------------------------------------------------- 1 | echo "开始下载detectors_r50 coco权重!" 2 | wget https://download.openmmlab.com/mmdetection/v2.0/detectors/detectors_htc_r50_1x_coco/detectors_htc_r50_1x_coco-329b1453.pth 3 | sleep 1 4 | 5 | echo "开始下载s101 coco权重!" 6 | wget https://download.openmmlab.com/mmdetection/v2.0/resnest/cascade_mask_rcnn_s101_fpn_syncbn-backbone%2Bhead_mstrain_1x_coco/cascade_mask_rcnn_s101_fpn_syncbn-backbone%2Bhead_mstrain_1x_coco_20201005_113243-42607475.pth 7 | sleep 1 8 | 9 | echo "开始下载r2_101 coco权重!" 10 | wget https://download.openmmlab.com/mmdetection/v2.0/res2net/htc_r2_101_fpn_20e_coco/htc_r2_101_fpn_20e_coco-3a8d2112.pth 11 | sleep 1 12 | 13 | echo "开始下载r101 coco权重!" 14 | wget https://download.openmmlab.com/mmdetection/v2.0/dcn/cascade_mask_rcnn_r101_fpn_dconv_c3-c5_1x_coco/cascade_mask_rcnn_r101_fpn_dconv_c3-c5_1x_coco_20200204-df0c5f10.pth 15 | sleep 1 16 | 17 | echo "开始下载x101_32x4d coco权重!" 18 | wget https://download.openmmlab.com/mmdetection/v2.0/dcn/cascade_mask_rcnn_x101_32x4d_fpn_dconv_c3-c5_1x_coco/cascade_mask_rcnn_x101_32x4d_fpn_dconv_c3-c5_1x_coco-e75f90c8.pth 19 | sleep 1 20 | 21 | echo "开始下载swin_small coco权重!" 22 | wget https://github.com/SwinTransformer/storage/releases/download/v1.0.2/cascade_mask_rcnn_swin_small_patch4_window7.pth 23 | sleep 1 24 | 25 | echo "开始下载swin_base coco权重!" 26 | wget https://github.com/SwinTransformer/storage/releases/download/v1.0.2/cascade_mask_rcnn_swin_base_patch4_window7.pth 27 | -------------------------------------------------------------------------------- /code/mmdet/datasets/__init__.py: -------------------------------------------------------------------------------- 1 | from .builder import DATASETS, PIPELINES, build_dataloader, build_dataset 2 | from .cityscapes import CityscapesDataset 3 | from .coco import CocoDataset 4 | from .custom import CustomDataset 5 | from .dataset_wrappers import (ClassBalancedDataset, ConcatDataset, 6 | RepeatDataset) 7 | from .deepfashion import DeepFashionDataset 8 | from .lvis import LVISDataset, LVISV1Dataset, LVISV05Dataset 9 | from .samplers import DistributedGroupSampler, DistributedSampler, GroupSampler 10 | from .utils import (NumClassCheckHook, get_loading_pipeline, 11 | replace_ImageToTensor) 12 | from .voc import VOCDataset 13 | from .wider_face import WIDERFaceDataset 14 | from .xml_style import XMLDataset 15 | from .road import Road 16 | from .mosaic import MosaicDataset 17 | from .watermosaicdataset import WaterMosaicDataset 18 | 19 | __all__ = [ 20 | 'CustomDataset', 'XMLDataset', 'CocoDataset', 'DeepFashionDataset', 21 | 'VOCDataset', 'CityscapesDataset', 'LVISDataset', 'LVISV05Dataset', 22 | 'LVISV1Dataset', 'GroupSampler', 'DistributedGroupSampler', 23 | 'DistributedSampler', 'build_dataloader', 'ConcatDataset', 'RepeatDataset', 24 | 'ClassBalancedDataset', 'WIDERFaceDataset', 'DATASETS', 'PIPELINES', 25 | 'build_dataset', 'replace_ImageToTensor', 'get_loading_pipeline', 26 | 'NumClassCheckHook', 'Road', 'MosaicDataset', 'WaterMosaicDataset' 27 | ] 28 | -------------------------------------------------------------------------------- /code/mmdet/datasets/.ipynb_checkpoints/__init__-checkpoint.py: -------------------------------------------------------------------------------- 1 | from .builder import DATASETS, PIPELINES, build_dataloader, build_dataset 2 | from .cityscapes import CityscapesDataset 3 | from .coco import CocoDataset 4 | from .custom import CustomDataset 5 | from .dataset_wrappers import (ClassBalancedDataset, ConcatDataset, 6 | RepeatDataset) 7 | from .deepfashion import DeepFashionDataset 8 | from .lvis import LVISDataset, LVISV1Dataset, LVISV05Dataset 9 | from .samplers import DistributedGroupSampler, DistributedSampler, GroupSampler 10 | from .utils import (NumClassCheckHook, get_loading_pipeline, 11 | replace_ImageToTensor) 12 | from .voc import VOCDataset 13 | from .wider_face import WIDERFaceDataset 14 | from .xml_style import XMLDataset 15 | from .road import Road 16 | from .mosaic import MosaicDataset 17 | from .watermosaicdataset import WaterMosaicDataset 18 | 19 | __all__ = [ 20 | 'CustomDataset', 'XMLDataset', 'CocoDataset', 'DeepFashionDataset', 21 | 'VOCDataset', 'CityscapesDataset', 'LVISDataset', 'LVISV05Dataset', 22 | 'LVISV1Dataset', 'GroupSampler', 'DistributedGroupSampler', 23 | 'DistributedSampler', 'build_dataloader', 'ConcatDataset', 'RepeatDataset', 24 | 'ClassBalancedDataset', 'WIDERFaceDataset', 'DATASETS', 'PIPELINES', 25 | 'build_dataset', 'replace_ImageToTensor', 'get_loading_pipeline', 26 | 'NumClassCheckHook', 'Road', 'MosaicDataset', 'WaterMosaicDataset' 27 | ] 28 | -------------------------------------------------------------------------------- /code/mmdet/utils/profiling.py: -------------------------------------------------------------------------------- 1 | import contextlib 2 | import sys 3 | import time 4 | 5 | import torch 6 | 7 | if sys.version_info >= (3, 7): 8 | 9 | @contextlib.contextmanager 10 | def profile_time(trace_name, 11 | name, 12 | enabled=True, 13 | stream=None, 14 | end_stream=None): 15 | """Print time spent by CPU and GPU. 16 | 17 | Useful as a temporary context manager to find sweet spots of code 18 | suitable for async implementation. 19 | """ 20 | if (not enabled) or not torch.cuda.is_available(): 21 | yield 22 | return 23 | stream = stream if stream else torch.cuda.current_stream() 24 | end_stream = end_stream if end_stream else stream 25 | start = torch.cuda.Event(enable_timing=True) 26 | end = torch.cuda.Event(enable_timing=True) 27 | stream.record_event(start) 28 | try: 29 | cpu_start = time.monotonic() 30 | yield 31 | finally: 32 | cpu_end = time.monotonic() 33 | end_stream.record_event(end) 34 | end.synchronize() 35 | cpu_time = (cpu_end - cpu_start) * 1000 36 | gpu_time = start.elapsed_time(end) 37 | msg = f'{trace_name} {name} cpu_time {cpu_time:.2f} ms ' 38 | msg += f'gpu_time {gpu_time:.2f} ms stream {stream}' 39 | print(msg, end_stream) 40 | -------------------------------------------------------------------------------- /code/mmdet/datasets/samplers/distributed_sampler.py: -------------------------------------------------------------------------------- 1 | import math 2 | 3 | import torch 4 | from torch.utils.data import DistributedSampler as _DistributedSampler 5 | 6 | 7 | class DistributedSampler(_DistributedSampler): 8 | 9 | def __init__(self, 10 | dataset, 11 | num_replicas=None, 12 | rank=None, 13 | shuffle=True, 14 | seed=0): 15 | super().__init__( 16 | dataset, num_replicas=num_replicas, rank=rank, shuffle=shuffle) 17 | # for the compatibility from PyTorch 1.3+ 18 | self.seed = seed if seed is not None else 0 19 | 20 | def __iter__(self): 21 | # deterministically shuffle based on epoch 22 | if self.shuffle: 23 | g = torch.Generator() 24 | g.manual_seed(self.epoch + self.seed) 25 | indices = torch.randperm(len(self.dataset), generator=g).tolist() 26 | else: 27 | indices = torch.arange(len(self.dataset)).tolist() 28 | 29 | # add extra samples to make it evenly divisible 30 | # in case that indices is shorter than half of total_size 31 | indices = (indices * 32 | math.ceil(self.total_size / len(indices)))[:self.total_size] 33 | assert len(indices) == self.total_size 34 | 35 | # subsample 36 | indices = indices[self.rank:self.total_size:self.num_replicas] 37 | assert len(indices) == self.num_samples 38 | 39 | return iter(indices) 40 | -------------------------------------------------------------------------------- /code/tools/upgrade_model_version.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import re 3 | from collections import OrderedDict 4 | 5 | import torch 6 | 7 | 8 | def convert(in_file, out_file): 9 | """Convert keys in checkpoints. 10 | 11 | There can be some breaking changes during the development of mmdetection, 12 | and this tool is used for upgrading checkpoints trained with old versions 13 | to the latest one. 14 | """ 15 | checkpoint = torch.load(in_file) 16 | in_state_dict = checkpoint.pop('state_dict') 17 | out_state_dict = OrderedDict() 18 | for key, val in in_state_dict.items(): 19 | # Use ConvModule instead of nn.Conv2d in RetinaNet 20 | # cls_convs.0.weight -> cls_convs.0.conv.weight 21 | m = re.search(r'(cls_convs|reg_convs).\d.(weight|bias)', key) 22 | if m is not None: 23 | param = m.groups()[1] 24 | new_key = key.replace(param, 'conv.{}'.format(param)) 25 | out_state_dict[new_key] = val 26 | continue 27 | 28 | out_state_dict[key] = val 29 | checkpoint['state_dict'] = out_state_dict 30 | torch.save(checkpoint, out_file) 31 | 32 | 33 | def main(): 34 | parser = argparse.ArgumentParser(description='Upgrade model version') 35 | parser.add_argument('in_file', help='input checkpoint file') 36 | parser.add_argument('out_file', help='output checkpoint file') 37 | args = parser.parse_args() 38 | convert(args.in_file, args.out_file) 39 | 40 | 41 | if __name__ == '__main__': 42 | main() 43 | -------------------------------------------------------------------------------- /code/tools/voc_eval.py: -------------------------------------------------------------------------------- 1 | from argparse import ArgumentParser 2 | 3 | import mmcv 4 | 5 | from mmdet import datasets 6 | from mmdet.core import eval_map 7 | 8 | 9 | def voc_eval(result_file, dataset, iou_thr=0.5, nproc=4): 10 | det_results = mmcv.load(result_file) 11 | annotations = [dataset.get_ann_info(i) for i in range(len(dataset))] 12 | if hasattr(dataset, 'year') and dataset.year == 2007: 13 | dataset_name = 'voc07' 14 | else: 15 | dataset_name = dataset.CLASSES 16 | eval_map( 17 | det_results, 18 | annotations, 19 | scale_ranges=None, 20 | iou_thr=iou_thr, 21 | dataset=dataset_name, 22 | logger='print', 23 | nproc=nproc) 24 | 25 | 26 | def main(): 27 | parser = ArgumentParser(description='VOC Evaluation') 28 | parser.add_argument('result', help='result file path') 29 | parser.add_argument('config', help='config file path') 30 | parser.add_argument( 31 | '--iou-thr', 32 | type=float, 33 | default=0.5, 34 | help='IoU threshold for evaluation') 35 | parser.add_argument( 36 | '--nproc', 37 | type=int, 38 | default=4, 39 | help='Processes to be used for computing mAP') 40 | args = parser.parse_args() 41 | cfg = mmcv.Config.fromfile(args.config) 42 | test_dataset = mmcv.runner.obj_from_dict(cfg.data.test, datasets) 43 | voc_eval(args.result, test_dataset, args.iou_thr, args.nproc) 44 | 45 | 46 | if __name__ == '__main__': 47 | main() 48 | -------------------------------------------------------------------------------- /code/mmdet/core/anchor/point_generator.py: -------------------------------------------------------------------------------- 1 | import torch 2 | 3 | from .builder import ANCHOR_GENERATORS 4 | 5 | 6 | @ANCHOR_GENERATORS.register_module() 7 | class PointGenerator(object): 8 | 9 | def _meshgrid(self, x, y, row_major=True): 10 | xx = x.repeat(len(y)) 11 | yy = y.view(-1, 1).repeat(1, len(x)).view(-1) 12 | if row_major: 13 | return xx, yy 14 | else: 15 | return yy, xx 16 | 17 | def grid_points(self, featmap_size, stride=16, device='cuda'): 18 | feat_h, feat_w = featmap_size 19 | shift_x = torch.arange(0., feat_w, device=device) * stride 20 | shift_y = torch.arange(0., feat_h, device=device) * stride 21 | shift_xx, shift_yy = self._meshgrid(shift_x, shift_y) 22 | stride = shift_x.new_full((shift_xx.shape[0], ), stride) 23 | shifts = torch.stack([shift_xx, shift_yy, stride], dim=-1) 24 | all_points = shifts.to(device) 25 | return all_points 26 | 27 | def valid_flags(self, featmap_size, valid_size, device='cuda'): 28 | feat_h, feat_w = featmap_size 29 | valid_h, valid_w = valid_size 30 | assert valid_h <= feat_h and valid_w <= feat_w 31 | valid_x = torch.zeros(feat_w, dtype=torch.bool, device=device) 32 | valid_y = torch.zeros(feat_h, dtype=torch.bool, device=device) 33 | valid_x[:valid_w] = 1 34 | valid_y[:valid_h] = 1 35 | valid_xx, valid_yy = self._meshgrid(valid_x, valid_y) 36 | valid = valid_xx & valid_yy 37 | return valid 38 | -------------------------------------------------------------------------------- /code/tools/.ipynb_checkpoints/voc_eval-checkpoint.py: -------------------------------------------------------------------------------- 1 | from argparse import ArgumentParser 2 | 3 | import mmcv 4 | 5 | from mmdet import datasets 6 | from mmdet.core import eval_map 7 | 8 | 9 | def voc_eval(result_file, dataset, iou_thr=0.5, nproc=4): 10 | det_results = mmcv.load(result_file) 11 | annotations = [dataset.get_ann_info(i) for i in range(len(dataset))] 12 | if hasattr(dataset, 'year') and dataset.year == 2007: 13 | dataset_name = 'voc07' 14 | else: 15 | dataset_name = dataset.CLASSES 16 | eval_map( 17 | det_results, 18 | annotations, 19 | scale_ranges=None, 20 | iou_thr=iou_thr, 21 | dataset=dataset_name, 22 | logger='print', 23 | nproc=nproc) 24 | 25 | 26 | def main(): 27 | parser = ArgumentParser(description='VOC Evaluation') 28 | parser.add_argument('result', help='result file path') 29 | parser.add_argument('config', help='config file path') 30 | parser.add_argument( 31 | '--iou-thr', 32 | type=float, 33 | default=0.5, 34 | help='IoU threshold for evaluation') 35 | parser.add_argument( 36 | '--nproc', 37 | type=int, 38 | default=4, 39 | help='Processes to be used for computing mAP') 40 | args = parser.parse_args() 41 | cfg = mmcv.Config.fromfile(args.config) 42 | test_dataset = mmcv.runner.obj_from_dict(cfg.data.test, datasets) 43 | voc_eval(args.result, test_dataset, args.iou_thr, args.nproc) 44 | 45 | 46 | if __name__ == '__main__': 47 | main() 48 | -------------------------------------------------------------------------------- /code/mmdet/core/anchor/.ipynb_checkpoints/point_generator-checkpoint.py: -------------------------------------------------------------------------------- 1 | import torch 2 | 3 | from .builder import ANCHOR_GENERATORS 4 | 5 | 6 | @ANCHOR_GENERATORS.register_module() 7 | class PointGenerator(object): 8 | 9 | def _meshgrid(self, x, y, row_major=True): 10 | xx = x.repeat(len(y)) 11 | yy = y.view(-1, 1).repeat(1, len(x)).view(-1) 12 | if row_major: 13 | return xx, yy 14 | else: 15 | return yy, xx 16 | 17 | def grid_points(self, featmap_size, stride=16, device='cuda'): 18 | feat_h, feat_w = featmap_size 19 | shift_x = torch.arange(0., feat_w, device=device) * stride 20 | shift_y = torch.arange(0., feat_h, device=device) * stride 21 | shift_xx, shift_yy = self._meshgrid(shift_x, shift_y) 22 | stride = shift_x.new_full((shift_xx.shape[0], ), stride) 23 | shifts = torch.stack([shift_xx, shift_yy, stride], dim=-1) 24 | all_points = shifts.to(device) 25 | return all_points 26 | 27 | def valid_flags(self, featmap_size, valid_size, device='cuda'): 28 | feat_h, feat_w = featmap_size 29 | valid_h, valid_w = valid_size 30 | assert valid_h <= feat_h and valid_w <= feat_w 31 | valid_x = torch.zeros(feat_w, dtype=torch.bool, device=device) 32 | valid_y = torch.zeros(feat_h, dtype=torch.bool, device=device) 33 | valid_x[:valid_w] = 1 34 | valid_y[:valid_h] = 1 35 | valid_xx, valid_yy = self._meshgrid(valid_x, valid_y) 36 | valid = valid_xx & valid_yy 37 | return valid 38 | -------------------------------------------------------------------------------- /code/mmdet/models/detectors/__init__.py: -------------------------------------------------------------------------------- 1 | from .atss import ATSS 2 | from .base import BaseDetector 3 | from .cascade_rcnn import CascadeRCNN 4 | from .cornernet import CornerNet 5 | from .detr import DETR 6 | from .fast_rcnn import FastRCNN 7 | from .faster_rcnn import FasterRCNN 8 | from .fcos import FCOS 9 | from .fovea import FOVEA 10 | from .fsaf import FSAF 11 | from .gfl import GFL 12 | from .grid_rcnn import GridRCNN 13 | from .htc import HybridTaskCascade 14 | from .mask_rcnn import MaskRCNN 15 | from .mask_scoring_rcnn import MaskScoringRCNN 16 | from .nasfcos import NASFCOS 17 | from .paa import PAA 18 | from .point_rend import PointRend 19 | from .reppoints_detector import RepPointsDetector 20 | from .retinanet import RetinaNet 21 | from .rpn import RPN 22 | from .scnet import SCNet 23 | from .single_stage import SingleStageDetector 24 | from .sparse_rcnn import SparseRCNN 25 | from .trident_faster_rcnn import TridentFasterRCNN 26 | from .two_stage import TwoStageDetector 27 | from .vfnet import VFNet 28 | from .yolact import YOLACT 29 | from .yolo import YOLOV3 30 | from .ensemble_model import EnsembleModel 31 | 32 | __all__ = [ 33 | 'ATSS', 'BaseDetector', 'SingleStageDetector', 'TwoStageDetector', 'RPN', 34 | 'FastRCNN', 'FasterRCNN', 'MaskRCNN', 'CascadeRCNN', 'HybridTaskCascade', 35 | 'RetinaNet', 'FCOS', 'GridRCNN', 'MaskScoringRCNN', 'RepPointsDetector', 36 | 'FOVEA', 'FSAF', 'NASFCOS', 'PointRend', 'GFL', 'CornerNet', 'PAA', 37 | 'YOLOV3', 'YOLACT', 'VFNet', 'DETR', 'TridentFasterRCNN', 'SparseRCNN', 38 | 'SCNet', 'EnsembleModel' 39 | ] 40 | -------------------------------------------------------------------------------- /code/mmdet/models/detectors/.ipynb_checkpoints/__init__-checkpoint.py: -------------------------------------------------------------------------------- 1 | from .atss import ATSS 2 | from .base import BaseDetector 3 | from .cascade_rcnn import CascadeRCNN 4 | from .cornernet import CornerNet 5 | from .detr import DETR 6 | from .fast_rcnn import FastRCNN 7 | from .faster_rcnn import FasterRCNN 8 | from .fcos import FCOS 9 | from .fovea import FOVEA 10 | from .fsaf import FSAF 11 | from .gfl import GFL 12 | from .grid_rcnn import GridRCNN 13 | from .htc import HybridTaskCascade 14 | from .mask_rcnn import MaskRCNN 15 | from .mask_scoring_rcnn import MaskScoringRCNN 16 | from .nasfcos import NASFCOS 17 | from .paa import PAA 18 | from .point_rend import PointRend 19 | from .reppoints_detector import RepPointsDetector 20 | from .retinanet import RetinaNet 21 | from .rpn import RPN 22 | from .scnet import SCNet 23 | from .single_stage import SingleStageDetector 24 | from .sparse_rcnn import SparseRCNN 25 | from .trident_faster_rcnn import TridentFasterRCNN 26 | from .two_stage import TwoStageDetector 27 | from .vfnet import VFNet 28 | from .yolact import YOLACT 29 | from .yolo import YOLOV3 30 | from .ensemble_model import EnsembleModel 31 | 32 | __all__ = [ 33 | 'ATSS', 'BaseDetector', 'SingleStageDetector', 'TwoStageDetector', 'RPN', 34 | 'FastRCNN', 'FasterRCNN', 'MaskRCNN', 'CascadeRCNN', 'HybridTaskCascade', 35 | 'RetinaNet', 'FCOS', 'GridRCNN', 'MaskScoringRCNN', 'RepPointsDetector', 36 | 'FOVEA', 'FSAF', 'NASFCOS', 'PointRend', 'GFL', 'CornerNet', 'PAA', 37 | 'YOLOV3', 'YOLACT', 'VFNet', 'DETR', 'TridentFasterRCNN', 'SparseRCNN', 38 | 'SCNet', 'EnsembleModel' 39 | ] 40 | -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/mask_heads/htc_mask_head.py: -------------------------------------------------------------------------------- 1 | from mmcv.cnn import ConvModule 2 | 3 | from mmdet.models.builder import HEADS 4 | from .fcn_mask_head import FCNMaskHead 5 | 6 | 7 | @HEADS.register_module() 8 | class HTCMaskHead(FCNMaskHead): 9 | 10 | def __init__(self, with_conv_res=True, *args, **kwargs): 11 | super(HTCMaskHead, self).__init__(*args, **kwargs) 12 | self.with_conv_res = with_conv_res 13 | if self.with_conv_res: 14 | self.conv_res = ConvModule( 15 | self.conv_out_channels, 16 | self.conv_out_channels, 17 | 1, 18 | conv_cfg=self.conv_cfg, 19 | norm_cfg=self.norm_cfg) 20 | 21 | def init_weights(self): 22 | super(HTCMaskHead, self).init_weights() 23 | if self.with_conv_res: 24 | self.conv_res.init_weights() 25 | 26 | def forward(self, x, res_feat=None, return_logits=True, return_feat=True): 27 | if res_feat is not None: 28 | assert self.with_conv_res 29 | res_feat = self.conv_res(res_feat) 30 | x = x + res_feat 31 | for conv in self.convs: 32 | x = conv(x) 33 | res_feat = x 34 | outs = [] 35 | if return_logits: 36 | x = self.upsample(x) 37 | if self.upsample_method == 'deconv': 38 | x = self.relu(x) 39 | mask_pred = self.conv_logits(x) 40 | outs.append(mask_pred) 41 | if return_feat: 42 | outs.append(res_feat) 43 | return outs if len(outs) > 1 else outs[0] 44 | -------------------------------------------------------------------------------- /code/tools/data_process/split_data.py: -------------------------------------------------------------------------------- 1 | import glob, tqdm, shutil, os 2 | import random 3 | 4 | random.seed(11) 5 | 6 | if __name__ == '__main__': 7 | data_root = '../data/train/image' 8 | image_paths = glob.glob(data_root + '/*.jpg') 9 | 10 | # 划分数据集, 10%作为验证集 11 | train_size = int(len(image_paths) * 0.9) 12 | train_paths = image_paths[:train_size] 13 | val_paths = image_paths[train_size:] 14 | 15 | os.makedirs('../data/train/train-image/', exist_ok=True) 16 | os.makedirs('../data/train/train-box/', exist_ok=True) 17 | os.makedirs('../data/train/val-image/', exist_ok=True) 18 | os.makedirs('../data/train/val-box/', exist_ok=True) 19 | 20 | for path in tqdm.tqdm(train_paths): 21 | base_name = os.path.basename(path) 22 | dst_name = os.path.join('../data/train/train-image', base_name) 23 | xml_name = base_name.split('.')[0] + '.xml' 24 | xml_src_path = os.path.join('../data/train/box', xml_name) 25 | xml_dst_path = os.path.join('../data/train/train-box', xml_name) 26 | shutil.copy(path, dst_name) 27 | shutil.copy(xml_src_path, xml_dst_path) 28 | 29 | for path in tqdm.tqdm(val_paths): 30 | base_name = os.path.basename(path) 31 | dst_name = os.path.join('../data/train/val-image', base_name) 32 | xml_name = base_name.split('.')[0] + '.xml' 33 | xml_src_path = os.path.join('../data/train/box', xml_name) 34 | xml_dst_path = os.path.join('../data/train/val-box', xml_name) 35 | shutil.copy(path, dst_name) 36 | shutil.copy(xml_src_path, xml_dst_path) -------------------------------------------------------------------------------- /code/mmdet/core/bbox/samplers/pseudo_sampler.py: -------------------------------------------------------------------------------- 1 | import torch 2 | 3 | from ..builder import BBOX_SAMPLERS 4 | from .base_sampler import BaseSampler 5 | from .sampling_result import SamplingResult 6 | 7 | 8 | @BBOX_SAMPLERS.register_module() 9 | class PseudoSampler(BaseSampler): 10 | """A pseudo sampler that does not do sampling actually.""" 11 | 12 | def __init__(self, **kwargs): 13 | pass 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 | 23 | def sample(self, assign_result, bboxes, gt_bboxes, **kwargs): 24 | """Directly returns the positive and negative indices of samples. 25 | 26 | Args: 27 | assign_result (:obj:`AssignResult`): Assigned results 28 | bboxes (torch.Tensor): Bounding boxes 29 | gt_bboxes (torch.Tensor): Ground truth boxes 30 | 31 | Returns: 32 | :obj:`SamplingResult`: sampler results 33 | """ 34 | pos_inds = torch.nonzero( 35 | assign_result.gt_inds > 0, as_tuple=False).squeeze(-1).unique() 36 | neg_inds = torch.nonzero( 37 | assign_result.gt_inds == 0, as_tuple=False).squeeze(-1).unique() 38 | gt_flags = bboxes.new_zeros(bboxes.shape[0], dtype=torch.uint8) 39 | sampling_result = SamplingResult(pos_inds, neg_inds, bboxes, gt_bboxes, 40 | assign_result, gt_flags) 41 | return sampling_result 42 | -------------------------------------------------------------------------------- /code/mmdet/models/losses/__init__.py: -------------------------------------------------------------------------------- 1 | from .accuracy import Accuracy, accuracy 2 | from .ae_loss import AssociativeEmbeddingLoss 3 | from .balanced_l1_loss import BalancedL1Loss, balanced_l1_loss 4 | from .cross_entropy_loss import (CrossEntropyLoss, binary_cross_entropy, 5 | cross_entropy, mask_cross_entropy) 6 | from .focal_loss import FocalLoss, sigmoid_focal_loss 7 | from .gaussian_focal_loss import GaussianFocalLoss 8 | from .gfocal_loss import DistributionFocalLoss, QualityFocalLoss 9 | from .ghm_loss import GHMC, GHMR 10 | from .iou_loss import (BoundedIoULoss, CIoULoss, DIoULoss, GIoULoss, IoULoss, 11 | bounded_iou_loss, iou_loss) 12 | from .mse_loss import MSELoss, mse_loss 13 | from .pisa_loss import carl_loss, isr_p 14 | from .smooth_l1_loss import L1Loss, SmoothL1Loss, l1_loss, smooth_l1_loss 15 | from .utils import reduce_loss, weight_reduce_loss, weighted_loss 16 | from .varifocal_loss import VarifocalLoss 17 | 18 | __all__ = [ 19 | 'accuracy', 'Accuracy', 'cross_entropy', 'binary_cross_entropy', 20 | 'mask_cross_entropy', 'CrossEntropyLoss', 'sigmoid_focal_loss', 21 | 'FocalLoss', 'smooth_l1_loss', 'SmoothL1Loss', 'balanced_l1_loss', 22 | 'BalancedL1Loss', 'mse_loss', 'MSELoss', 'iou_loss', 'bounded_iou_loss', 23 | 'IoULoss', 'BoundedIoULoss', 'GIoULoss', 'DIoULoss', 'CIoULoss', 'GHMC', 24 | 'GHMR', 'reduce_loss', 'weight_reduce_loss', 'weighted_loss', 'L1Loss', 25 | 'l1_loss', 'isr_p', 'carl_loss', 'AssociativeEmbeddingLoss', 26 | 'GaussianFocalLoss', 'QualityFocalLoss', 'DistributionFocalLoss', 27 | 'VarifocalLoss' 28 | ] 29 | -------------------------------------------------------------------------------- /code/tools/data_process/.ipynb_checkpoints/split_data-checkpoint.py: -------------------------------------------------------------------------------- 1 | import glob, tqdm, shutil, os 2 | import random 3 | 4 | random.seed(11) 5 | 6 | if __name__ == '__main__': 7 | data_root = '../data/train/image' 8 | image_paths = glob.glob(data_root + '/*.jpg') 9 | 10 | # 划分数据集, 10%作为验证集 11 | train_size = int(len(image_paths) * 0.9) 12 | train_paths = image_paths[:train_size] 13 | val_paths = image_paths[train_size:] 14 | 15 | os.makedirs('../data/train/train-image/', exist_ok=True) 16 | os.makedirs('../data/train/train-box/', exist_ok=True) 17 | os.makedirs('../data/train/val-image/', exist_ok=True) 18 | os.makedirs('../data/train/val-box/', exist_ok=True) 19 | 20 | for path in tqdm.tqdm(train_paths): 21 | base_name = os.path.basename(path) 22 | dst_name = os.path.join('../data/train/train-image', base_name) 23 | xml_name = base_name.split('.')[0] + '.xml' 24 | xml_src_path = os.path.join('../data/train/box', xml_name) 25 | xml_dst_path = os.path.join('../data/train/train-box', xml_name) 26 | shutil.copy(path, dst_name) 27 | shutil.copy(xml_src_path, xml_dst_path) 28 | 29 | for path in tqdm.tqdm(val_paths): 30 | base_name = os.path.basename(path) 31 | dst_name = os.path.join('../data/train/val-image', base_name) 32 | xml_name = base_name.split('.')[0] + '.xml' 33 | xml_src_path = os.path.join('../data/train/box', xml_name) 34 | xml_dst_path = os.path.join('../data/train/val-box', xml_name) 35 | shutil.copy(path, dst_name) 36 | shutil.copy(xml_src_path, xml_dst_path) -------------------------------------------------------------------------------- /code/mmdet/core/bbox/__init__.py: -------------------------------------------------------------------------------- 1 | from .assigners import (AssignResult, BaseAssigner, CenterRegionAssigner, 2 | MaxIoUAssigner, RegionAssigner) 3 | from .builder import build_assigner, build_bbox_coder, build_sampler 4 | from .coder import (BaseBBoxCoder, DeltaXYWHBBoxCoder, PseudoBBoxCoder, 5 | TBLRBBoxCoder) 6 | from .iou_calculators import BboxOverlaps2D, bbox_overlaps 7 | from .samplers import (BaseSampler, CombinedSampler, 8 | InstanceBalancedPosSampler, IoUBalancedNegSampler, 9 | OHEMSampler, PseudoSampler, RandomSampler, 10 | SamplingResult, ScoreHLRSampler) 11 | from .transforms import (bbox2distance, bbox2result, bbox2roi, 12 | bbox_cxcywh_to_xyxy, bbox_flip, bbox_mapping, 13 | bbox_mapping_back, bbox_rescale, bbox_xyxy_to_cxcywh, 14 | distance2bbox, roi2bbox) 15 | 16 | __all__ = [ 17 | 'bbox_overlaps', 'BboxOverlaps2D', 'BaseAssigner', 'MaxIoUAssigner', 18 | 'AssignResult', 'BaseSampler', 'PseudoSampler', 'RandomSampler', 19 | 'InstanceBalancedPosSampler', 'IoUBalancedNegSampler', 'CombinedSampler', 20 | 'OHEMSampler', 'SamplingResult', 'ScoreHLRSampler', 'build_assigner', 21 | 'build_sampler', 'bbox_flip', 'bbox_mapping', 'bbox_mapping_back', 22 | 'bbox2roi', 'roi2bbox', 'bbox2result', 'distance2bbox', 'bbox2distance', 23 | 'build_bbox_coder', 'BaseBBoxCoder', 'PseudoBBoxCoder', 24 | 'DeltaXYWHBBoxCoder', 'TBLRBBoxCoder', 'CenterRegionAssigner', 25 | 'bbox_rescale', 'bbox_cxcywh_to_xyxy', 'bbox_xyxy_to_cxcywh', 26 | 'RegionAssigner' 27 | ] 28 | -------------------------------------------------------------------------------- /code/mmdet/models/losses/mse_loss.py: -------------------------------------------------------------------------------- 1 | import torch.nn as nn 2 | import torch.nn.functional as F 3 | 4 | from ..builder import LOSSES 5 | from .utils import weighted_loss 6 | 7 | 8 | @weighted_loss 9 | def mse_loss(pred, target): 10 | """Warpper of mse loss.""" 11 | return F.mse_loss(pred, target, reduction='none') 12 | 13 | 14 | @LOSSES.register_module() 15 | class MSELoss(nn.Module): 16 | """MSELoss. 17 | 18 | Args: 19 | reduction (str, optional): The method that reduces the loss to a 20 | scalar. Options are "none", "mean" and "sum". 21 | loss_weight (float, optional): The weight of the loss. Defaults to 1.0 22 | """ 23 | 24 | def __init__(self, reduction='mean', loss_weight=1.0): 25 | super().__init__() 26 | self.reduction = reduction 27 | self.loss_weight = loss_weight 28 | 29 | def forward(self, pred, target, weight=None, avg_factor=None): 30 | """Forward function of loss. 31 | 32 | Args: 33 | pred (torch.Tensor): The prediction. 34 | target (torch.Tensor): The learning target of the prediction. 35 | weight (torch.Tensor, optional): Weight of the loss for each 36 | prediction. Defaults to None. 37 | avg_factor (int, optional): Average factor that is used to average 38 | the loss. Defaults to None. 39 | 40 | Returns: 41 | torch.Tensor: The calculated loss 42 | """ 43 | loss = self.loss_weight * mse_loss( 44 | pred, 45 | target, 46 | weight, 47 | reduction=self.reduction, 48 | avg_factor=avg_factor) 49 | return loss 50 | -------------------------------------------------------------------------------- /code/mmdet/datasets/pipelines/compose.py: -------------------------------------------------------------------------------- 1 | import collections 2 | 3 | from mmcv.utils import build_from_cfg 4 | 5 | from ..builder import PIPELINES 6 | 7 | 8 | @PIPELINES.register_module() 9 | class Compose(object): 10 | """Compose multiple transforms sequentially. 11 | 12 | Args: 13 | transforms (Sequence[dict | callable]): Sequence of transform object or 14 | config dict to be composed. 15 | """ 16 | 17 | def __init__(self, transforms): 18 | assert isinstance(transforms, collections.abc.Sequence) 19 | self.transforms = [] 20 | for transform in transforms: 21 | if isinstance(transform, dict): 22 | transform = build_from_cfg(transform, PIPELINES) 23 | self.transforms.append(transform) 24 | elif callable(transform): 25 | self.transforms.append(transform) 26 | else: 27 | raise TypeError('transform must be callable or a dict') 28 | 29 | def __call__(self, data): 30 | """Call function to apply transforms sequentially. 31 | 32 | Args: 33 | data (dict): A result dict contains the data to transform. 34 | 35 | Returns: 36 | dict: Transformed data. 37 | """ 38 | 39 | for t in self.transforms: 40 | data = t(data) 41 | if data is None: 42 | return None 43 | return data 44 | 45 | def __repr__(self): 46 | format_string = self.__class__.__name__ + '(' 47 | for t in self.transforms: 48 | format_string += '\n' 49 | format_string += f' {t}' 50 | format_string += '\n)' 51 | return format_string 52 | -------------------------------------------------------------------------------- /code/mmdet/datasets/pipelines/.ipynb_checkpoints/compose-checkpoint.py: -------------------------------------------------------------------------------- 1 | import collections 2 | 3 | from mmcv.utils import build_from_cfg 4 | 5 | from ..builder import PIPELINES 6 | 7 | 8 | @PIPELINES.register_module() 9 | class Compose(object): 10 | """Compose multiple transforms sequentially. 11 | 12 | Args: 13 | transforms (Sequence[dict | callable]): Sequence of transform object or 14 | config dict to be composed. 15 | """ 16 | 17 | def __init__(self, transforms): 18 | assert isinstance(transforms, collections.abc.Sequence) 19 | self.transforms = [] 20 | for transform in transforms: 21 | if isinstance(transform, dict): 22 | transform = build_from_cfg(transform, PIPELINES) 23 | self.transforms.append(transform) 24 | elif callable(transform): 25 | self.transforms.append(transform) 26 | else: 27 | raise TypeError('transform must be callable or a dict') 28 | 29 | def __call__(self, data): 30 | """Call function to apply transforms sequentially. 31 | 32 | Args: 33 | data (dict): A result dict contains the data to transform. 34 | 35 | Returns: 36 | dict: Transformed data. 37 | """ 38 | 39 | for t in self.transforms: 40 | data = t(data) 41 | if data is None: 42 | return None 43 | return data 44 | 45 | def __repr__(self): 46 | format_string = self.__class__.__name__ + '(' 47 | for t in self.transforms: 48 | format_string += '\n' 49 | format_string += f' {t}' 50 | format_string += '\n)' 51 | return format_string 52 | -------------------------------------------------------------------------------- /code/mmdet/datasets/wider_face.py: -------------------------------------------------------------------------------- 1 | import os.path as osp 2 | import xml.etree.ElementTree as ET 3 | 4 | import mmcv 5 | 6 | from .builder import DATASETS 7 | from .xml_style import XMLDataset 8 | 9 | 10 | @DATASETS.register_module() 11 | class WIDERFaceDataset(XMLDataset): 12 | """Reader for the WIDER Face dataset in PASCAL VOC format. 13 | 14 | Conversion scripts can be found in 15 | https://github.com/sovrasov/wider-face-pascal-voc-annotations 16 | """ 17 | CLASSES = ('face', ) 18 | 19 | def __init__(self, **kwargs): 20 | super(WIDERFaceDataset, self).__init__(**kwargs) 21 | 22 | def load_annotations(self, ann_file): 23 | """Load annotation from WIDERFace XML style annotation file. 24 | 25 | Args: 26 | ann_file (str): Path of XML file. 27 | 28 | Returns: 29 | list[dict]: Annotation info from XML file. 30 | """ 31 | 32 | data_infos = [] 33 | img_ids = mmcv.list_from_file(ann_file) 34 | for img_id in img_ids: 35 | filename = f'{img_id}.jpg' 36 | xml_path = osp.join(self.img_prefix, 'Annotations', 37 | f'{img_id}.xml') 38 | tree = ET.parse(xml_path) 39 | root = tree.getroot() 40 | size = root.find('size') 41 | width = int(size.find('width').text) 42 | height = int(size.find('height').text) 43 | folder = root.find('folder').text 44 | data_infos.append( 45 | dict( 46 | id=img_id, 47 | filename=osp.join(folder, filename), 48 | width=width, 49 | height=height)) 50 | 51 | return data_infos 52 | -------------------------------------------------------------------------------- /code/mmdet/datasets/pipelines/__init__.py: -------------------------------------------------------------------------------- 1 | # from .auto_augment import (AutoAugment, BrightnessTransform, ColorTransform, 2 | # ContrastTransform, EqualizeTransform, Rotate, Shear, 3 | # Translate) 4 | from .compose import Compose 5 | from .formating import (Collect, DefaultFormatBundle, ImageToTensor, 6 | ToDataContainer, ToTensor, Transpose, to_tensor) 7 | from .instaboost import InstaBoost 8 | from .loading import (LoadAnnotations, LoadImageFromFile, LoadImageFromWebcam, 9 | LoadMultiChannelImageFromFiles, LoadProposals) 10 | from .test_time_aug import MultiScaleFlipAug 11 | from .transforms import (Albu, CutOut, Expand, MinIoURandomCrop, Normalize, 12 | Pad, PhotoMetricDistortion, RandomCenterCropPad, 13 | RandomCrop, RandomFlip, Resize, SegRescale, Mixup, 14 | AutoAugment, SoftGridMask, BBoxJitter) 15 | from .loadingmasoic import LoadMosaicImageAndAnnotations 16 | 17 | __all__ = [ 18 | 'Compose', 'to_tensor', 'ToTensor', 'ImageToTensor', 'ToDataContainer', 19 | 'Transpose', 'Collect', 'DefaultFormatBundle', 'LoadAnnotations', 20 | 'LoadImageFromFile', 'LoadImageFromWebcam', 21 | 'LoadMultiChannelImageFromFiles', 'LoadProposals', 'MultiScaleFlipAug', 22 | 'Resize', 'RandomFlip', 'Pad', 'RandomCrop', 'Normalize', 'SegRescale', 23 | 'MinIoURandomCrop', 'Expand', 'PhotoMetricDistortion', 'Albu', 24 | 'InstaBoost', 'RandomCenterCropPad', 'AutoAugment', 'CutOut', 'Shear', 25 | 'Rotate', 'ColorTransform', 'EqualizeTransform', 'BrightnessTransform', 26 | 'ContrastTransform', 'Translate', 'LoadMosaicImageAndAnnotations', 'Mixup', 27 | 'AutoAugment', 'SoftGridMask', 'BBoxJitter' 28 | ] 29 | -------------------------------------------------------------------------------- /code/mmdet/models/detectors/cascade_rcnn.py: -------------------------------------------------------------------------------- 1 | from ..builder import DETECTORS 2 | from .two_stage import TwoStageDetector 3 | 4 | 5 | @DETECTORS.register_module() 6 | class CascadeRCNN(TwoStageDetector): 7 | r"""Implementation of `Cascade R-CNN: Delving into High Quality Object 8 | Detection `_""" 9 | 10 | def __init__(self, 11 | backbone, 12 | neck=None, 13 | rpn_head=None, 14 | roi_head=None, 15 | train_cfg=None, 16 | test_cfg=None, 17 | pretrained=None): 18 | super(CascadeRCNN, self).__init__( 19 | backbone=backbone, 20 | neck=neck, 21 | rpn_head=rpn_head, 22 | roi_head=roi_head, 23 | train_cfg=train_cfg, 24 | test_cfg=test_cfg, 25 | pretrained=pretrained) 26 | 27 | def show_result(self, data, result, **kwargs): 28 | """Show prediction results of the detector. 29 | 30 | Args: 31 | data (str or np.ndarray): Image filename or loaded image. 32 | result (Tensor or tuple): The results to draw over `img` 33 | bbox_result or (bbox_result, segm_result). 34 | 35 | Returns: 36 | np.ndarray: The image with bboxes drawn on it. 37 | """ 38 | if self.with_mask: 39 | ms_bbox_result, ms_segm_result = result 40 | if isinstance(ms_bbox_result, dict): 41 | result = (ms_bbox_result['ensemble'], 42 | ms_segm_result['ensemble']) 43 | else: 44 | if isinstance(result, dict): 45 | result = result['ensemble'] 46 | return super(CascadeRCNN, self).show_result(data, result, **kwargs) 47 | -------------------------------------------------------------------------------- /code/mmdet/datasets/pipelines/.ipynb_checkpoints/__init__-checkpoint.py: -------------------------------------------------------------------------------- 1 | # from .auto_augment import (AutoAugment, BrightnessTransform, ColorTransform, 2 | # ContrastTransform, EqualizeTransform, Rotate, Shear, 3 | # Translate) 4 | from .compose import Compose 5 | from .formating import (Collect, DefaultFormatBundle, ImageToTensor, 6 | ToDataContainer, ToTensor, Transpose, to_tensor) 7 | from .instaboost import InstaBoost 8 | from .loading import (LoadAnnotations, LoadImageFromFile, LoadImageFromWebcam, 9 | LoadMultiChannelImageFromFiles, LoadProposals) 10 | from .test_time_aug import MultiScaleFlipAug 11 | from .transforms import (Albu, CutOut, Expand, MinIoURandomCrop, Normalize, 12 | Pad, PhotoMetricDistortion, RandomCenterCropPad, 13 | RandomCrop, RandomFlip, Resize, SegRescale, Mixup, 14 | AutoAugment, SoftGridMask, BBoxJitter) 15 | from .loadingmasoic import LoadMosaicImageAndAnnotations 16 | 17 | __all__ = [ 18 | 'Compose', 'to_tensor', 'ToTensor', 'ImageToTensor', 'ToDataContainer', 19 | 'Transpose', 'Collect', 'DefaultFormatBundle', 'LoadAnnotations', 20 | 'LoadImageFromFile', 'LoadImageFromWebcam', 21 | 'LoadMultiChannelImageFromFiles', 'LoadProposals', 'MultiScaleFlipAug', 22 | 'Resize', 'RandomFlip', 'Pad', 'RandomCrop', 'Normalize', 'SegRescale', 23 | 'MinIoURandomCrop', 'Expand', 'PhotoMetricDistortion', 'Albu', 24 | 'InstaBoost', 'RandomCenterCropPad', 'AutoAugment', 'CutOut', 'Shear', 25 | 'Rotate', 'ColorTransform', 'EqualizeTransform', 'BrightnessTransform', 26 | 'ContrastTransform', 'Translate', 'LoadMosaicImageAndAnnotations', 'Mixup', 27 | 'AutoAugment', 'SoftGridMask', 'BBoxJitter' 28 | ] 29 | -------------------------------------------------------------------------------- /code/tools/data_process/generate_test_json.py: -------------------------------------------------------------------------------- 1 | import json 2 | import os 3 | from glob import glob 4 | from tqdm import tqdm 5 | from PIL import Image 6 | from mmdet.core import road_classes 7 | label_ids = {name: i + 1 for i, name in enumerate(road_classes())} 8 | 9 | 10 | def save(images, annotations): 11 | ann = {} 12 | ann['type'] = 'instances' 13 | ann['images'] = images 14 | ann['annotations'] = annotations 15 | 16 | categories = [] 17 | for k, v in label_ids.items(): 18 | categories.append({"name": k, "id": v}) 19 | ann['categories'] = categories 20 | json.dump(ann, open('/data/user_data/testB.json', 'w')) 21 | 22 | 23 | def test_dataset(im_dir): 24 | im_list = glob(os.path.join(im_dir, '*.jpg')) 25 | idx = 1 26 | # image_id = 1 27 | images = [] 28 | annotations = [] 29 | for im_path in tqdm(im_list): 30 | image_id = int(os.path.basename(im_path).split('.')[0]) 31 | im = Image.open(im_path) 32 | w, h = im.size 33 | image = {'file_name': os.path.basename(im_path), 'width': w, 'height': h, 'id': image_id} 34 | images.append(image) 35 | labels = [[10, 10, 20, 20]] 36 | for label in labels: 37 | bbox = [label[0], label[1], label[2] - label[0], label[3] - label[1]] 38 | seg = [] 39 | ann = {'segmentation': [seg], 'area': bbox[2] * bbox[3], 'iscrowd': 0, 'image_id': image_id, 40 | 'bbox': bbox, 'category_id': 1, 'id': idx, 'ignore': 0} 41 | idx += 1 42 | annotations.append(ann) 43 | save(images, annotations) 44 | 45 | 46 | if __name__ == '__main__': 47 | test_dir = '/data/raw_data/test_B/images' 48 | # test_dir = '../data/test-B-image/' 49 | print("generate test json label file.") 50 | test_dataset(test_dir) -------------------------------------------------------------------------------- /code/mmdet/models/detectors/.ipynb_checkpoints/cascade_rcnn-checkpoint.py: -------------------------------------------------------------------------------- 1 | from ..builder import DETECTORS 2 | from .two_stage import TwoStageDetector 3 | 4 | 5 | @DETECTORS.register_module() 6 | class CascadeRCNN(TwoStageDetector): 7 | r"""Implementation of `Cascade R-CNN: Delving into High Quality Object 8 | Detection `_""" 9 | 10 | def __init__(self, 11 | backbone, 12 | neck=None, 13 | rpn_head=None, 14 | roi_head=None, 15 | train_cfg=None, 16 | test_cfg=None, 17 | pretrained=None): 18 | super(CascadeRCNN, self).__init__( 19 | backbone=backbone, 20 | neck=neck, 21 | rpn_head=rpn_head, 22 | roi_head=roi_head, 23 | train_cfg=train_cfg, 24 | test_cfg=test_cfg, 25 | pretrained=pretrained) 26 | 27 | def show_result(self, data, result, **kwargs): 28 | """Show prediction results of the detector. 29 | 30 | Args: 31 | data (str or np.ndarray): Image filename or loaded image. 32 | result (Tensor or tuple): The results to draw over `img` 33 | bbox_result or (bbox_result, segm_result). 34 | 35 | Returns: 36 | np.ndarray: The image with bboxes drawn on it. 37 | """ 38 | if self.with_mask: 39 | ms_bbox_result, ms_segm_result = result 40 | if isinstance(ms_bbox_result, dict): 41 | result = (ms_bbox_result['ensemble'], 42 | ms_segm_result['ensemble']) 43 | else: 44 | if isinstance(result, dict): 45 | result = result['ensemble'] 46 | return super(CascadeRCNN, self).show_result(data, result, **kwargs) 47 | -------------------------------------------------------------------------------- /code/tools/data_process/.ipynb_checkpoints/generate_test_json-checkpoint.py: -------------------------------------------------------------------------------- 1 | import json 2 | import os 3 | from glob import glob 4 | from tqdm import tqdm 5 | from PIL import Image 6 | from mmdet.core import road_classes 7 | label_ids = {name: i + 1 for i, name in enumerate(road_classes())} 8 | 9 | 10 | def save(images, annotations): 11 | ann = {} 12 | ann['type'] = 'instances' 13 | ann['images'] = images 14 | ann['annotations'] = annotations 15 | 16 | categories = [] 17 | for k, v in label_ids.items(): 18 | categories.append({"name": k, "id": v}) 19 | ann['categories'] = categories 20 | json.dump(ann, open('../data/test_B/testB.json', 'w')) 21 | 22 | 23 | def test_dataset(im_dir): 24 | im_list = glob(os.path.join(im_dir, '*.jpg')) 25 | idx = 1 26 | # image_id = 1 27 | images = [] 28 | annotations = [] 29 | for im_path in tqdm(im_list): 30 | image_id = int(os.path.basename(im_path).split('.')[0]) 31 | im = Image.open(im_path) 32 | w, h = im.size 33 | image = {'file_name': os.path.basename(im_path), 'width': w, 'height': h, 'id': image_id} 34 | images.append(image) 35 | labels = [[10, 10, 20, 20]] 36 | for label in labels: 37 | bbox = [label[0], label[1], label[2] - label[0], label[3] - label[1]] 38 | seg = [] 39 | ann = {'segmentation': [seg], 'area': bbox[2] * bbox[3], 'iscrowd': 0, 'image_id': image_id, 40 | 'bbox': bbox, 'category_id': 1, 'id': idx, 'ignore': 0} 41 | idx += 1 42 | annotations.append(ann) 43 | save(images, annotations) 44 | 45 | 46 | if __name__ == '__main__': 47 | test_dir = '../data/test_B/images' 48 | # test_dir = '../data/test-B-image/' 49 | print("generate test json label file.") 50 | test_dataset(test_dir) -------------------------------------------------------------------------------- /code/tools/get_flops.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | 3 | from mmcv import Config 4 | 5 | from mmdet.models import build_detector 6 | from mmdet.utils import get_model_complexity_info 7 | 8 | 9 | def parse_args(): 10 | parser = argparse.ArgumentParser(description='Train a detector') 11 | parser.add_argument('config', help='train config file path') 12 | parser.add_argument( 13 | '--shape', 14 | type=int, 15 | nargs='+', 16 | default=[1280, 800], 17 | help='input image size') 18 | args = parser.parse_args() 19 | return args 20 | 21 | 22 | def main(): 23 | 24 | args = parse_args() 25 | 26 | if len(args.shape) == 1: 27 | input_shape = (3, args.shape[0], args.shape[0]) 28 | elif len(args.shape) == 2: 29 | input_shape = (3, ) + tuple(args.shape) 30 | else: 31 | raise ValueError('invalid input shape') 32 | 33 | cfg = Config.fromfile(args.config) 34 | model = build_detector( 35 | cfg.model, train_cfg=cfg.train_cfg, test_cfg=cfg.test_cfg).cuda() 36 | model.eval() 37 | 38 | if hasattr(model, 'forward_dummy'): 39 | model.forward = model.forward_dummy 40 | else: 41 | raise NotImplementedError( 42 | 'FLOPs counter is currently not currently supported with {}'. 43 | format(model.__class__.__name__)) 44 | 45 | flops, params = get_model_complexity_info(model, input_shape) 46 | split_line = '=' * 30 47 | print('{0}\nInput shape: {1}\nFlops: {2}\nParams: {3}\n{0}'.format( 48 | split_line, input_shape, flops, params)) 49 | print('!!!Please be cautious if you use the results in papers. ' 50 | 'You may need to check if all ops are supported and verify that the ' 51 | 'flops computation is correct.') 52 | 53 | 54 | if __name__ == '__main__': 55 | main() 56 | -------------------------------------------------------------------------------- /code/mmdet/core/evaluation/bbox_overlaps.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | 4 | def bbox_overlaps(bboxes1, bboxes2, mode='iou', eps=1e-6): 5 | """Calculate the ious between each bbox of bboxes1 and bboxes2. 6 | 7 | Args: 8 | bboxes1(ndarray): shape (n, 4) 9 | bboxes2(ndarray): shape (k, 4) 10 | mode(str): iou (intersection over union) or iof (intersection 11 | over foreground) 12 | 13 | Returns: 14 | ious(ndarray): shape (n, k) 15 | """ 16 | 17 | assert mode in ['iou', 'iof'] 18 | 19 | bboxes1 = bboxes1.astype(np.float32) 20 | bboxes2 = bboxes2.astype(np.float32) 21 | rows = bboxes1.shape[0] 22 | cols = bboxes2.shape[0] 23 | ious = np.zeros((rows, cols), dtype=np.float32) 24 | if rows * cols == 0: 25 | return ious 26 | exchange = False 27 | if bboxes1.shape[0] > bboxes2.shape[0]: 28 | bboxes1, bboxes2 = bboxes2, bboxes1 29 | ious = np.zeros((cols, rows), dtype=np.float32) 30 | exchange = True 31 | area1 = (bboxes1[:, 2] - bboxes1[:, 0]) * (bboxes1[:, 3] - bboxes1[:, 1]) 32 | area2 = (bboxes2[:, 2] - bboxes2[:, 0]) * (bboxes2[:, 3] - bboxes2[:, 1]) 33 | for i in range(bboxes1.shape[0]): 34 | x_start = np.maximum(bboxes1[i, 0], bboxes2[:, 0]) 35 | y_start = np.maximum(bboxes1[i, 1], bboxes2[:, 1]) 36 | x_end = np.minimum(bboxes1[i, 2], bboxes2[:, 2]) 37 | y_end = np.minimum(bboxes1[i, 3], bboxes2[:, 3]) 38 | overlap = np.maximum(x_end - x_start, 0) * np.maximum( 39 | y_end - y_start, 0) 40 | if mode == 'iou': 41 | union = area1[i] + area2 - overlap 42 | else: 43 | union = area1[i] if not exchange else area2 44 | union = np.maximum(union, eps) 45 | ious[i, :] = overlap / union 46 | if exchange: 47 | ious = ious.T 48 | return ious 49 | -------------------------------------------------------------------------------- /code/tools/data_process/split_data_clean.py: -------------------------------------------------------------------------------- 1 | import glob, tqdm, shutil, os 2 | import random 3 | 4 | random.seed(11) 5 | 6 | if __name__ == '__main__': 7 | data_root = '../data/train/image' 8 | image_paths = glob.glob(data_root + '/*.jpg') 9 | 10 | clean_paths = [] 11 | u_paths =[] 12 | for path in image_paths: 13 | basename = os.path.basename(path) 14 | if basename[0] == 'c': 15 | clean_paths.append(path) 16 | else: 17 | u_paths.append(path) 18 | 19 | 20 | # 划分数据集, 从干净数据集中选10%作为验证集, 剩下的干净数据和噪声数据作为训练集 21 | val_size = int(len(image_paths) * 0.1) 22 | val_paths = clean_paths[:val_size] 23 | train_paths = clean_paths[val_size:] + u_paths 24 | 25 | os.makedirs('../data/train/train-image/', exist_ok=True) 26 | os.makedirs('../data/train/train-box/', exist_ok=True) 27 | os.makedirs('../data/train/val-image/', exist_ok=True) 28 | os.makedirs('../data/train/val-box/', exist_ok=True) 29 | 30 | for path in tqdm.tqdm(train_paths): 31 | base_name = os.path.basename(path) 32 | dst_name = os.path.join('../data/train/train-image', base_name) 33 | xml_name = base_name.split('.')[0] + '.xml' 34 | xml_src_path = os.path.join('../data/train/box', xml_name) 35 | xml_dst_path = os.path.join('../data/train/train-box', xml_name) 36 | shutil.copy(path, dst_name) 37 | shutil.copy(xml_src_path, xml_dst_path) 38 | 39 | for path in tqdm.tqdm(val_paths): 40 | base_name = os.path.basename(path) 41 | dst_name = os.path.join('../data/train/val-image', base_name) 42 | xml_name = base_name.split('.')[0] + '.xml' 43 | xml_src_path = os.path.join('../data/train/box', xml_name) 44 | xml_dst_path = os.path.join('../data/train/val-box', xml_name) 45 | shutil.copy(path, dst_name) 46 | shutil.copy(xml_src_path, xml_dst_path) -------------------------------------------------------------------------------- /code/mmdet/models/roi_heads/__init__.py: -------------------------------------------------------------------------------- 1 | from .base_roi_head import BaseRoIHead 2 | from .bbox_heads import (BBoxHead, ConvFCBBoxHead, DoubleConvFCBBoxHead, 3 | SCNetBBoxHead, Shared2FCBBoxHead, 4 | Shared4Conv1FCBBoxHead) 5 | from .cascade_roi_head import CascadeRoIHead 6 | from .double_roi_head import DoubleHeadRoIHead 7 | from .dynamic_roi_head import DynamicRoIHead 8 | from .grid_roi_head import GridRoIHead 9 | from .htc_roi_head import HybridTaskCascadeRoIHead 10 | from .mask_heads import (CoarseMaskHead, FCNMaskHead, FeatureRelayHead, 11 | FusedSemanticHead, GlobalContextHead, GridHead, 12 | HTCMaskHead, MaskIoUHead, MaskPointHead, 13 | SCNetMaskHead, SCNetSemanticHead) 14 | from .mask_scoring_roi_head import MaskScoringRoIHead 15 | from .pisa_roi_head import PISARoIHead 16 | from .point_rend_roi_head import PointRendRoIHead 17 | from .roi_extractors import SingleRoIExtractor 18 | from .scnet_roi_head import SCNetRoIHead 19 | from .shared_heads import ResLayer 20 | from .sparse_roi_head import SparseRoIHead 21 | from .standard_roi_head import StandardRoIHead 22 | from .trident_roi_head import TridentRoIHead 23 | 24 | __all__ = [ 25 | 'BaseRoIHead', 'CascadeRoIHead', 'DoubleHeadRoIHead', 'MaskScoringRoIHead', 26 | 'HybridTaskCascadeRoIHead', 'GridRoIHead', 'ResLayer', 'BBoxHead', 27 | 'ConvFCBBoxHead', 'Shared2FCBBoxHead', 'StandardRoIHead', 28 | 'Shared4Conv1FCBBoxHead', 'DoubleConvFCBBoxHead', 'FCNMaskHead', 29 | 'HTCMaskHead', 'FusedSemanticHead', 'GridHead', 'MaskIoUHead', 30 | 'SingleRoIExtractor', 'PISARoIHead', 'PointRendRoIHead', 'MaskPointHead', 31 | 'CoarseMaskHead', 'DynamicRoIHead', 'SparseRoIHead', 'TridentRoIHead', 32 | 'SCNetRoIHead', 'SCNetMaskHead', 'SCNetSemanticHead', 'SCNetBBoxHead', 33 | 'FeatureRelayHead', 'GlobalContextHead' 34 | ] 35 | -------------------------------------------------------------------------------- /code/tools/data_process/.ipynb_checkpoints/split_data_clean-checkpoint.py: -------------------------------------------------------------------------------- 1 | import glob, tqdm, shutil, os 2 | import random 3 | 4 | random.seed(11) 5 | 6 | if __name__ == '__main__': 7 | data_root = '../data/train/image' 8 | image_paths = glob.glob(data_root + '/*.jpg') 9 | 10 | clean_paths = [] 11 | u_paths =[] 12 | for path in image_paths: 13 | basename = os.path.basename(path) 14 | if basename[0] == 'c': 15 | clean_paths.append(path) 16 | else: 17 | u_paths.append(path) 18 | 19 | 20 | # 划分数据集, 从干净数据集中选10%作为验证集, 剩下的干净数据和噪声数据作为训练集 21 | val_size = int(len(image_paths) * 0.1) 22 | val_paths = clean_paths[:val_size] 23 | train_paths = clean_paths[val_size:] + u_paths 24 | 25 | os.makedirs('../data/train/train-image/', exist_ok=True) 26 | os.makedirs('../data/train/train-box/', exist_ok=True) 27 | os.makedirs('../data/train/val-image/', exist_ok=True) 28 | os.makedirs('../data/train/val-box/', exist_ok=True) 29 | 30 | for path in tqdm.tqdm(train_paths): 31 | base_name = os.path.basename(path) 32 | dst_name = os.path.join('../data/train/train-image', base_name) 33 | xml_name = base_name.split('.')[0] + '.xml' 34 | xml_src_path = os.path.join('../data/train/box', xml_name) 35 | xml_dst_path = os.path.join('../data/train/train-box', xml_name) 36 | shutil.copy(path, dst_name) 37 | shutil.copy(xml_src_path, xml_dst_path) 38 | 39 | for path in tqdm.tqdm(val_paths): 40 | base_name = os.path.basename(path) 41 | dst_name = os.path.join('../data/train/val-image', base_name) 42 | xml_name = base_name.split('.')[0] + '.xml' 43 | xml_src_path = os.path.join('../data/train/box', xml_name) 44 | xml_dst_path = os.path.join('../data/train/val-box', xml_name) 45 | shutil.copy(path, dst_name) 46 | shutil.copy(xml_src_path, xml_dst_path) -------------------------------------------------------------------------------- /code/mmdet/models/detectors/detr.py: -------------------------------------------------------------------------------- 1 | from mmdet.core import bbox2result 2 | from ..builder import DETECTORS 3 | from .single_stage import SingleStageDetector 4 | 5 | 6 | @DETECTORS.register_module() 7 | class DETR(SingleStageDetector): 8 | r"""Implementation of `DETR: End-to-End Object Detection with 9 | Transformers `_""" 10 | 11 | def __init__(self, 12 | backbone, 13 | bbox_head, 14 | train_cfg=None, 15 | test_cfg=None, 16 | pretrained=None): 17 | super(DETR, self).__init__(backbone, None, bbox_head, train_cfg, 18 | test_cfg, pretrained) 19 | 20 | def simple_test(self, img, img_metas, rescale=False): 21 | """Test function without test time augmentation. 22 | 23 | Args: 24 | imgs (list[torch.Tensor]): List of multiple images 25 | img_metas (list[dict]): List of image information. 26 | rescale (bool, optional): Whether to rescale the results. 27 | Defaults to False. 28 | 29 | Returns: 30 | list[list[np.ndarray]]: BBox results of each image and classes. 31 | The outer list corresponds to each image. The inner list 32 | corresponds to each class. 33 | """ 34 | batch_size = len(img_metas) 35 | assert batch_size == 1, 'Currently only batch_size 1 for inference ' \ 36 | f'mode is supported. Found batch_size {batch_size}.' 37 | x = self.extract_feat(img) 38 | outs = self.bbox_head(x, img_metas) 39 | bbox_list = self.bbox_head.get_bboxes( 40 | *outs, img_metas, rescale=rescale) 41 | 42 | bbox_results = [ 43 | bbox2result(det_bboxes, det_labels, self.bbox_head.num_classes) 44 | for det_bboxes, det_labels in bbox_list 45 | ] 46 | return bbox_results 47 | -------------------------------------------------------------------------------- /code/mmdet/models/dense_heads/__init__.py: -------------------------------------------------------------------------------- 1 | from .anchor_free_head import AnchorFreeHead 2 | from .anchor_head import AnchorHead 3 | from .atss_head import ATSSHead 4 | from .cascade_rpn_head import CascadeRPNHead, StageCascadeRPNHead 5 | from .centripetal_head import CentripetalHead 6 | from .corner_head import CornerHead 7 | from .embedding_rpn_head import EmbeddingRPNHead 8 | from .fcos_head import FCOSHead 9 | from .fovea_head import FoveaHead 10 | from .free_anchor_retina_head import FreeAnchorRetinaHead 11 | from .fsaf_head import FSAFHead 12 | from .ga_retina_head import GARetinaHead 13 | from .ga_rpn_head import GARPNHead 14 | from .gfl_head import GFLHead 15 | from .guided_anchor_head import FeatureAdaption, GuidedAnchorHead 16 | from .nasfcos_head import NASFCOSHead 17 | from .paa_head import PAAHead 18 | from .pisa_retinanet_head import PISARetinaHead 19 | from .pisa_ssd_head import PISASSDHead 20 | from .reppoints_head import RepPointsHead 21 | from .retina_head import RetinaHead 22 | from .retina_sepbn_head import RetinaSepBNHead 23 | from .rpn_head import RPNHead 24 | from .sabl_retina_head import SABLRetinaHead 25 | from .ssd_head import SSDHead 26 | from .transformer_head import TransformerHead 27 | from .vfnet_head import VFNetHead 28 | from .yolact_head import YOLACTHead, YOLACTProtonet, YOLACTSegmHead 29 | from .yolo_head import YOLOV3Head 30 | 31 | __all__ = [ 32 | 'AnchorFreeHead', 'AnchorHead', 'GuidedAnchorHead', 'FeatureAdaption', 33 | 'RPNHead', 'GARPNHead', 'RetinaHead', 'RetinaSepBNHead', 'GARetinaHead', 34 | 'SSDHead', 'FCOSHead', 'RepPointsHead', 'FoveaHead', 35 | 'FreeAnchorRetinaHead', 'ATSSHead', 'FSAFHead', 'NASFCOSHead', 36 | 'PISARetinaHead', 'PISASSDHead', 'GFLHead', 'CornerHead', 'YOLACTHead', 37 | 'YOLACTSegmHead', 'YOLACTProtonet', 'YOLOV3Head', 'PAAHead', 38 | 'SABLRetinaHead', 'CentripetalHead', 'VFNetHead', 'TransformerHead', 39 | 'StageCascadeRPNHead', 'CascadeRPNHead', 'EmbeddingRPNHead' 40 | ] 41 | -------------------------------------------------------------------------------- /code/mmdet/models/backbones/base_backbone.py: -------------------------------------------------------------------------------- 1 | import logging 2 | from abc import ABCMeta, abstractmethod 3 | 4 | import torch.nn as nn 5 | from mmcv.runner import load_checkpoint 6 | 7 | 8 | class BaseBackbone(nn.Module, metaclass=ABCMeta): 9 | """Base backbone. 10 | This class defines the basic functions of a backbone. 11 | Any backbone that inherits this class should at least 12 | define its own `forward` function. 13 | """ 14 | 15 | def __init__(self): 16 | super(BaseBackbone, self).__init__() 17 | 18 | def init_weights(self, pretrained=None): 19 | """Init backbone weights 20 | Args: 21 | pretrained (str | None): If pretrained is a string, then it 22 | initializes backbone weights by loading the pretrained 23 | checkpoint. If pretrained is None, then it follows default 24 | initializer or customized initializer in subclasses. 25 | """ 26 | if isinstance(pretrained, str): 27 | logger = logging.getLogger() 28 | load_checkpoint(self, pretrained, strict=False, logger=logger) 29 | elif pretrained is None: 30 | # use default initializer or customized initializer in subclasses 31 | pass 32 | else: 33 | raise TypeError('pretrained must be a str or None.' 34 | f' But received {type(pretrained)}.') 35 | 36 | @abstractmethod 37 | def forward(self, x): 38 | """Forward computation 39 | Args: 40 | x (tensor | tuple[tensor]): x could be a Torch.tensor or a tuple of 41 | Torch.tensor, containing input data for forward computation. 42 | """ 43 | pass 44 | 45 | def train(self, mode=True): 46 | """Set module status before forward computation 47 | Args: 48 | mode (bool): Whether it is train_mode or test_mode 49 | """ 50 | super(BaseBackbone, self).train(mode) --------------------------------------------------------------------------------