├── CDARTS ├── _init_paths.py ├── cells │ ├── cifar_genotype.json │ ├── dartsv1_genotype.json │ ├── dartsv2_genotype.json │ ├── imagenet_genotype.json │ ├── pcdarts_cifar_genotype.json │ ├── pcdarts_imagenet_genotype.json │ └── pdarts_genotype.json ├── retrain.py ├── scripts │ ├── run_retrain_cifar_1gpu.sh │ ├── run_retrain_cifar_4gpus.sh │ ├── run_retrain_imagenet.sh │ ├── run_search_cifar_1gpu.sh │ ├── run_search_cifar_4gpus.sh │ ├── run_search_imagenet.sh │ ├── run_test_cifar.sh │ └── run_test_imagenet.sh ├── search.py └── test.py ├── CDARTS_detection ├── README.md ├── compile.sh ├── configs │ └── CyDAS_retinanet_1x.py ├── env.sh ├── mmcv │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-36.pyc │ │ ├── opencv_info.cpython-36.pyc │ │ └── version.cpython-36.pyc │ ├── _ext.cpython-36m-x86_64-linux-gnu.so │ ├── arraymisc │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ └── quantization.cpython-36.pyc │ │ └── quantization.py │ ├── cnn │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── alexnet.cpython-36.pyc │ │ │ ├── resnet.cpython-36.pyc │ │ │ ├── vgg.cpython-36.pyc │ │ │ └── weight_init.cpython-36.pyc │ │ ├── alexnet.py │ │ ├── resnet.py │ │ ├── vgg.py │ │ └── weight_init.py │ ├── fileio │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── io.cpython-36.pyc │ │ │ └── parse.cpython-36.pyc │ │ ├── handlers │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ ├── base.cpython-36.pyc │ │ │ │ ├── json_handler.cpython-36.pyc │ │ │ │ ├── pickle_handler.cpython-36.pyc │ │ │ │ └── yaml_handler.cpython-36.pyc │ │ │ ├── base.py │ │ │ ├── json_handler.py │ │ │ ├── pickle_handler.py │ │ │ └── yaml_handler.py │ │ ├── io.py │ │ └── parse.py │ ├── image │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ └── io.cpython-36.pyc │ │ ├── io.py │ │ └── transforms │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── colorspace.cpython-36.pyc │ │ │ ├── geometry.cpython-36.pyc │ │ │ ├── normalize.cpython-36.pyc │ │ │ └── resize.cpython-36.pyc │ │ │ ├── colorspace.py │ │ │ ├── geometry.py │ │ │ ├── normalize.py │ │ │ └── resize.py │ ├── opencv_info.py │ ├── parallel │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── _functions.cpython-36.pyc │ │ │ ├── collate.cpython-36.pyc │ │ │ ├── data_container.cpython-36.pyc │ │ │ ├── data_parallel.cpython-36.pyc │ │ │ ├── distributed.cpython-36.pyc │ │ │ └── scatter_gather.cpython-36.pyc │ │ ├── _functions.py │ │ ├── collate.py │ │ ├── data_container.py │ │ ├── data_parallel.py │ │ ├── distributed.py │ │ └── scatter_gather.py │ ├── runner │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── checkpoint.cpython-36.pyc │ │ │ ├── dist_utils.cpython-36.pyc │ │ │ ├── log_buffer.cpython-36.pyc │ │ │ ├── parallel_test.cpython-36.pyc │ │ │ ├── priority.cpython-36.pyc │ │ │ ├── runner.cpython-36.pyc │ │ │ └── utils.cpython-36.pyc │ │ ├── checkpoint.py │ │ ├── dist_utils.py │ │ ├── hooks │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ ├── checkpoint.cpython-36.pyc │ │ │ │ ├── closure.cpython-36.pyc │ │ │ │ ├── hook.cpython-36.pyc │ │ │ │ ├── iter_timer.cpython-36.pyc │ │ │ │ ├── lr_updater.cpython-36.pyc │ │ │ │ ├── memory.cpython-36.pyc │ │ │ │ ├── optimizer.cpython-36.pyc │ │ │ │ └── sampler_seed.cpython-36.pyc │ │ │ ├── checkpoint.py │ │ │ ├── closure.py │ │ │ ├── hook.py │ │ │ ├── iter_timer.py │ │ │ ├── logger │ │ │ │ ├── __init__.py │ │ │ │ ├── __pycache__ │ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ │ ├── base.cpython-36.pyc │ │ │ │ │ ├── pavi.cpython-36.pyc │ │ │ │ │ ├── tensorboard.cpython-36.pyc │ │ │ │ │ └── text.cpython-36.pyc │ │ │ │ ├── base.py │ │ │ │ ├── pavi.py │ │ │ │ ├── tensorboard.py │ │ │ │ └── text.py │ │ │ ├── lr_updater.py │ │ │ ├── memory.py │ │ │ ├── optimizer.py │ │ │ └── sampler_seed.py │ │ ├── log_buffer.py │ │ ├── parallel_test.py │ │ ├── priority.py │ │ ├── runner.py │ │ └── utils.py │ ├── utils │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── config.cpython-36.pyc │ │ │ ├── misc.cpython-36.pyc │ │ │ ├── path.cpython-36.pyc │ │ │ ├── progressbar.cpython-36.pyc │ │ │ └── timer.cpython-36.pyc │ │ ├── config.py │ │ ├── misc.py │ │ ├── path.py │ │ ├── progressbar.py │ │ └── timer.py │ ├── version.py │ ├── video │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── io.cpython-36.pyc │ │ │ ├── optflow.cpython-36.pyc │ │ │ └── processing.cpython-36.pyc │ │ ├── io.py │ │ ├── optflow.py │ │ ├── optflow_warp │ │ │ ├── __init__.py │ │ │ ├── flow_warp.cpp │ │ │ ├── flow_warp.hpp │ │ │ ├── flow_warp_module.cpp │ │ │ └── flow_warp_module.pyx │ │ └── processing.py │ └── visualization │ │ ├── __init__.py │ │ ├── __pycache__ │ │ ├── __init__.cpython-36.pyc │ │ ├── color.cpython-36.pyc │ │ ├── image.cpython-36.pyc │ │ └── optflow.cpython-36.pyc │ │ ├── color.py │ │ ├── image.py │ │ └── optflow.py ├── mmdet.egg-info │ ├── PKG-INFO │ ├── SOURCES.txt │ ├── dependency_links.txt │ ├── not-zip-safe │ ├── requires.txt │ └── top_level.txt ├── mmdet │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-36.pyc │ │ └── version.cpython-36.pyc │ ├── apis │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── env.cpython-36.pyc │ │ │ ├── inference.cpython-36.pyc │ │ │ └── train.cpython-36.pyc │ │ ├── env.py │ │ ├── inference.py │ │ └── train.py │ ├── core │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ └── __init__.cpython-36.pyc │ │ ├── anchor │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ ├── anchor_generator.cpython-36.pyc │ │ │ │ ├── anchor_target.cpython-36.pyc │ │ │ │ └── guided_anchor_target.cpython-36.pyc │ │ │ ├── anchor_generator.py │ │ │ ├── anchor_target.py │ │ │ └── guided_anchor_target.py │ │ ├── bbox │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ ├── assign_sampling.cpython-36.pyc │ │ │ │ ├── bbox_target.cpython-36.pyc │ │ │ │ ├── geometry.cpython-36.pyc │ │ │ │ └── transforms.cpython-36.pyc │ │ │ ├── assign_sampling.py │ │ │ ├── assigners │ │ │ │ ├── __init__.py │ │ │ │ ├── __pycache__ │ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ │ ├── approx_max_iou_assigner.cpython-36.pyc │ │ │ │ │ ├── assign_result.cpython-36.pyc │ │ │ │ │ ├── base_assigner.cpython-36.pyc │ │ │ │ │ └── max_iou_assigner.cpython-36.pyc │ │ │ │ ├── approx_max_iou_assigner.py │ │ │ │ ├── assign_result.py │ │ │ │ ├── base_assigner.py │ │ │ │ └── max_iou_assigner.py │ │ │ ├── bbox_target.py │ │ │ ├── geometry.py │ │ │ ├── samplers │ │ │ │ ├── __init__.py │ │ │ │ ├── __pycache__ │ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ │ ├── base_sampler.cpython-36.pyc │ │ │ │ │ ├── combined_sampler.cpython-36.pyc │ │ │ │ │ ├── instance_balanced_pos_sampler.cpython-36.pyc │ │ │ │ │ ├── iou_balanced_neg_sampler.cpython-36.pyc │ │ │ │ │ ├── ohem_sampler.cpython-36.pyc │ │ │ │ │ ├── pseudo_sampler.cpython-36.pyc │ │ │ │ │ ├── random_sampler.cpython-36.pyc │ │ │ │ │ └── sampling_result.cpython-36.pyc │ │ │ │ ├── base_sampler.py │ │ │ │ ├── combined_sampler.py │ │ │ │ ├── instance_balanced_pos_sampler.py │ │ │ │ ├── iou_balanced_neg_sampler.py │ │ │ │ ├── ohem_sampler.py │ │ │ │ ├── pseudo_sampler.py │ │ │ │ ├── random_sampler.py │ │ │ │ └── sampling_result.py │ │ │ └── transforms.py │ │ ├── evaluation │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ ├── bbox_overlaps.cpython-36.pyc │ │ │ │ ├── class_names.cpython-36.pyc │ │ │ │ ├── eval_hooks.cpython-36.pyc │ │ │ │ ├── mean_ap.cpython-36.pyc │ │ │ │ └── recall.cpython-36.pyc │ │ │ ├── bbox_overlaps.py │ │ │ ├── class_names.py │ │ │ ├── coco_utils.py │ │ │ ├── eval_hooks.py │ │ │ ├── mean_ap.py │ │ │ └── recall.py │ │ ├── fp16 │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ ├── decorators.cpython-36.pyc │ │ │ │ ├── hooks.cpython-36.pyc │ │ │ │ └── utils.cpython-36.pyc │ │ │ ├── decorators.py │ │ │ ├── hooks.py │ │ │ └── utils.py │ │ ├── mask │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ ├── mask_target.cpython-36.pyc │ │ │ │ └── utils.cpython-36.pyc │ │ │ ├── mask_target.py │ │ │ └── utils.py │ │ ├── post_processing │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ ├── bbox_nms.cpython-36.pyc │ │ │ │ └── merge_augs.cpython-36.pyc │ │ │ ├── bbox_nms.py │ │ │ └── merge_augs.py │ │ └── utils │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── dist_utils.cpython-36.pyc │ │ │ └── misc.cpython-36.pyc │ │ │ ├── dist_utils.py │ │ │ └── misc.py │ ├── datasets │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── builder.cpython-36.pyc │ │ │ ├── cityscapes.cpython-36.pyc │ │ │ ├── coco.cpython-36.pyc │ │ │ ├── custom.cpython-36.pyc │ │ │ ├── dataset_wrappers.cpython-36.pyc │ │ │ ├── registry.cpython-36.pyc │ │ │ ├── voc.cpython-36.pyc │ │ │ ├── wider_face.cpython-36.pyc │ │ │ └── xml_style.cpython-36.pyc │ │ ├── builder.py │ │ ├── cityscapes.py │ │ ├── coco.py │ │ ├── custom.py │ │ ├── dataset_wrappers.py │ │ ├── loader │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ ├── build_loader.cpython-36.pyc │ │ │ │ └── sampler.cpython-36.pyc │ │ │ ├── build_loader.py │ │ │ └── sampler.py │ │ ├── pipelines │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ ├── compose.cpython-36.pyc │ │ │ │ ├── formating.cpython-36.pyc │ │ │ │ ├── loading.cpython-36.pyc │ │ │ │ ├── test_aug.cpython-36.pyc │ │ │ │ └── transforms.cpython-36.pyc │ │ │ ├── compose.py │ │ │ ├── formating.py │ │ │ ├── loading.py │ │ │ ├── test_aug.py │ │ │ └── transforms.py │ │ ├── registry.py │ │ ├── transforms.py │ │ ├── utils.py │ │ ├── voc.py │ │ ├── wider_face.py │ │ └── xml_style.py │ ├── models │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── builder.cpython-36.pyc │ │ │ └── registry.cpython-36.pyc │ │ ├── anchor_heads │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ ├── anchor_head.cpython-36.pyc │ │ │ │ ├── fcos_head.cpython-36.pyc │ │ │ │ ├── ga_retina_head.cpython-36.pyc │ │ │ │ ├── ga_rpn_head.cpython-36.pyc │ │ │ │ ├── guided_anchor_head.cpython-36.pyc │ │ │ │ ├── retina_head.cpython-36.pyc │ │ │ │ ├── rpn_head.cpython-36.pyc │ │ │ │ └── ssd_head.cpython-36.pyc │ │ │ ├── anchor_head.py │ │ │ ├── fcos_head.py │ │ │ ├── ga_retina_head.py │ │ │ ├── ga_rpn_head.py │ │ │ ├── guided_anchor_head.py │ │ │ ├── retina_head.py │ │ │ ├── rpn_head.py │ │ │ └── ssd_head.py │ │ ├── backbones │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ ├── builder.cpython-36.pyc │ │ │ │ ├── detnas.cpython-36.pyc │ │ │ │ ├── dropblock.cpython-36.pyc │ │ │ │ ├── efficientnet.cpython-36.pyc │ │ │ │ ├── efficientnet_builder.cpython-36.pyc │ │ │ │ ├── fbnet.cpython-36.pyc │ │ │ │ ├── fbnet_arch.cpython-36.pyc │ │ │ │ ├── fbnet_blocks.cpython-36.pyc │ │ │ │ ├── feature_hooks.cpython-36.pyc │ │ │ │ ├── hrnet.cpython-36.pyc │ │ │ │ ├── mnasnet.cpython-36.pyc │ │ │ │ ├── mobilenetv2.cpython-36.pyc │ │ │ │ ├── mobilenetv3.cpython-36.pyc │ │ │ │ ├── resnet.cpython-36.pyc │ │ │ │ ├── resnext.cpython-36.pyc │ │ │ │ ├── ssd_vgg.cpython-36.pyc │ │ │ │ └── utils.cpython-36.pyc │ │ │ ├── builder.py │ │ │ ├── detnas.py │ │ │ ├── dropblock.py │ │ │ ├── efficientnet.py │ │ │ ├── efficientnet_builder.py │ │ │ ├── fbnet.py │ │ │ ├── fbnet_arch.py │ │ │ ├── fbnet_blocks.py │ │ │ ├── feature_hooks.py │ │ │ ├── hrnet.py │ │ │ ├── mnasnet.py │ │ │ ├── mobilenetv2.py │ │ │ ├── mobilenetv3.py │ │ │ ├── resnet.py │ │ │ ├── resnext.py │ │ │ ├── ssd_vgg.py │ │ │ └── utils.py │ │ ├── bbox_heads │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ ├── bbox_head.cpython-36.pyc │ │ │ │ ├── convfc_bbox_head.cpython-36.pyc │ │ │ │ └── double_bbox_head.cpython-36.pyc │ │ │ ├── auto_head │ │ │ │ ├── __init__.py │ │ │ │ ├── __pycache__ │ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ │ ├── build_head.cpython-36.pyc │ │ │ │ │ ├── mbblock_head_search.cpython-36.pyc │ │ │ │ │ └── mbblock_ops.cpython-36.pyc │ │ │ │ ├── build_head.py │ │ │ │ ├── mbblock_head_search.py │ │ │ │ └── mbblock_ops.py │ │ │ ├── bbox_head.py │ │ │ ├── convfc_bbox_head.py │ │ │ └── double_bbox_head.py │ │ ├── builder.py │ │ ├── detectors │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ ├── base.cpython-36.pyc │ │ │ │ ├── cascade_rcnn.cpython-36.pyc │ │ │ │ ├── double_head_rcnn.cpython-36.pyc │ │ │ │ ├── fast_rcnn.cpython-36.pyc │ │ │ │ ├── faster_rcnn.cpython-36.pyc │ │ │ │ ├── fcos.cpython-36.pyc │ │ │ │ ├── grid_rcnn.cpython-36.pyc │ │ │ │ ├── htc.cpython-36.pyc │ │ │ │ ├── mask_rcnn.cpython-36.pyc │ │ │ │ ├── mask_scoring_rcnn.cpython-36.pyc │ │ │ │ ├── retinanet.cpython-36.pyc │ │ │ │ ├── rpn.cpython-36.pyc │ │ │ │ ├── single_stage.cpython-36.pyc │ │ │ │ ├── test_mixins.cpython-36.pyc │ │ │ │ └── two_stage.cpython-36.pyc │ │ │ ├── base.py │ │ │ ├── cascade_rcnn.py │ │ │ ├── double_head_rcnn.py │ │ │ ├── fast_rcnn.py │ │ │ ├── faster_rcnn.py │ │ │ ├── fcos.py │ │ │ ├── grid_rcnn.py │ │ │ ├── htc.py │ │ │ ├── mask_rcnn.py │ │ │ ├── mask_scoring_rcnn.py │ │ │ ├── retinanet.py │ │ │ ├── rpn.py │ │ │ ├── single_stage.py │ │ │ ├── test_mixins.py │ │ │ └── two_stage.py │ │ ├── losses │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ ├── accuracy.cpython-36.pyc │ │ │ │ ├── balanced_l1_loss.cpython-36.pyc │ │ │ │ ├── cross_entropy_loss.cpython-36.pyc │ │ │ │ ├── focal_loss.cpython-36.pyc │ │ │ │ ├── ghm_loss.cpython-36.pyc │ │ │ │ ├── iou_loss.cpython-36.pyc │ │ │ │ ├── mse_loss.cpython-36.pyc │ │ │ │ ├── smooth_l1_loss.cpython-36.pyc │ │ │ │ └── utils.cpython-36.pyc │ │ │ ├── accuracy.py │ │ │ ├── balanced_l1_loss.py │ │ │ ├── cross_entropy_loss.py │ │ │ ├── focal_loss.py │ │ │ ├── ghm_loss.py │ │ │ ├── iou_loss.py │ │ │ ├── mse_loss.py │ │ │ ├── smooth_l1_loss.py │ │ │ └── utils.py │ │ ├── mask_heads │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ ├── fcn_mask_head.cpython-36.pyc │ │ │ │ ├── fused_semantic_head.cpython-36.pyc │ │ │ │ ├── grid_head.cpython-36.pyc │ │ │ │ ├── htc_mask_head.cpython-36.pyc │ │ │ │ └── maskiou_head.cpython-36.pyc │ │ │ ├── fcn_mask_head.py │ │ │ ├── fused_semantic_head.py │ │ │ ├── grid_head.py │ │ │ ├── htc_mask_head.py │ │ │ └── maskiou_head.py │ │ ├── necks │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ ├── bfp.cpython-36.pyc │ │ │ │ ├── fpn.cpython-36.pyc │ │ │ │ ├── fpn_panet.cpython-36.pyc │ │ │ │ ├── hrfpn.cpython-36.pyc │ │ │ │ ├── nas_fpn.cpython-36.pyc │ │ │ │ └── search_pafpn.cpython-36.pyc │ │ │ ├── auto_neck │ │ │ │ ├── __init__.py │ │ │ │ ├── __pycache__ │ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ │ ├── build_neck.cpython-36.pyc │ │ │ │ │ ├── hit_neck_search.cpython-36.pyc │ │ │ │ │ └── hit_ops.cpython-36.pyc │ │ │ │ ├── build_neck.py │ │ │ │ ├── hit_neck_search.py │ │ │ │ └── hit_ops.py │ │ │ ├── bfp.py │ │ │ ├── fpn.py │ │ │ ├── fpn_panet.py │ │ │ ├── hrfpn.py │ │ │ ├── nas_fpn.py │ │ │ └── search_pafpn.py │ │ ├── plugins │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ ├── generalized_attention.cpython-36.pyc │ │ │ │ └── non_local.cpython-36.pyc │ │ │ ├── generalized_attention.py │ │ │ └── non_local.py │ │ ├── registry.py │ │ ├── roi_extractors │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ └── single_level.cpython-36.pyc │ │ │ └── single_level.py │ │ ├── shared_heads │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ └── res_layer.cpython-36.pyc │ │ │ └── res_layer.py │ │ └── utils │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── conv_module.cpython-36.pyc │ │ │ ├── conv_ws.cpython-36.pyc │ │ │ ├── norm.cpython-36.pyc │ │ │ ├── quant_conv.cpython-36.pyc │ │ │ ├── scale.cpython-36.pyc │ │ │ └── weight_init.cpython-36.pyc │ │ │ ├── conv_module.py │ │ │ ├── conv_ws.py │ │ │ ├── norm.py │ │ │ ├── quant_conv.py │ │ │ ├── scale.py │ │ │ └── weight_init.py │ ├── ops │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ └── __init__.cpython-36.pyc │ │ ├── dcn │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ └── __init__.cpython-36.pyc │ │ │ ├── functions │ │ │ │ ├── __init__.py │ │ │ │ ├── __pycache__ │ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ │ ├── deform_conv.cpython-36.pyc │ │ │ │ │ └── deform_pool.cpython-36.pyc │ │ │ │ ├── deform_conv.py │ │ │ │ └── deform_pool.py │ │ │ ├── modules │ │ │ │ ├── __init__.py │ │ │ │ ├── __pycache__ │ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ │ ├── deform_conv.cpython-36.pyc │ │ │ │ │ └── deform_pool.cpython-36.pyc │ │ │ │ ├── deform_conv.py │ │ │ │ └── deform_pool.py │ │ │ ├── setup.py │ │ │ └── src │ │ │ │ ├── deform_conv_cuda.cpp │ │ │ │ ├── deform_conv_cuda_kernel.cu │ │ │ │ ├── deform_pool_cuda.cpp │ │ │ │ └── deform_pool_cuda_kernel.cu │ │ ├── gcb │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ └── context_block.cpython-36.pyc │ │ │ └── context_block.py │ │ ├── masked_conv │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ └── __init__.cpython-36.pyc │ │ │ ├── functions │ │ │ │ ├── __init__.py │ │ │ │ ├── __pycache__ │ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ │ └── masked_conv.cpython-36.pyc │ │ │ │ └── masked_conv.py │ │ │ ├── modules │ │ │ │ ├── __init__.py │ │ │ │ ├── __pycache__ │ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ │ └── masked_conv.cpython-36.pyc │ │ │ │ └── masked_conv.py │ │ │ ├── setup.py │ │ │ └── src │ │ │ │ ├── masked_conv2d_cuda.cpp │ │ │ │ └── masked_conv2d_kernel.cu │ │ ├── nms │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ └── nms_wrapper.cpython-36.pyc │ │ │ ├── nms_wrapper.py │ │ │ ├── setup.py │ │ │ └── src │ │ │ │ ├── nms_cpu.cpp │ │ │ │ ├── nms_cuda.cpp │ │ │ │ ├── nms_kernel.cu │ │ │ │ ├── soft_nms_cpu.cpp │ │ │ │ └── soft_nms_cpu.pyx │ │ ├── roi_align │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ └── roi_align.cpython-36.pyc │ │ │ ├── functions │ │ │ │ ├── __init__.py │ │ │ │ └── roi_align.py │ │ │ ├── gradcheck.py │ │ │ ├── modules │ │ │ │ ├── __init__.py │ │ │ │ └── roi_align.py │ │ │ ├── roi_align.py │ │ │ ├── setup.py │ │ │ └── src │ │ │ │ ├── roi_align_cuda.cpp │ │ │ │ └── roi_align_kernel.cu │ │ ├── roi_pool │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ └── __init__.cpython-36.pyc │ │ │ ├── functions │ │ │ │ ├── __init__.py │ │ │ │ ├── __pycache__ │ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ │ └── roi_pool.cpython-36.pyc │ │ │ │ └── roi_pool.py │ │ │ ├── gradcheck.py │ │ │ ├── modules │ │ │ │ ├── __init__.py │ │ │ │ ├── __pycache__ │ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ │ └── roi_pool.cpython-36.pyc │ │ │ │ └── roi_pool.py │ │ │ ├── setup.py │ │ │ └── src │ │ │ │ ├── roi_pool_cuda.cpp │ │ │ │ └── roi_pool_kernel.cu │ │ └── sigmoid_focal_loss │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ └── __init__.cpython-36.pyc │ │ │ ├── functions │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ └── sigmoid_focal_loss.cpython-36.pyc │ │ │ └── sigmoid_focal_loss.py │ │ │ ├── modules │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ └── sigmoid_focal_loss.cpython-36.pyc │ │ │ └── sigmoid_focal_loss.py │ │ │ ├── setup.py │ │ │ └── src │ │ │ ├── sigmoid_focal_loss.cpp │ │ │ └── sigmoid_focal_loss_cuda.cu │ ├── utils │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── collect_env.cpython-36.pyc │ │ │ ├── flops_counter.cpython-36.pyc │ │ │ ├── logger.cpython-36.pyc │ │ │ └── registry.cpython-36.pyc │ │ ├── collect_env.py │ │ ├── contextmanagers.py │ │ ├── flops_counter.py │ │ ├── logger.py │ │ ├── profiling.py │ │ ├── registry.py │ │ └── util_mixins.py │ └── version.py ├── scripts │ └── train_hit_det.sh ├── setup.py ├── test.py ├── tools │ ├── analyze_logs.py │ ├── coco_eval.py │ ├── convert_datasets │ │ └── pascal_voc.py │ ├── detectron2pytorch.py │ ├── dist_test.sh │ ├── dist_train.sh │ ├── get_flops.py │ ├── publish_model.py │ ├── slurm_test.sh │ ├── slurm_train.sh │ ├── test.py │ ├── upgrade_model_version.py │ └── voc_eval.py ├── train.py └── train.sh ├── CDARTS_segmentation ├── LICENSE ├── README.md ├── configs │ ├── ade │ │ └── cydas.yaml │ └── cityscapes │ │ └── cydas.yaml ├── dataloaders │ ├── __init__.py │ ├── custom_transforms.py │ ├── dataloader_utils.py │ ├── datasets │ │ ├── __init__.py │ │ ├── cityscapes.py │ │ ├── coco.py │ │ ├── combine_dbs.py │ │ ├── kd.py │ │ ├── pascal.py │ │ └── sbd.py │ ├── segdatasets │ │ ├── __init__.py │ │ ├── base_dataset.py │ │ ├── cityscapes.py │ │ ├── cityscapes_panoptic.py │ │ ├── coco_panoptic.py │ │ └── utils.py │ └── transforms │ │ ├── __init__.py │ │ ├── build.py │ │ ├── pre_augmentation_transforms.py │ │ ├── target_transforms.py │ │ └── transforms.py ├── install.sh ├── segmentation │ ├── __init__.py │ ├── config │ │ ├── __init__.py │ │ ├── default.py │ │ └── hrnet_config.py │ ├── data │ │ ├── __init__.py │ │ ├── build.py │ │ ├── datasets │ │ │ ├── __init__.py │ │ │ ├── base_dataset.py │ │ │ ├── cityscapes.py │ │ │ ├── cityscapes_panoptic.py │ │ │ ├── coco_panoptic.py │ │ │ └── utils.py │ │ ├── samplers │ │ │ ├── __init__.py │ │ │ └── distributed_sampler.py │ │ └── transforms │ │ │ ├── __init__.py │ │ │ ├── build.py │ │ │ ├── pre_augmentation_transforms.py │ │ │ ├── target_transforms.py │ │ │ └── transforms.py │ ├── evaluation │ │ ├── __init__.py │ │ ├── coco_instance.py │ │ ├── coco_panoptic.py │ │ ├── instance.py │ │ ├── panoptic.py │ │ └── semantic.py │ ├── model │ │ ├── __init__.py │ │ ├── backbone │ │ │ ├── __init__.py │ │ │ ├── hrnet.py │ │ │ ├── mnasnet.py │ │ │ ├── mobilenet.py │ │ │ ├── resnet.py │ │ │ └── xception.py │ │ ├── build.py │ │ ├── decoder │ │ │ ├── __init__.py │ │ │ ├── aspp.py │ │ │ ├── conv_module.py │ │ │ ├── deeplabv3.py │ │ │ ├── deeplabv3plus.py │ │ │ └── panoptic_deeplab.py │ │ ├── loss │ │ │ ├── __init__.py │ │ │ └── criterion.py │ │ ├── meta_arch │ │ │ ├── __init__.py │ │ │ ├── base.py │ │ │ ├── deeplabv3.py │ │ │ ├── deeplabv3plus.py │ │ │ └── panoptic_deeplab.py │ │ └── post_processing │ │ │ ├── __init__.py │ │ │ ├── evaluation_format.py │ │ │ ├── instance_post_processing.py │ │ │ └── semantic_post_processing.py │ ├── solver │ │ ├── __init__.py │ │ ├── build.py │ │ ├── lr_scheduler.py │ │ └── utils.py │ └── utils │ │ ├── __init__.py │ │ ├── comm.py │ │ ├── debug.py │ │ ├── env.py │ │ ├── flow_vis.py │ │ ├── logger.py │ │ ├── save_annotation.py │ │ ├── test_utils.py │ │ └── utils.py ├── tools │ ├── __init__.py │ ├── datasets │ │ ├── BaseDataset.py │ │ ├── __init__.py │ │ ├── bdd │ │ │ ├── __init__.py │ │ │ └── bdd.py │ │ ├── camvid │ │ │ ├── __init__.py │ │ │ └── camvid.py │ │ ├── cityscapes │ │ │ ├── __init__.py │ │ │ ├── cityscapes.py │ │ │ ├── cityscapes_test.txt │ │ │ ├── cityscapes_train_fine.txt │ │ │ └── cityscapes_val_fine.txt │ │ └── coco │ │ │ ├── __init__.py │ │ │ └── coco.py │ ├── engine │ │ ├── __init__.py │ │ ├── evaluator.py │ │ ├── logger.py │ │ └── tester.py │ ├── seg_opr │ │ ├── __init__.py │ │ ├── loss_opr.py │ │ └── metric.py │ ├── utils │ │ ├── __init__.py │ │ ├── cal_model.py │ │ ├── darts_utils.py │ │ ├── dist_utils.py │ │ ├── genotypes.py │ │ ├── img_utils.py │ │ ├── init_func.py │ │ ├── lr_scheduler.py │ │ ├── metrics.py │ │ ├── pyt_utils.py │ │ └── visualize.py │ └── vis │ │ ├── panoptic_coco_categories.json │ │ ├── vis_cityscapes.py │ │ └── vis_coco.py └── train │ ├── _init_paths.py │ ├── att_sa.py │ ├── builder.py │ ├── cal_model.py │ ├── config_test.py │ ├── config_train.py │ ├── configs │ ├── ADE20K │ │ ├── 512.yaml │ │ └── base.yaml │ └── Cityscapes-PanopticSegmentation │ │ ├── Base-PanopticDeepLab-OS16.yaml │ │ ├── base.yaml │ │ ├── panoptic_deeplab_R_52_os16_mg124_poly_90k_bs32_crop_512_1024.yaml │ │ └── panoptic_deeplab_R_52_os16_mg124_poly_90k_bs32_crop_512_1024_dsconv.yaml │ ├── cydas.py │ ├── dataloader.py │ ├── eval.py │ ├── genotypes.py │ ├── latency_lookup_table.npy │ ├── launch.py │ ├── layers.py │ ├── loss.py │ ├── operations.py │ ├── run_det2.sh │ ├── seg_metrics.py │ ├── seg_oprs.py │ ├── slimmable_ops.py │ ├── test.py │ ├── test_seg.py │ ├── train_ade20k_cydas.py │ ├── train_cydas.py │ └── vis_arch.py ├── LICENSE ├── README.md ├── SETUP.md ├── benchmark201 ├── README.md ├── configs │ └── config.py ├── core │ ├── augment_function.py │ ├── pretrain_function.py │ └── search_function.py ├── datasets │ ├── cifar.py │ ├── data_utils.py │ └── imagenet.py ├── models │ ├── augment_cells.py │ ├── aux_head.py │ ├── cdarts_controller.py │ ├── loss.py │ ├── model_augment.py │ ├── model_test.py │ ├── ops.py │ └── search_cells.py ├── run_search_cifar_1gpu.sh ├── search.py ├── search │ ├── cifar10-search │ │ ├── cifar10-search.log │ │ └── tb │ │ │ └── readme.md │ └── imagenet-search │ │ ├── imagenet-search.log │ │ └── tb │ │ └── readme.md └── utils │ ├── genotypes.py │ ├── get_info.py │ ├── utils.py │ └── visualize.py ├── demo ├── NATS_bench.png ├── ade.png ├── cell.png ├── cell_cifar.png ├── cell_imagenet.png ├── chain.png ├── chain_arch.png ├── city.png ├── coco.png ├── framework1.png └── framework2.png ├── experiments ├── retrain │ ├── cifar10-retrain │ │ ├── cifar10-retrain.log │ │ └── tb │ │ │ └── readme.md │ └── imagenet-retrain │ │ ├── imagenet-retrain.log │ │ └── tb │ │ └── readme.md └── search │ ├── cifar10-search │ ├── cifar10-search.log │ └── tb │ │ └── readme.md │ └── imagenet-search │ ├── imagenet-search.log │ └── tb │ └── readme.md ├── lib ├── config.py ├── core │ ├── augment_function.py │ ├── pretrain_function.py │ └── search_function.py ├── datasets │ ├── cifar.py │ ├── data_utils.py │ └── imagenet.py ├── models │ ├── augment_cells.py │ ├── aux_head.py │ ├── cdarts_controller.py │ ├── loss.py │ ├── model_augment.py │ ├── model_test.py │ ├── ops.py │ └── search_cells.py └── utils │ ├── count_flops.py │ ├── genotypes.py │ ├── utils.py │ └── visualize.py └── requirements /CDARTS/_init_paths.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from __future__ import division 3 | from __future__ import print_function 4 | 5 | import os.path as osp 6 | import sys 7 | 8 | 9 | def add_path(path): 10 | if path not in sys.path: 11 | sys.path.insert(0, path) 12 | 13 | 14 | this_dir = osp.dirname(__file__) 15 | lib_path = osp.join(this_dir, '..', 'lib') 16 | add_path(lib_path) 17 | 18 | lib_path = osp.join(this_dir, '..') 19 | add_path(lib_path) 20 | -------------------------------------------------------------------------------- /CDARTS/cells/pdarts_genotype.json: -------------------------------------------------------------------------------- 1 | {"0": "Genotype(normal=[[('skip_connect', 0), ('dil_conv_3x3', 1)], [('skip_connect', 0),('sep_conv_3x3', 1)], [('sep_conv_3x3', 1), ('sep_conv_3x3', 3)], [('sep_conv_3x3',0), ('dil_conv_5x5', 4)]], normal_concat=range(2, 6), reduce=[[('avg_pool_3x3', 0), ('sep_conv_5x5', 1)], [('sep_conv_3x3', 0), ('dil_conv_5x5', 2)], [('max_pool_3x3', 0), ('dil_conv_3x3', 1)], [('dil_conv_3x3', 1), ('dil_conv_5x5', 3)]], reduce_concat=range(2, 6))", "1": "Genotype(normal=[[('skip_connect', 0), ('dil_conv_3x3', 1)], [('skip_connect', 0),('sep_conv_3x3', 1)], [('sep_conv_3x3', 1), ('sep_conv_3x3', 3)], [('sep_conv_3x3',0), ('dil_conv_5x5', 4)]], normal_concat=range(2, 6), reduce=[[('avg_pool_3x3', 0), ('sep_conv_5x5', 1)], [('sep_conv_3x3', 0), ('dil_conv_5x5', 2)], [('max_pool_3x3', 0), ('dil_conv_3x3', 1)], [('dil_conv_3x3', 1), ('dil_conv_5x5', 3)]], reduce_concat=range(2, 6))", "2": "Genotype(normal=[[('skip_connect', 0), ('dil_conv_3x3', 1)], [('skip_connect', 0),('sep_conv_3x3', 1)], [('sep_conv_3x3', 1), ('sep_conv_3x3', 3)], [('sep_conv_3x3',0), ('dil_conv_5x5', 4)]], normal_concat=range(2, 6), reduce=[[('avg_pool_3x3', 0), ('sep_conv_5x5', 1)], [('sep_conv_3x3', 0), ('dil_conv_5x5', 2)], [('max_pool_3x3', 0), ('dil_conv_3x3', 1)], [('dil_conv_3x3', 1), ('dil_conv_5x5', 3)]], reduce_concat=range(2, 6))"} -------------------------------------------------------------------------------- /CDARTS/scripts/run_retrain_cifar_1gpu.sh: -------------------------------------------------------------------------------- 1 | NGPUS=1 2 | SGPU=0 3 | EGPU=$[NGPUS+SGPU-1] 4 | GPU_ID=`seq -s , $SGPU $EGPU` 5 | CUDA_VISIBLE_DEVICES=$GPU_ID python -m torch.distributed.launch --nproc_per_node=$NGPUS ./CDARTS/retrain.py \ 6 | --name cifar10-retrain --dataset cifar10 --model_type cifar \ 7 | --n_classes 10 --init_channels 36 --stem_multiplier 3 \ 8 | --cell_file './genotypes.json' \ 9 | --batch_size 128 --workers 1 --print_freq 100 \ 10 | --world_size $NGPUS --weight_decay 5e-4 \ 11 | --distributed --dist_url 'tcp://127.0.0.1:26443' \ 12 | --lr 0.025 --warmup_epochs 0 --epochs 600 \ 13 | --cutout_length 16 --aux_weight 0.4 --drop_path_prob 0.3 \ 14 | --label_smooth 0.0 --mixup_alpha 0 -------------------------------------------------------------------------------- /CDARTS/scripts/run_retrain_cifar_4gpus.sh: -------------------------------------------------------------------------------- 1 | NGPUS=4 2 | SGPU=0 3 | EGPU=$[NGPUS+SGPU-1] 4 | GPU_ID=`seq -s , $SGPU $EGPU` 5 | CUDA_VISIBLE_DEVICES=$GPU_ID python -m torch.distributed.launch --nproc_per_node=$NGPUS ./CDARTS/retrain.py \ 6 | --name cifar10-retrain --dataset cifar10 --model_type cifar \ 7 | --n_classes 10 --init_channels 36 --stem_multiplier 3 \ 8 | --cell_file './genotypes.json' \ 9 | --batch_size 128 --workers 1 --print_freq 100 \ 10 | --world_size $NGPUS --weight_decay 5e-4 \ 11 | --distributed --dist_url 'tcp://127.0.0.1:26443' \ 12 | --lr 0.1 --warmup_epochs 0 --epochs 600 \ 13 | --cutout_length 16 --aux_weight 0.4 --drop_path_prob 0.3 \ 14 | --label_smooth 0.0 --mixup_alpha 0 15 | 16 | -------------------------------------------------------------------------------- /CDARTS/scripts/run_retrain_imagenet.sh: -------------------------------------------------------------------------------- 1 | NGPUS=8 2 | SGPU=0 3 | EGPU=$[NGPUS+SGPU-1] 4 | GPU_ID=`seq -s , $SGPU $EGPU` 5 | CUDA_VISIBLE_DEVICES=$GPU_ID python -m torch.distributed.launch --nproc_per_node=$NGPUS ./CDARTS/retrain.py \ 6 | --name imagenet-retrain --dataset imagenet --model_type imagenet \ 7 | --n_classes 1000 --init_channels 48 --stem_multiplier 1 \ 8 | --batch_size 128 --workers 4 --print_freq 100 \ 9 | --cell_file './genotypes.json' \ 10 | --world_size $NGPUS --weight_decay 3e-5 \ 11 | --distributed --dist_url 'tcp://127.0.0.1:24443' \ 12 | --lr 0.5 --warmup_epochs 5 --epochs 250 \ 13 | --cutout_length 0 --aux_weight 0.4 --drop_path_prob 0.0 \ 14 | --label_smooth 0.1 --mixup_alpha 0 \ 15 | --resume_name "retrain_resume.pth.tar" -------------------------------------------------------------------------------- /CDARTS/scripts/run_search_cifar_1gpu.sh: -------------------------------------------------------------------------------- 1 | NGPUS=1 2 | SGPU=0 3 | EGPU=$[NGPUS+SGPU-1] 4 | GPU_ID=`seq -s , $SGPU $EGPU` 5 | CUDA_VISIBLE_DEVICES=$GPU_ID python -m torch.distributed.launch --nproc_per_node=$NGPUS ./CDARTS/search.py \ 6 | --name cifar10-search --dataset cifar10 --model_type cifar \ 7 | --n_classes 10 --init_channels 16 --layer_num 3 --stem_multiplier 3 \ 8 | --batch_size 64 --sample_ratio 1.0 \ 9 | --workers 1 --print_freq 10 \ 10 | --distributed --world_size $NGPUS --dist_url 'tcp://127.0.0.1:23343' \ 11 | --use_apex --sync_param \ 12 | --regular --regular_ratio 0.667 --regular_coeff 5 \ 13 | --clean_arch --loss_alpha 1 \ 14 | --ensemble_param \ 15 | --w_lr 0.08 --alpha_lr 3e-4 --nasnet_lr 0.08 \ 16 | --w_weight_decay 3e-4 --alpha_weight_decay 0. \ 17 | --one_stage --repeat_cell --fix_head \ 18 | --interactive_type 3 \ 19 | --pretrain_epochs 2 --pretrain_decay 0 \ 20 | --search_iter 32 --search_iter_epochs 1 --nasnet_warmup 1 -------------------------------------------------------------------------------- /CDARTS/scripts/run_search_cifar_4gpus.sh: -------------------------------------------------------------------------------- 1 | NGPUS=4 2 | SGPU=0 3 | EGPU=$[NGPUS+SGPU-1] 4 | GPU_ID=`seq -s , $SGPU $EGPU` 5 | CUDA_VISIBLE_DEVICES=$GPU_ID python -m torch.distributed.launch --nproc_per_node=$NGPUS ./CDARTS/search.py \ 6 | --name cifar10-search --dataset cifar10 --model_type cifar \ 7 | --n_classes 10 --init_channels 16 --layer_num 3 --stem_multiplier 3 \ 8 | --batch_size 64 --sample_ratio 1.0 \ 9 | --workers 1 --print_freq 10 \ 10 | --distributed --world_size $NGPUS --dist_url 'tcp://127.0.0.1:23343' \ 11 | --use_apex --sync_param \ 12 | --regular --regular_ratio 0.667 --regular_coeff 5 \ 13 | --clean_arch --loss_alpha 1 \ 14 | --ensemble_param \ 15 | --w_lr 0.2 --alpha_lr 3e-4 --nasnet_lr 0.2 \ 16 | --w_weight_decay 3e-4 --alpha_weight_decay 0. \ 17 | --one_stage --repeat_cell --fix_head \ 18 | --interactive_type 3 \ 19 | --pretrain_epochs 2 --pretrain_decay 0 \ 20 | --search_iter 32 --search_iter_epochs 1 --nasnet_warmup 1 -------------------------------------------------------------------------------- /CDARTS/scripts/run_search_imagenet.sh: -------------------------------------------------------------------------------- 1 | NGPUS=8 2 | SGPU=0 3 | EGPU=$[NGPUS+SGPU-1] 4 | GPU_ID=`seq -s , $SGPU $EGPU` 5 | CUDA_VISIBLE_DEVICES=$GPU_ID python -m torch.distributed.launch --nproc_per_node=$NGPUS ./CDARTS/search.py \ 6 | --name imagenet-search --dataset imagenet --model_type imagenet \ 7 | --n_classes 1000 --init_channels 16 --stem_multiplier 1 \ 8 | --distributed --world_size $NGPUS --dist_url 'tcp://127.0.0.1:23343' \ 9 | --batch_size 128 --sample_ratio 0.2 \ 10 | --workers 4 --print_freq 10 \ 11 | --use_apex --sync_param \ 12 | --regular --regular_ratio 0.5 --regular_coeff 5 \ 13 | --clean_arch --loss_alpha 1 \ 14 | --ensemble_param \ 15 | --w_lr 0.8 --alpha_lr 3e-4 --nasnet_lr 0.8 \ 16 | --w_weight_decay 1e-5 --alpha_weight_decay 1e-5 \ 17 | --one_stage --repeat_cell \ 18 | --interactive_type 0 \ 19 | --pretrain_epochs 10 --pretrain_decay 3 \ 20 | --search_iter 40 --search_iter_epochs 1 --nasnet_warmup 3 -------------------------------------------------------------------------------- /CDARTS/scripts/run_test_cifar.sh: -------------------------------------------------------------------------------- 1 | NGPUS=4 2 | SGPU=0 3 | EGPU=$[NGPUS+SGPU-1] 4 | GPU_ID=`seq -s , $SGPU $EGPU` 5 | CUDA_VISIBLE_DEVICES=$GPU_ID python -m torch.distributed.launch --nproc_per_node=$NGPUS ./CDARTS/test.py \ 6 | --name cifar10-retrain --dataset cifar10 --model_type cifar \ 7 | --n_classes 10 --init_channels 36 --stem_multiplier 3 \ 8 | --batch_size 128 --workers 1 --print_freq 100 \ 9 | --cell_file 'cells/cifar_genotype.json' \ 10 | --world_size $NGPUS --distributed --dist_url 'tcp://127.0.0.1:24443' \ 11 | --resume --resume_name 'c10.pth.tar' 12 | -------------------------------------------------------------------------------- /CDARTS/scripts/run_test_imagenet.sh: -------------------------------------------------------------------------------- 1 | NGPUS=4 2 | SGPU=0 3 | EGPU=$[NGPUS+SGPU-1] 4 | GPU_ID=`seq -s , $SGPU $EGPU` 5 | CUDA_VISIBLE_DEVICES=$GPU_ID python -m torch.distributed.launch --nproc_per_node=$NGPUS ./CDARTS/test.py \ 6 | --name imagenet-retrain --dataset imagenet --model_type imagenet \ 7 | --n_classes 1000 --init_channels 48 --stem_multiplier 1 \ 8 | --batch_size 128 --workers 4 --print_freq 10 \ 9 | --cell_file 'cells/imagenet_genotype.json' \ 10 | --world_size $NGPUS --distributed --dist_url 'tcp://127.0.0.1:24443' \ 11 | --resume --resume_name 'imagenet.pth.tar' 12 | -------------------------------------------------------------------------------- /CDARTS_detection/compile.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | echo "Building roi align op..." 4 | cd mmdet/ops/roi_align 5 | if [ -d "build" ]; then 6 | rm -r build 7 | fi 8 | python setup.py build_ext --inplace 9 | 10 | echo "Building roi pool op..." 11 | cd ../roi_pool 12 | if [ -d "build" ]; then 13 | rm -r build 14 | fi 15 | python setup.py build_ext --inplace 16 | 17 | echo "Building nms op..." 18 | cd ../nms 19 | if [ -d "build" ]; then 20 | rm -r build 21 | fi 22 | python setup.py build_ext --inplace 23 | 24 | echo "Building dcn..." 25 | cd ../dcn 26 | if [ -d "build" ]; then 27 | rm -r build 28 | fi 29 | python setup.py build_ext --inplace 30 | 31 | echo "Building sigmoid focal loss op..." 32 | cd ../sigmoid_focal_loss 33 | if [ -d "build" ]; then 34 | rm -r build 35 | fi 36 | python setup.py build_ext --inplace 37 | 38 | echo "Building masked conv op..." 39 | cd ../masked_conv 40 | if [ -d "build" ]; then 41 | rm -r build 42 | fi 43 | python setup.py build_ext --inplace 44 | -------------------------------------------------------------------------------- /CDARTS_detection/env.sh: -------------------------------------------------------------------------------- 1 | # environment 2 | pip install Cython -i https://pypi.tuna.tsinghua.edu.cn/simple 3 | pip install pycocotools -i https://pypi.tuna.tsinghua.edu.cn/simple 4 | # pip install torchvision==0.3.0 -i https://pypi.tuna.tsinghua.edu.cn/simple 5 | pip install terminaltables==3.1.0 -i https://pypi.tuna.tsinghua.edu.cn/simple 6 | pip install addict -i https://pypi.tuna.tsinghua.edu.cn/simple 7 | pip install pytest-runner -i https://pypi.tuna.tsinghua.edu.cn/simple 8 | pip install imgaug==0.2.5 -i https://pypi.tuna.tsinghua.edu.cn/simple 9 | pip install opencv-python==4.1.1.26 -i https://pypi.tuna.tsinghua.edu.cn/simple 10 | pip install albumentations==0.4.3 -i https://pypi.tuna.tsinghua.edu.cn/simple 11 | pip install Pillow==6.2.1 -i https://pypi.tuna.tsinghua.edu.cn/simple 12 | pip install numpy==1.17.4 -i https://pypi.tuna.tsinghua.edu.cn/simple 13 | pip install imagecorruptions -i https://pypi.tuna.tsinghua.edu.cn/simple 14 | pip install requests -i https://pypi.tuna.tsinghua.edu.cn/simple 15 | -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/__init__.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa 2 | from .arraymisc import * 3 | from .utils import * 4 | from .fileio import * 5 | from .opencv_info import * 6 | from .image import * 7 | from .video import * 8 | from .visualization import * 9 | from .version import __version__ 10 | # The following modules are not imported to this level, so mmcv may be used 11 | # without PyTorch. 12 | # - runner 13 | # - parallel 14 | -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/__pycache__/opencv_info.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/__pycache__/opencv_info.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/__pycache__/version.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/__pycache__/version.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/_ext.cpython-36m-x86_64-linux-gnu.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/_ext.cpython-36m-x86_64-linux-gnu.so -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/arraymisc/__init__.py: -------------------------------------------------------------------------------- 1 | from .quantization import quantize, dequantize 2 | 3 | __all__ = ['quantize', 'dequantize'] 4 | -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/arraymisc/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/arraymisc/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/arraymisc/__pycache__/quantization.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/arraymisc/__pycache__/quantization.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/cnn/__init__.py: -------------------------------------------------------------------------------- 1 | from .alexnet import AlexNet 2 | from .vgg import VGG, make_vgg_layer 3 | from .resnet import ResNet, make_res_layer 4 | from .weight_init import (constant_init, xavier_init, normal_init, 5 | uniform_init, kaiming_init, caffe2_xavier_init) 6 | 7 | __all__ = [ 8 | 'AlexNet', 'VGG', 'make_vgg_layer', 'ResNet', 'make_res_layer', 9 | 'constant_init', 'xavier_init', 'normal_init', 'uniform_init', 10 | 'kaiming_init', 'caffe2_xavier_init' 11 | ] 12 | -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/cnn/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/cnn/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/cnn/__pycache__/alexnet.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/cnn/__pycache__/alexnet.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/cnn/__pycache__/resnet.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/cnn/__pycache__/resnet.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/cnn/__pycache__/vgg.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/cnn/__pycache__/vgg.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/cnn/__pycache__/weight_init.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/cnn/__pycache__/weight_init.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/fileio/__init__.py: -------------------------------------------------------------------------------- 1 | from .io import load, dump, register_handler 2 | from .handlers import BaseFileHandler, JsonHandler, PickleHandler, YamlHandler 3 | from .parse import list_from_file, dict_from_file 4 | 5 | __all__ = [ 6 | 'load', 'dump', 'register_handler', 'BaseFileHandler', 'JsonHandler', 7 | 'PickleHandler', 'YamlHandler', 'list_from_file', 'dict_from_file' 8 | ] 9 | -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/fileio/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/fileio/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/fileio/__pycache__/io.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/fileio/__pycache__/io.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/fileio/__pycache__/parse.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/fileio/__pycache__/parse.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/fileio/handlers/__init__.py: -------------------------------------------------------------------------------- 1 | from .base import BaseFileHandler 2 | from .json_handler import JsonHandler 3 | from .pickle_handler import PickleHandler 4 | from .yaml_handler import YamlHandler 5 | 6 | __all__ = ['BaseFileHandler', 'JsonHandler', 'PickleHandler', 'YamlHandler'] 7 | -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/fileio/handlers/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/fileio/handlers/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/fileio/handlers/__pycache__/base.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/fileio/handlers/__pycache__/base.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/fileio/handlers/__pycache__/json_handler.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/fileio/handlers/__pycache__/json_handler.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/fileio/handlers/__pycache__/pickle_handler.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/fileio/handlers/__pycache__/pickle_handler.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/fileio/handlers/__pycache__/yaml_handler.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/fileio/handlers/__pycache__/yaml_handler.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/fileio/handlers/base.py: -------------------------------------------------------------------------------- 1 | from abc import ABCMeta, abstractmethod 2 | 3 | 4 | class BaseFileHandler(object): 5 | 6 | __metaclass__ = ABCMeta # python 2 compatibility 7 | 8 | @abstractmethod 9 | def load_from_fileobj(self, file, **kwargs): 10 | pass 11 | 12 | @abstractmethod 13 | def dump_to_fileobj(self, obj, file, **kwargs): 14 | pass 15 | 16 | @abstractmethod 17 | def dump_to_str(self, obj, **kwargs): 18 | pass 19 | 20 | def load_from_path(self, filepath, mode='r', **kwargs): 21 | with open(filepath, mode) as f: 22 | return self.load_from_fileobj(f, **kwargs) 23 | 24 | def dump_to_path(self, obj, filepath, mode='w', **kwargs): 25 | with open(filepath, mode) as f: 26 | self.dump_to_fileobj(obj, f, **kwargs) 27 | -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/fileio/handlers/json_handler.py: -------------------------------------------------------------------------------- 1 | import json 2 | 3 | from .base import BaseFileHandler 4 | 5 | 6 | class JsonHandler(BaseFileHandler): 7 | 8 | def load_from_fileobj(self, file): 9 | return json.load(file) 10 | 11 | def dump_to_fileobj(self, obj, file, **kwargs): 12 | json.dump(obj, file, **kwargs) 13 | 14 | def dump_to_str(self, obj, **kwargs): 15 | return json.dumps(obj, **kwargs) 16 | -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/fileio/handlers/pickle_handler.py: -------------------------------------------------------------------------------- 1 | from six.moves import cPickle as pickle 2 | 3 | from .base import BaseFileHandler 4 | 5 | 6 | class PickleHandler(BaseFileHandler): 7 | 8 | def load_from_fileobj(self, file, **kwargs): 9 | return pickle.load(file, **kwargs) 10 | 11 | def load_from_path(self, filepath, **kwargs): 12 | return super(PickleHandler, self).load_from_path( 13 | filepath, mode='rb', **kwargs) 14 | 15 | def dump_to_str(self, obj, **kwargs): 16 | kwargs.setdefault('protocol', 2) 17 | return pickle.dumps(obj, **kwargs) 18 | 19 | def dump_to_fileobj(self, obj, file, **kwargs): 20 | kwargs.setdefault('protocol', 2) 21 | pickle.dump(obj, file, **kwargs) 22 | 23 | def dump_to_path(self, obj, filepath, **kwargs): 24 | super(PickleHandler, self).dump_to_path( 25 | obj, filepath, mode='wb', **kwargs) 26 | -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/fileio/handlers/yaml_handler.py: -------------------------------------------------------------------------------- 1 | import yaml 2 | 3 | try: 4 | from yaml import CLoader as Loader, CDumper as Dumper 5 | except ImportError: 6 | from yaml import Loader, Dumper 7 | 8 | from .base import BaseFileHandler # isort:skip 9 | 10 | 11 | class YamlHandler(BaseFileHandler): 12 | 13 | def load_from_fileobj(self, file, **kwargs): 14 | kwargs.setdefault('Loader', Loader) 15 | return yaml.load(file, **kwargs) 16 | 17 | def dump_to_fileobj(self, obj, file, **kwargs): 18 | kwargs.setdefault('Dumper', Dumper) 19 | yaml.dump(obj, file, **kwargs) 20 | 21 | def dump_to_str(self, obj, **kwargs): 22 | kwargs.setdefault('Dumper', Dumper) 23 | return yaml.dump(obj, **kwargs) 24 | -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/image/__init__.py: -------------------------------------------------------------------------------- 1 | from .io import imread, imwrite, imfrombytes 2 | from .transforms import (bgr2gray, gray2bgr, bgr2rgb, rgb2bgr, bgr2hsv, 3 | hsv2bgr, bgr2hls, hls2bgr, iminvert, imflip, imrotate, 4 | imcrop, impad, impad_to_multiple, imnormalize, 5 | imdenormalize, imresize, imresize_like, imrescale) 6 | 7 | __all__ = [ 8 | 'imread', 'imwrite', 'imfrombytes', 'bgr2gray', 'gray2bgr', 'bgr2rgb', 9 | 'rgb2bgr', 'bgr2hsv', 'hsv2bgr', 'bgr2hls', 'hls2bgr', 'iminvert', 10 | 'imflip', 'imrotate', 'imcrop', 'impad', 'impad_to_multiple', 11 | 'imnormalize', 'imdenormalize', 'imresize', 'imresize_like', 'imrescale' 12 | ] 13 | -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/image/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/image/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/image/__pycache__/io.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/image/__pycache__/io.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/image/transforms/__init__.py: -------------------------------------------------------------------------------- 1 | from .colorspace import (bgr2gray, gray2bgr, bgr2rgb, rgb2bgr, bgr2hsv, 2 | hsv2bgr, bgr2hls, hls2bgr, iminvert) 3 | from .geometry import imflip, imrotate, imcrop, impad, impad_to_multiple 4 | from .normalize import imnormalize, imdenormalize 5 | from .resize import imresize, imresize_like, imrescale 6 | 7 | __all__ = [ 8 | 'bgr2gray', 'gray2bgr', 'bgr2rgb', 'rgb2bgr', 'bgr2hsv', 'hsv2bgr', 9 | 'bgr2hls', 'hls2bgr', 'iminvert', 'imflip', 'imrotate', 'imcrop', 'impad', 10 | 'impad_to_multiple', 'imnormalize', 'imdenormalize', 'imresize', 11 | 'imresize_like', 'imrescale' 12 | ] 13 | -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/image/transforms/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/image/transforms/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/image/transforms/__pycache__/colorspace.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/image/transforms/__pycache__/colorspace.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/image/transforms/__pycache__/geometry.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/image/transforms/__pycache__/geometry.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/image/transforms/__pycache__/normalize.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/image/transforms/__pycache__/normalize.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/image/transforms/__pycache__/resize.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/image/transforms/__pycache__/resize.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/image/transforms/normalize.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | from .colorspace import bgr2rgb, rgb2bgr 4 | 5 | 6 | def imnormalize(img, mean, std, to_rgb=True): 7 | img = img.astype(np.float32) 8 | if to_rgb: 9 | img = bgr2rgb(img) 10 | return (img - mean) / std 11 | 12 | 13 | def imdenormalize(img, mean, std, to_bgr=True): 14 | img = (img * std) + mean 15 | if to_bgr: 16 | img = rgb2bgr(img) 17 | return img 18 | -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/opencv_info.py: -------------------------------------------------------------------------------- 1 | import cv2 2 | 3 | 4 | def use_opencv2(): 5 | try: 6 | major_version = cv2.__version__.split('.')[0] 7 | except TypeError: # solves doc generation issue 8 | major_version = 4 9 | return major_version == '2' 10 | 11 | 12 | USE_OPENCV2 = use_opencv2() 13 | -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/parallel/__init__.py: -------------------------------------------------------------------------------- 1 | from .collate import collate 2 | from .data_container import DataContainer 3 | from .data_parallel import MMDataParallel 4 | from .distributed import MMDistributedDataParallel 5 | from .scatter_gather import scatter, scatter_kwargs 6 | 7 | __all__ = [ 8 | 'collate', 'DataContainer', 'MMDataParallel', 'MMDistributedDataParallel', 9 | 'scatter', 'scatter_kwargs' 10 | ] 11 | -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/parallel/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/parallel/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/parallel/__pycache__/_functions.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/parallel/__pycache__/_functions.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/parallel/__pycache__/collate.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/parallel/__pycache__/collate.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/parallel/__pycache__/data_container.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/parallel/__pycache__/data_container.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/parallel/__pycache__/data_parallel.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/parallel/__pycache__/data_parallel.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/parallel/__pycache__/distributed.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/parallel/__pycache__/distributed.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/parallel/__pycache__/scatter_gather.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/parallel/__pycache__/scatter_gather.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/parallel/data_parallel.py: -------------------------------------------------------------------------------- 1 | from torch.nn.parallel import DataParallel 2 | 3 | from .scatter_gather import scatter_kwargs 4 | 5 | 6 | class MMDataParallel(DataParallel): 7 | 8 | def scatter(self, inputs, kwargs, device_ids): 9 | return scatter_kwargs(inputs, kwargs, device_ids, dim=self.dim) 10 | -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/runner/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/runner/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/runner/__pycache__/checkpoint.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/runner/__pycache__/checkpoint.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/runner/__pycache__/dist_utils.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/runner/__pycache__/dist_utils.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/runner/__pycache__/log_buffer.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/runner/__pycache__/log_buffer.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/runner/__pycache__/parallel_test.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/runner/__pycache__/parallel_test.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/runner/__pycache__/priority.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/runner/__pycache__/priority.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/runner/__pycache__/runner.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/runner/__pycache__/runner.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/runner/__pycache__/utils.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/runner/__pycache__/utils.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/runner/hooks/__init__.py: -------------------------------------------------------------------------------- 1 | from .hook import Hook 2 | from .checkpoint import CheckpointHook 3 | from .closure import ClosureHook 4 | from .lr_updater import LrUpdaterHook 5 | from .optimizer import OptimizerHook, OptimizerArchHook 6 | from .iter_timer import IterTimerHook 7 | from .sampler_seed import DistSamplerSeedHook 8 | from .memory import EmptyCacheHook 9 | from .logger import (LoggerHook, TextLoggerHook, PaviLoggerHook, 10 | TensorboardLoggerHook) 11 | 12 | __all__ = [ 13 | 'Hook', 'CheckpointHook', 'ClosureHook', 'LrUpdaterHook', 'OptimizerHook', 'OptimizerArchHook', 14 | 'IterTimerHook', 'DistSamplerSeedHook', 'EmptyCacheHook', 'LoggerHook', 15 | 'TextLoggerHook', 'PaviLoggerHook', 'TensorboardLoggerHook' 16 | ] 17 | -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/runner/hooks/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/runner/hooks/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/runner/hooks/__pycache__/checkpoint.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/runner/hooks/__pycache__/checkpoint.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/runner/hooks/__pycache__/closure.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/runner/hooks/__pycache__/closure.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/runner/hooks/__pycache__/hook.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/runner/hooks/__pycache__/hook.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/runner/hooks/__pycache__/iter_timer.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/runner/hooks/__pycache__/iter_timer.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/runner/hooks/__pycache__/lr_updater.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/runner/hooks/__pycache__/lr_updater.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/runner/hooks/__pycache__/memory.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/runner/hooks/__pycache__/memory.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/runner/hooks/__pycache__/optimizer.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/runner/hooks/__pycache__/optimizer.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/runner/hooks/__pycache__/sampler_seed.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/runner/hooks/__pycache__/sampler_seed.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/runner/hooks/checkpoint.py: -------------------------------------------------------------------------------- 1 | from ..utils import master_only 2 | from .hook import Hook 3 | 4 | 5 | class CheckpointHook(Hook): 6 | 7 | def __init__(self, 8 | interval=-1, 9 | save_optimizer=True, 10 | out_dir=None, 11 | **kwargs): 12 | self.interval = interval 13 | self.save_optimizer = save_optimizer 14 | self.out_dir = out_dir 15 | self.args = kwargs 16 | 17 | @master_only 18 | def after_train_epoch(self, runner): 19 | if not self.every_n_epochs(runner, self.interval): 20 | return 21 | 22 | if not self.out_dir: 23 | self.out_dir = runner.work_dir 24 | runner.save_checkpoint( 25 | self.out_dir, save_optimizer=self.save_optimizer, **self.args) 26 | -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/runner/hooks/closure.py: -------------------------------------------------------------------------------- 1 | from .hook import Hook 2 | 3 | 4 | class ClosureHook(Hook): 5 | 6 | def __init__(self, fn_name, fn): 7 | assert hasattr(self, fn_name) 8 | assert callable(fn) 9 | setattr(self, fn_name, fn) 10 | -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/runner/hooks/iter_timer.py: -------------------------------------------------------------------------------- 1 | import time 2 | 3 | from .hook import Hook 4 | 5 | 6 | class IterTimerHook(Hook): 7 | 8 | def before_epoch(self, runner): 9 | self.t = time.time() 10 | 11 | def before_iter(self, runner): 12 | runner.log_buffer.update({'data_time': time.time() - self.t}) 13 | 14 | def after_iter(self, runner): 15 | runner.log_buffer.update({'time': time.time() - self.t}) 16 | self.t = time.time() 17 | -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/runner/hooks/logger/__init__.py: -------------------------------------------------------------------------------- 1 | from .base import LoggerHook 2 | from .pavi import PaviLoggerHook 3 | from .tensorboard import TensorboardLoggerHook 4 | from .text import TextLoggerHook 5 | 6 | __all__ = [ 7 | 'LoggerHook', 'TextLoggerHook', 'PaviLoggerHook', 'TensorboardLoggerHook' 8 | ] 9 | -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/runner/hooks/logger/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/runner/hooks/logger/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/runner/hooks/logger/__pycache__/base.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/runner/hooks/logger/__pycache__/base.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/runner/hooks/logger/__pycache__/pavi.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/runner/hooks/logger/__pycache__/pavi.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/runner/hooks/logger/__pycache__/tensorboard.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/runner/hooks/logger/__pycache__/tensorboard.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/runner/hooks/logger/__pycache__/text.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/runner/hooks/logger/__pycache__/text.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/runner/hooks/memory.py: -------------------------------------------------------------------------------- 1 | import torch 2 | 3 | from .hook import Hook 4 | 5 | 6 | class EmptyCacheHook(Hook): 7 | 8 | def __init__(self, before_epoch=False, after_epoch=True, after_iter=False): 9 | self._before_epoch = before_epoch 10 | self._after_epoch = after_epoch 11 | self._after_iter = after_iter 12 | 13 | def after_iter(self, runner): 14 | if self._after_iter: 15 | torch.cuda.empty_cache() 16 | 17 | def before_epoch(self, runner): 18 | if self._before_epoch: 19 | torch.cuda.empty_cache() 20 | 21 | def after_epoch(self, runner): 22 | if self._after_epoch: 23 | torch.cuda.empty_cache() 24 | -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/runner/hooks/optimizer.py: -------------------------------------------------------------------------------- 1 | from torch.nn.utils import clip_grad 2 | 3 | from .hook import Hook 4 | 5 | 6 | class OptimizerHook(Hook): 7 | def __init__(self, grad_clip=None): 8 | self.grad_clip = grad_clip 9 | 10 | def clip_grads(self, params): 11 | clip_grad.clip_grad_norm_( 12 | filter(lambda p: p.requires_grad, params), **self.grad_clip) 13 | 14 | def after_train_iter(self, runner): 15 | runner.optimizer.zero_grad() 16 | runner.outputs['loss'].backward() 17 | if self.grad_clip is not None: 18 | self.clip_grads(runner.model.parameters()) 19 | runner.optimizer.step() 20 | 21 | 22 | class OptimizerArchHook(Hook): 23 | def __init__(self, grad_clip=None): 24 | self.grad_clip = grad_clip 25 | 26 | def clip_grads(self, params): 27 | clip_grad.clip_grad_norm_( 28 | filter(lambda p: p.requires_grad, params), **self.grad_clip) 29 | 30 | def arch_after_train_iter(self, runner): 31 | if runner.optimizer_arch is not None: 32 | runner.optimizer_arch.zero_grad() 33 | runner.outputs_arch['loss'].backward() 34 | if runner.optimizer_arch is not None: 35 | runner.optimizer_arch.step() -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/runner/hooks/sampler_seed.py: -------------------------------------------------------------------------------- 1 | from .hook import Hook 2 | 3 | 4 | class DistSamplerSeedHook(Hook): 5 | 6 | def before_epoch(self, runner): 7 | runner.data_loader.sampler.set_epoch(runner.epoch) 8 | -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/utils/__init__.py: -------------------------------------------------------------------------------- 1 | from .config import ConfigDict, Config 2 | from .misc import (is_str, iter_cast, list_cast, tuple_cast, is_seq_of, 3 | is_list_of, is_tuple_of, slice_list, concat_list, 4 | check_prerequisites, requires_package, requires_executable) 5 | from .path import (is_filepath, fopen, check_file_exist, mkdir_or_exist, 6 | symlink, scandir, FileNotFoundError) 7 | from .progressbar import ProgressBar, track_progress, track_parallel_progress 8 | from .timer import Timer, TimerError, check_time 9 | 10 | __all__ = [ 11 | 'ConfigDict', 'Config', 'is_str', 'iter_cast', 'list_cast', 'tuple_cast', 12 | 'is_seq_of', 'is_list_of', 'is_tuple_of', 'slice_list', 'concat_list', 13 | 'check_prerequisites', 'requires_package', 'requires_executable', 14 | 'is_filepath', 'fopen', 'check_file_exist', 'mkdir_or_exist', 'symlink', 15 | 'scandir', 'FileNotFoundError', 'ProgressBar', 'track_progress', 16 | 'track_parallel_progress', 'Timer', 'TimerError', 'check_time' 17 | ] 18 | -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/utils/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/utils/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/utils/__pycache__/config.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/utils/__pycache__/config.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/utils/__pycache__/misc.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/utils/__pycache__/misc.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/utils/__pycache__/path.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/utils/__pycache__/path.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/utils/__pycache__/progressbar.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/utils/__pycache__/progressbar.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/utils/__pycache__/timer.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/utils/__pycache__/timer.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/version.py: -------------------------------------------------------------------------------- 1 | __version__ = '0.2.12' 2 | -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/video/__init__.py: -------------------------------------------------------------------------------- 1 | from .io import Cache, VideoReader, frames2video 2 | from .processing import convert_video, resize_video, cut_video, concat_video 3 | from .optflow import (flowread, flowwrite, quantize_flow, dequantize_flow, 4 | flow_warp) 5 | 6 | __all__ = [ 7 | 'Cache', 'VideoReader', 'frames2video', 'convert_video', 'resize_video', 8 | 'cut_video', 'concat_video', 'flowread', 'flowwrite', 'quantize_flow', 9 | 'dequantize_flow', 'flow_warp' 10 | ] 11 | -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/video/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/video/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/video/__pycache__/io.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/video/__pycache__/io.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/video/__pycache__/optflow.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/video/__pycache__/optflow.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/video/__pycache__/processing.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/video/__pycache__/processing.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/video/optflow_warp/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/video/optflow_warp/__init__.py -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/video/optflow_warp/flow_warp.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | void FlowWarp(double* img, double* flow1, double* out, const int height, 7 | const int width, const int channels, const int filling_value, 8 | const int interpolateMode); 9 | 10 | void BilinearInterpolate(const double* img, int width, int height, int channels, 11 | double x, double y, double* out); 12 | 13 | void NNInterpolate(const double* img, int width, int height, int channels, 14 | double x, double y, double* out); 15 | 16 | template 17 | inline T __min__(T a, T b) { 18 | return a > b ? b : a; 19 | } 20 | 21 | template 22 | inline T __max__(T a, T b) { 23 | return (a < b) ? b : a; 24 | } 25 | 26 | template 27 | inline T EnforceRange(const T x, const int MaxValue) { 28 | return __min__(__max__(x, 0), MaxValue); 29 | } 30 | -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/video/optflow_warp/flow_warp_module.pyx: -------------------------------------------------------------------------------- 1 | STUFF = "Hi" 2 | 3 | import numpy as np 4 | cimport numpy as np 5 | 6 | np.import_array() 7 | 8 | cdef extern from "flow_warp.hpp": 9 | void FlowWarp(double* img, double* flow1, double* out, const int height, const int width, const int channels, const int filling_value, const int interpolateMode) 10 | 11 | def flow_warp_c(np.ndarray[double, ndim=3, mode="c"] img_array not None, 12 | np.ndarray[double, ndim=3, mode="c"] flow_array not None, 13 | int filling_value=0, 14 | int interpolate_mode=1): 15 | 16 | out_array = np.zeros_like(img_array) 17 | 18 | FlowWarp( np.PyArray_DATA(img_array), 19 | np.PyArray_DATA(flow_array), 20 | np.PyArray_DATA(out_array), 21 | out_array.shape[0], 22 | out_array.shape[1], 23 | out_array.shape[2], 24 | filling_value, 25 | interpolate_mode) 26 | 27 | return out_array 28 | -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/visualization/__init__.py: -------------------------------------------------------------------------------- 1 | from .color import Color, color_val 2 | from .image import imshow, imshow_bboxes, imshow_det_bboxes 3 | from .optflow import flowshow, flow2rgb, make_color_wheel 4 | 5 | __all__ = [ 6 | 'Color', 'color_val', 'imshow', 'imshow_bboxes', 'imshow_det_bboxes', 7 | 'flowshow', 'flow2rgb', 'make_color_wheel' 8 | ] 9 | -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/visualization/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/visualization/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/visualization/__pycache__/color.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/visualization/__pycache__/color.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/visualization/__pycache__/image.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/visualization/__pycache__/image.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmcv/visualization/__pycache__/optflow.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmcv/visualization/__pycache__/optflow.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet.egg-info/dependency_links.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet.egg-info/not-zip-safe: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet.egg-info/requires.txt: -------------------------------------------------------------------------------- 1 | mmcv>=0.2.6 2 | numpy 3 | matplotlib 4 | six 5 | terminaltables 6 | pycocotools 7 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet.egg-info/top_level.txt: -------------------------------------------------------------------------------- 1 | mmcv 2 | mmdet 3 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/__init__.py: -------------------------------------------------------------------------------- 1 | from .version import __version__, short_version 2 | 3 | __all__ = ['__version__', 'short_version'] 4 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/__pycache__/version.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/__pycache__/version.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/apis/__init__.py: -------------------------------------------------------------------------------- 1 | from .env import get_root_logger, init_dist, set_random_seed 2 | from .inference import (inference_detector, init_detector, show_result, 3 | show_result_pyplot) 4 | from .train import train_detector 5 | 6 | __all__ = [ 7 | 'init_dist', 'get_root_logger', 'set_random_seed', 'train_detector', 8 | 'init_detector', 'inference_detector', 'show_result', 'show_result_pyplot' 9 | ] 10 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/apis/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/apis/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/apis/__pycache__/env.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/apis/__pycache__/env.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/apis/__pycache__/inference.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/apis/__pycache__/inference.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/apis/__pycache__/train.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/apis/__pycache__/train.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/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 .fp16 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 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/anchor/__init__.py: -------------------------------------------------------------------------------- 1 | from .anchor_generator import AnchorGenerator 2 | from .anchor_target import anchor_target, anchor_inside_flags 3 | from .guided_anchor_target import ga_loc_target, ga_shape_target 4 | 5 | __all__ = [ 6 | 'AnchorGenerator', 'anchor_target', 'anchor_inside_flags', 'ga_loc_target', 7 | 'ga_shape_target' 8 | ] 9 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/anchor/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/anchor/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/anchor/__pycache__/anchor_generator.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/anchor/__pycache__/anchor_generator.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/anchor/__pycache__/anchor_target.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/anchor/__pycache__/anchor_target.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/anchor/__pycache__/guided_anchor_target.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/anchor/__pycache__/guided_anchor_target.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/bbox/__init__.py: -------------------------------------------------------------------------------- 1 | from .geometry import bbox_overlaps 2 | from .assigners import BaseAssigner, MaxIoUAssigner, AssignResult 3 | from .samplers import (BaseSampler, PseudoSampler, RandomSampler, 4 | InstanceBalancedPosSampler, IoUBalancedNegSampler, 5 | CombinedSampler, SamplingResult) 6 | from .assign_sampling import build_assigner, build_sampler, assign_and_sample 7 | from .transforms import (bbox2delta, delta2bbox, bbox_flip, bbox_mapping, 8 | bbox_mapping_back, bbox2roi, roi2bbox, bbox2result, 9 | distance2bbox) 10 | from .bbox_target import bbox_target 11 | 12 | __all__ = [ 13 | 'bbox_overlaps', 'BaseAssigner', 'MaxIoUAssigner', 'AssignResult', 14 | 'BaseSampler', 'PseudoSampler', 'RandomSampler', 15 | 'InstanceBalancedPosSampler', 'IoUBalancedNegSampler', 'CombinedSampler', 16 | 'SamplingResult', 'build_assigner', 'build_sampler', 'assign_and_sample', 17 | 'bbox2delta', 'delta2bbox', 'bbox_flip', 'bbox_mapping', 18 | 'bbox_mapping_back', 'bbox2roi', 'roi2bbox', 'bbox2result', 19 | 'distance2bbox', 'bbox_target' 20 | ] 21 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/bbox/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/bbox/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/bbox/__pycache__/assign_sampling.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/bbox/__pycache__/assign_sampling.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/bbox/__pycache__/bbox_target.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/bbox/__pycache__/bbox_target.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/bbox/__pycache__/geometry.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/bbox/__pycache__/geometry.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/bbox/__pycache__/transforms.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/bbox/__pycache__/transforms.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/bbox/assigners/__init__.py: -------------------------------------------------------------------------------- 1 | from .base_assigner import BaseAssigner 2 | from .max_iou_assigner import MaxIoUAssigner 3 | from .approx_max_iou_assigner import ApproxMaxIoUAssigner 4 | from .assign_result import AssignResult 5 | 6 | __all__ = [ 7 | 'BaseAssigner', 'MaxIoUAssigner', 'ApproxMaxIoUAssigner', 'AssignResult' 8 | ] 9 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/bbox/assigners/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/bbox/assigners/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/bbox/assigners/__pycache__/approx_max_iou_assigner.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/bbox/assigners/__pycache__/approx_max_iou_assigner.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/bbox/assigners/__pycache__/assign_result.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/bbox/assigners/__pycache__/assign_result.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/bbox/assigners/__pycache__/base_assigner.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/bbox/assigners/__pycache__/base_assigner.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/bbox/assigners/__pycache__/max_iou_assigner.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/bbox/assigners/__pycache__/max_iou_assigner.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/bbox/assigners/assign_result.py: -------------------------------------------------------------------------------- 1 | import torch 2 | 3 | 4 | class AssignResult(object): 5 | 6 | def __init__(self, num_gts, gt_inds, max_overlaps, labels=None): 7 | self.num_gts = num_gts 8 | self.gt_inds = gt_inds 9 | self.max_overlaps = max_overlaps 10 | self.labels = labels 11 | 12 | def add_gt_(self, gt_labels): 13 | self_inds = torch.arange( 14 | 1, len(gt_labels) + 1, dtype=torch.long, device=gt_labels.device) 15 | self.gt_inds = torch.cat([self_inds, self.gt_inds]) 16 | self.max_overlaps = torch.cat( 17 | [self.max_overlaps.new_ones(self.num_gts), self.max_overlaps]) 18 | if self.labels is not None: 19 | self.labels = torch.cat([gt_labels, self.labels]) 20 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/bbox/assigners/base_assigner.py: -------------------------------------------------------------------------------- 1 | from abc import ABCMeta, abstractmethod 2 | 3 | 4 | class BaseAssigner(metaclass=ABCMeta): 5 | 6 | @abstractmethod 7 | def assign(self, bboxes, gt_bboxes, gt_bboxes_ignore=None, gt_labels=None): 8 | pass 9 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/bbox/samplers/__init__.py: -------------------------------------------------------------------------------- 1 | from .base_sampler import BaseSampler 2 | from .pseudo_sampler import PseudoSampler 3 | from .random_sampler import RandomSampler 4 | from .instance_balanced_pos_sampler import InstanceBalancedPosSampler 5 | from .iou_balanced_neg_sampler import IoUBalancedNegSampler 6 | from .combined_sampler import CombinedSampler 7 | from .ohem_sampler import OHEMSampler 8 | from .sampling_result import SamplingResult 9 | 10 | __all__ = [ 11 | 'BaseSampler', 'PseudoSampler', 'RandomSampler', 12 | 'InstanceBalancedPosSampler', 'IoUBalancedNegSampler', 'CombinedSampler', 13 | 'OHEMSampler', 'SamplingResult' 14 | ] 15 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/bbox/samplers/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/bbox/samplers/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/bbox/samplers/__pycache__/base_sampler.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/bbox/samplers/__pycache__/base_sampler.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/bbox/samplers/__pycache__/combined_sampler.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/bbox/samplers/__pycache__/combined_sampler.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/bbox/samplers/__pycache__/instance_balanced_pos_sampler.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/bbox/samplers/__pycache__/instance_balanced_pos_sampler.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/bbox/samplers/__pycache__/iou_balanced_neg_sampler.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/bbox/samplers/__pycache__/iou_balanced_neg_sampler.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/bbox/samplers/__pycache__/ohem_sampler.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/bbox/samplers/__pycache__/ohem_sampler.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/bbox/samplers/__pycache__/pseudo_sampler.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/bbox/samplers/__pycache__/pseudo_sampler.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/bbox/samplers/__pycache__/random_sampler.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/bbox/samplers/__pycache__/random_sampler.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/bbox/samplers/__pycache__/sampling_result.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/bbox/samplers/__pycache__/sampling_result.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/bbox/samplers/combined_sampler.py: -------------------------------------------------------------------------------- 1 | from .base_sampler import BaseSampler 2 | from ..assign_sampling import build_sampler 3 | 4 | 5 | class CombinedSampler(BaseSampler): 6 | 7 | def __init__(self, pos_sampler, neg_sampler, **kwargs): 8 | super(CombinedSampler, self).__init__(**kwargs) 9 | self.pos_sampler = build_sampler(pos_sampler, **kwargs) 10 | self.neg_sampler = build_sampler(neg_sampler, **kwargs) 11 | 12 | def _sample_pos(self, **kwargs): 13 | raise NotImplementedError 14 | 15 | def _sample_neg(self, **kwargs): 16 | raise NotImplementedError 17 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/bbox/samplers/pseudo_sampler.py: -------------------------------------------------------------------------------- 1 | import torch 2 | 3 | from .base_sampler import BaseSampler 4 | from .sampling_result import SamplingResult 5 | 6 | 7 | class PseudoSampler(BaseSampler): 8 | 9 | def __init__(self, **kwargs): 10 | pass 11 | 12 | def _sample_pos(self, **kwargs): 13 | raise NotImplementedError 14 | 15 | def _sample_neg(self, **kwargs): 16 | raise NotImplementedError 17 | 18 | def sample(self, assign_result, bboxes, gt_bboxes, **kwargs): 19 | pos_inds = torch.nonzero( 20 | assign_result.gt_inds > 0).squeeze(-1).unique() 21 | neg_inds = torch.nonzero( 22 | assign_result.gt_inds == 0).squeeze(-1).unique() 23 | gt_flags = bboxes.new_zeros(bboxes.shape[0], dtype=torch.uint8) 24 | sampling_result = SamplingResult(pos_inds, neg_inds, bboxes, gt_bboxes, 25 | assign_result, gt_flags) 26 | return sampling_result 27 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/bbox/samplers/sampling_result.py: -------------------------------------------------------------------------------- 1 | import torch 2 | 3 | 4 | class SamplingResult(object): 5 | 6 | def __init__(self, pos_inds, neg_inds, bboxes, gt_bboxes, assign_result, 7 | gt_flags): 8 | self.pos_inds = pos_inds 9 | self.neg_inds = neg_inds 10 | self.pos_bboxes = bboxes[pos_inds] 11 | self.neg_bboxes = bboxes[neg_inds] 12 | self.pos_is_gt = gt_flags[pos_inds] 13 | 14 | self.num_gts = gt_bboxes.shape[0] 15 | self.pos_assigned_gt_inds = assign_result.gt_inds[pos_inds] - 1 16 | self.pos_gt_bboxes = gt_bboxes[self.pos_assigned_gt_inds, :] 17 | if assign_result.labels is not None: 18 | self.pos_gt_labels = assign_result.labels[pos_inds] 19 | else: 20 | self.pos_gt_labels = None 21 | 22 | @property 23 | def bboxes(self): 24 | return torch.cat([self.pos_bboxes, self.neg_bboxes]) 25 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/evaluation/__init__.py: -------------------------------------------------------------------------------- 1 | from .class_names import (coco_classes, dataset_aliases, get_classes, 2 | imagenet_det_classes, imagenet_vid_classes, 3 | voc_classes) 4 | from .eval_hooks import DistEvalHook 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 | 9 | __all__ = [ 10 | 'voc_classes', 'imagenet_det_classes', 'imagenet_vid_classes', 11 | 'coco_classes', 'dataset_aliases', 'get_classes', 'DistEvalHook', 12 | 'average_precision', 'eval_map', 'print_map_summary', 'eval_recalls', 13 | 'print_recall_summary', 'plot_num_recall', 'plot_iou_recall' 14 | ] 15 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/evaluation/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/evaluation/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/evaluation/__pycache__/bbox_overlaps.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/evaluation/__pycache__/bbox_overlaps.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/evaluation/__pycache__/class_names.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/evaluation/__pycache__/class_names.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/evaluation/__pycache__/eval_hooks.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/evaluation/__pycache__/eval_hooks.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/evaluation/__pycache__/mean_ap.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/evaluation/__pycache__/mean_ap.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/evaluation/__pycache__/recall.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/evaluation/__pycache__/recall.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/fp16/__init__.py: -------------------------------------------------------------------------------- 1 | from .decorators import auto_fp16, force_fp32 2 | from .hooks import Fp16OptimizerHook, wrap_fp16_model 3 | 4 | __all__ = ['auto_fp16', 'force_fp32', 'Fp16OptimizerHook', 'wrap_fp16_model'] 5 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/fp16/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/fp16/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/fp16/__pycache__/decorators.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/fp16/__pycache__/decorators.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/fp16/__pycache__/hooks.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/fp16/__pycache__/hooks.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/fp16/__pycache__/utils.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/fp16/__pycache__/utils.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/fp16/utils.py: -------------------------------------------------------------------------------- 1 | from collections import abc 2 | 3 | import numpy as np 4 | import torch 5 | 6 | 7 | def cast_tensor_type(inputs, src_type, dst_type): 8 | if isinstance(inputs, torch.Tensor): 9 | return inputs.to(dst_type) 10 | elif isinstance(inputs, str): 11 | return inputs 12 | elif isinstance(inputs, np.ndarray): 13 | return inputs 14 | elif isinstance(inputs, abc.Mapping): 15 | return type(inputs)({ 16 | k: cast_tensor_type(v, src_type, dst_type) 17 | for k, v in inputs.items() 18 | }) 19 | elif isinstance(inputs, abc.Iterable): 20 | return type(inputs)( 21 | cast_tensor_type(item, src_type, dst_type) for item in inputs) 22 | else: 23 | return inputs 24 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/mask/__init__.py: -------------------------------------------------------------------------------- 1 | from .utils import split_combined_polys 2 | from .mask_target import mask_target 3 | 4 | __all__ = ['split_combined_polys', 'mask_target'] 5 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/mask/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/mask/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/mask/__pycache__/mask_target.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/mask/__pycache__/mask_target.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/mask/__pycache__/utils.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/mask/__pycache__/utils.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/post_processing/__init__.py: -------------------------------------------------------------------------------- 1 | from .bbox_nms import multiclass_nms 2 | from .merge_augs import (merge_aug_proposals, merge_aug_bboxes, 3 | merge_aug_scores, merge_aug_masks) 4 | 5 | __all__ = [ 6 | 'multiclass_nms', 'merge_aug_proposals', 'merge_aug_bboxes', 7 | 'merge_aug_scores', 'merge_aug_masks' 8 | ] 9 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/post_processing/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/post_processing/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/post_processing/__pycache__/bbox_nms.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/post_processing/__pycache__/bbox_nms.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/post_processing/__pycache__/merge_augs.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/post_processing/__pycache__/merge_augs.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/utils/__init__.py: -------------------------------------------------------------------------------- 1 | from .dist_utils import allreduce_grads, DistOptimizerHook, DistOptimizerArchHook 2 | from .misc import tensor2imgs, unmap, multi_apply 3 | 4 | __all__ = [ 5 | 'allreduce_grads', 'DistOptimizerHook', 'tensor2imgs', 'unmap', 6 | 'multi_apply', 'DistOptimizerArchHook' 7 | ] 8 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/utils/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/utils/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/utils/__pycache__/dist_utils.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/utils/__pycache__/dist_utils.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/utils/__pycache__/misc.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/core/utils/__pycache__/misc.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/core/utils/misc.py: -------------------------------------------------------------------------------- 1 | from functools import partial 2 | 3 | import mmcv 4 | import numpy as np 5 | from six.moves import map, zip 6 | 7 | 8 | def tensor2imgs(tensor, mean=(0, 0, 0), std=(1, 1, 1), to_rgb=True): 9 | num_imgs = tensor.size(0) 10 | mean = np.array(mean, dtype=np.float32) 11 | std = np.array(std, dtype=np.float32) 12 | imgs = [] 13 | for img_id in range(num_imgs): 14 | img = tensor[img_id, ...].cpu().numpy().transpose(1, 2, 0) 15 | img = mmcv.imdenormalize( 16 | img, mean, std, to_bgr=to_rgb).astype(np.uint8) 17 | imgs.append(np.ascontiguousarray(img)) 18 | return imgs 19 | 20 | 21 | def multi_apply(func, *args, **kwargs): 22 | pfunc = partial(func, **kwargs) if kwargs else func 23 | map_results = map(pfunc, *args) 24 | return tuple(map(list, zip(*map_results))) 25 | 26 | 27 | def unmap(data, count, inds, fill=0): 28 | """ Unmap a subset of item (data) back to the original set of items (of 29 | size count) """ 30 | if data.dim() == 1: 31 | ret = data.new_full((count, ), fill) 32 | ret[inds] = data 33 | else: 34 | new_size = (count, ) + data.size()[1:] 35 | ret = data.new_full(new_size, fill) 36 | ret[inds, :] = data 37 | return ret 38 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/datasets/__init__.py: -------------------------------------------------------------------------------- 1 | from .custom import CustomDataset 2 | from .cityscapes import CityscapesDataset 3 | from .xml_style import XMLDataset 4 | from .coco import CocoDataset 5 | from .voc import VOCDataset 6 | from .wider_face import WIDERFaceDataset 7 | from .loader import GroupSampler, DistributedGroupSampler, build_dataloader, build_dataloader_arch 8 | from .dataset_wrappers import ConcatDataset, RepeatDataset 9 | from .registry import DATASETS 10 | from .builder import build_dataset 11 | 12 | __all__ = [ 13 | 'CustomDataset', 'XMLDataset', 'CocoDataset', 'VOCDataset', 14 | 'CityscapesDataset', 'GroupSampler', 'DistributedGroupSampler', 15 | 'build_dataloader', 'ConcatDataset', 'RepeatDataset', 'WIDERFaceDataset', 16 | 'DATASETS', 'build_dataset', 'build_dataloader_arch' 17 | ] -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/datasets/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/datasets/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/datasets/__pycache__/builder.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/datasets/__pycache__/builder.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/datasets/__pycache__/cityscapes.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/datasets/__pycache__/cityscapes.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/datasets/__pycache__/coco.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/datasets/__pycache__/coco.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/datasets/__pycache__/custom.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/datasets/__pycache__/custom.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/datasets/__pycache__/dataset_wrappers.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/datasets/__pycache__/dataset_wrappers.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/datasets/__pycache__/registry.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/datasets/__pycache__/registry.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/datasets/__pycache__/voc.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/datasets/__pycache__/voc.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/datasets/__pycache__/wider_face.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/datasets/__pycache__/wider_face.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/datasets/__pycache__/xml_style.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/datasets/__pycache__/xml_style.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/datasets/cityscapes.py: -------------------------------------------------------------------------------- 1 | from .coco import CocoDataset 2 | from .registry import DATASETS 3 | 4 | 5 | @DATASETS.register_module 6 | class CityscapesDataset(CocoDataset): 7 | 8 | CLASSES = ('person', 'rider', 'car', 'truck', 'bus', 'train', 'motorcycle', 9 | 'bicycle') 10 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/datasets/loader/__init__.py: -------------------------------------------------------------------------------- 1 | from .build_loader import build_dataloader, build_dataloader_arch 2 | from .sampler import DistributedGroupSampler, GroupSampler 3 | 4 | __all__ = ['GroupSampler', 'DistributedGroupSampler', 'build_dataloader', 'build_dataloader_arch'] 5 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/datasets/loader/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/datasets/loader/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/datasets/loader/__pycache__/build_loader.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/datasets/loader/__pycache__/build_loader.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/datasets/loader/__pycache__/sampler.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/datasets/loader/__pycache__/sampler.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/datasets/pipelines/__init__.py: -------------------------------------------------------------------------------- 1 | from .compose import Compose 2 | from .formating import (Collect, ImageToTensor, ToDataContainer, ToTensor, 3 | Transpose, to_tensor) 4 | from .loading import LoadAnnotations, LoadImageFromFile, LoadProposals 5 | from .test_aug import MultiScaleFlipAug 6 | from .transforms import (Albu, Expand, MinIoURandomCrop, Normalize, Pad, 7 | PhotoMetricDistortion, RandomCrop, RandomFlip, Resize, 8 | SegResizeFlipPadRescale) 9 | 10 | __all__ = [ 11 | 'Compose', 'to_tensor', 'ToTensor', 'ImageToTensor', 'ToDataContainer', 12 | 'Transpose', 'Collect', 'LoadAnnotations', 'LoadImageFromFile', 13 | 'LoadProposals', 'MultiScaleFlipAug', 'Resize', 'RandomFlip', 'Pad', 14 | 'RandomCrop', 'Normalize', 'SegResizeFlipPadRescale', 'MinIoURandomCrop', 15 | 'Expand', 'PhotoMetricDistortion', 'Albu' 16 | ] 17 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/datasets/pipelines/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/datasets/pipelines/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/datasets/pipelines/__pycache__/compose.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/datasets/pipelines/__pycache__/compose.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/datasets/pipelines/__pycache__/formating.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/datasets/pipelines/__pycache__/formating.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/datasets/pipelines/__pycache__/loading.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/datasets/pipelines/__pycache__/loading.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/datasets/pipelines/__pycache__/test_aug.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/datasets/pipelines/__pycache__/test_aug.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/datasets/pipelines/__pycache__/transforms.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/datasets/pipelines/__pycache__/transforms.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/datasets/pipelines/compose.py: -------------------------------------------------------------------------------- 1 | import collections 2 | 3 | from mmdet.utils import build_from_cfg 4 | from ..registry import PIPELINES 5 | 6 | 7 | @PIPELINES.register_module 8 | class Compose(object): 9 | 10 | def __init__(self, transforms): 11 | assert isinstance(transforms, collections.abc.Sequence) 12 | self.transforms = [] 13 | for transform in transforms: 14 | if isinstance(transform, dict): 15 | transform = build_from_cfg(transform, PIPELINES) 16 | self.transforms.append(transform) 17 | elif callable(transform): 18 | self.transforms.append(transform) 19 | else: 20 | raise TypeError('transform must be callable or a dict') 21 | 22 | def __call__(self, data): 23 | for t in self.transforms: 24 | data = t(data) 25 | if data is None: 26 | return None 27 | return data 28 | 29 | def __repr__(self): 30 | format_string = self.__class__.__name__ + '(' 31 | for t in self.transforms: 32 | format_string += '\n' 33 | format_string += ' {0}'.format(t) 34 | format_string += '\n)' 35 | return format_string 36 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/datasets/registry.py: -------------------------------------------------------------------------------- 1 | from mmdet.utils import Registry 2 | 3 | DATASETS = Registry('dataset') 4 | PIPELINES = Registry('pipeline') 5 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/__init__.py: -------------------------------------------------------------------------------- 1 | from .backbones import * # noqa: F401,F403 2 | from .necks import * # noqa: F401,F403 3 | from .roi_extractors import * # noqa: F401,F403 4 | from .anchor_heads import * # noqa: F401,F403 5 | from .shared_heads import * # noqa: F401,F403 6 | from .bbox_heads import * # noqa: F401,F403 7 | from .mask_heads import * # noqa: F401,F403 8 | from .losses import * # noqa: F401,F403 9 | from .detectors import * # noqa: F401,F403 10 | from .registry import (BACKBONES, NECKS, ROI_EXTRACTORS, SHARED_HEADS, HEADS, 11 | LOSSES, DETECTORS) 12 | from .builder import (build_backbone, build_neck, build_roi_extractor, 13 | build_shared_head, build_head, build_loss, 14 | build_detector) 15 | 16 | __all__ = [ 17 | 'BACKBONES', 'NECKS', 'ROI_EXTRACTORS', 'SHARED_HEADS', 'HEADS', 'LOSSES', 18 | 'DETECTORS', 'build_backbone', 'build_neck', 'build_roi_extractor', 19 | 'build_shared_head', 'build_head', 'build_loss', 'build_detector' 20 | ] 21 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/__pycache__/builder.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/__pycache__/builder.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/__pycache__/registry.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/__pycache__/registry.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/anchor_heads/__init__.py: -------------------------------------------------------------------------------- 1 | from .anchor_head import AnchorHead 2 | from .guided_anchor_head import GuidedAnchorHead, FeatureAdaption 3 | from .fcos_head import FCOSHead 4 | from .rpn_head import RPNHead 5 | from .ga_rpn_head import GARPNHead 6 | from .retina_head import RetinaHead 7 | from .ga_retina_head import GARetinaHead 8 | from .ssd_head import SSDHead 9 | 10 | __all__ = [ 11 | 'AnchorHead', 'GuidedAnchorHead', 'FeatureAdaption', 'RPNHead', 12 | 'GARPNHead', 'RetinaHead', 'GARetinaHead', 'SSDHead', 'FCOSHead' 13 | ] 14 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/anchor_heads/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/anchor_heads/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/anchor_heads/__pycache__/anchor_head.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/anchor_heads/__pycache__/anchor_head.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/anchor_heads/__pycache__/fcos_head.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/anchor_heads/__pycache__/fcos_head.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/anchor_heads/__pycache__/ga_retina_head.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/anchor_heads/__pycache__/ga_retina_head.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/anchor_heads/__pycache__/ga_rpn_head.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/anchor_heads/__pycache__/ga_rpn_head.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/anchor_heads/__pycache__/guided_anchor_head.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/anchor_heads/__pycache__/guided_anchor_head.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/anchor_heads/__pycache__/retina_head.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/anchor_heads/__pycache__/retina_head.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/anchor_heads/__pycache__/rpn_head.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/anchor_heads/__pycache__/rpn_head.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/anchor_heads/__pycache__/ssd_head.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/anchor_heads/__pycache__/ssd_head.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/backbones/__init__.py: -------------------------------------------------------------------------------- 1 | from .resnet import ResNet, make_res_layer 2 | from .resnext import ResNeXt 3 | from .ssd_vgg import SSDVGG 4 | from .hrnet import HRNet 5 | from .mobilenetv2 import MobileNetV2 6 | from .detnas import DetNas 7 | from .fbnet import FBNet 8 | from .mnasnet import MnasNet 9 | from .mobilenetv3 import SSDMobilenetV3 10 | from .efficientnet import SSDEFFB0 11 | 12 | __all__ = ['ResNet', 'make_res_layer', 'ResNeXt', 'SSDVGG', 'HRNet', 'MobileNetV2', 'DetNas', 'FBNet', 'MnasNet', 'SSDMobilenetV3', 'SSDEFFB0'] 13 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/backbones/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/backbones/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/backbones/__pycache__/builder.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/backbones/__pycache__/builder.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/backbones/__pycache__/detnas.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/backbones/__pycache__/detnas.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/backbones/__pycache__/dropblock.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/backbones/__pycache__/dropblock.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/backbones/__pycache__/efficientnet.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/backbones/__pycache__/efficientnet.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/backbones/__pycache__/efficientnet_builder.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/backbones/__pycache__/efficientnet_builder.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/backbones/__pycache__/fbnet.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/backbones/__pycache__/fbnet.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/backbones/__pycache__/fbnet_arch.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/backbones/__pycache__/fbnet_arch.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/backbones/__pycache__/fbnet_blocks.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/backbones/__pycache__/fbnet_blocks.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/backbones/__pycache__/feature_hooks.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/backbones/__pycache__/feature_hooks.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/backbones/__pycache__/hrnet.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/backbones/__pycache__/hrnet.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/backbones/__pycache__/mnasnet.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/backbones/__pycache__/mnasnet.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/backbones/__pycache__/mobilenetv2.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/backbones/__pycache__/mobilenetv2.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/backbones/__pycache__/mobilenetv3.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/backbones/__pycache__/mobilenetv3.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/backbones/__pycache__/resnet.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/backbones/__pycache__/resnet.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/backbones/__pycache__/resnext.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/backbones/__pycache__/resnext.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/backbones/__pycache__/ssd_vgg.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/backbones/__pycache__/ssd_vgg.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/backbones/__pycache__/utils.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/backbones/__pycache__/utils.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/bbox_heads/__init__.py: -------------------------------------------------------------------------------- 1 | from .bbox_head import BBoxHead 2 | from .convfc_bbox_head import ConvFCBBoxHead, SharedFCBBoxHead 3 | from .double_bbox_head import DoubleConvFCBBoxHead 4 | 5 | __all__ = [ 6 | 'BBoxHead', 'ConvFCBBoxHead', 'SharedFCBBoxHead', 'DoubleConvFCBBoxHead' 7 | ] 8 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/bbox_heads/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/bbox_heads/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/bbox_heads/__pycache__/bbox_head.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/bbox_heads/__pycache__/bbox_head.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/bbox_heads/__pycache__/convfc_bbox_head.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/bbox_heads/__pycache__/convfc_bbox_head.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/bbox_heads/__pycache__/double_bbox_head.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/bbox_heads/__pycache__/double_bbox_head.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/bbox_heads/auto_head/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/bbox_heads/auto_head/__init__.py -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/bbox_heads/auto_head/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/bbox_heads/auto_head/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/bbox_heads/auto_head/__pycache__/build_head.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/bbox_heads/auto_head/__pycache__/build_head.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/bbox_heads/auto_head/__pycache__/mbblock_head_search.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/bbox_heads/auto_head/__pycache__/mbblock_head_search.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/bbox_heads/auto_head/__pycache__/mbblock_ops.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/bbox_heads/auto_head/__pycache__/mbblock_ops.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/bbox_heads/auto_head/build_head.py: -------------------------------------------------------------------------------- 1 | # -------------------------------------------------------- 2 | # Copyright (c) 2019 Jianyuan Guo (guojianyuan1@huawei.com) 3 | # -------------------------------------------------------- 4 | 5 | # from .darts_head_search import DartsHead 6 | from .mbblock_head_search import MbblockHead 7 | 8 | 9 | def build_search_head(cfg): 10 | """Build head model from config dict. 11 | """ 12 | if cfg is not None: 13 | cfg_ = cfg.copy() 14 | head_type = cfg_.pop('type') 15 | if head_type == 'DARTS': 16 | raise NotImplementedError 17 | elif head_type == 'MBBlock': 18 | return MbblockHead(**cfg_) 19 | else: 20 | raise KeyError('Invalid head type {}'.fromat(head_type)) 21 | else: 22 | return None -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/builder.py: -------------------------------------------------------------------------------- 1 | from torch import nn 2 | 3 | from mmdet.utils import build_from_cfg 4 | from .registry import (BACKBONES, NECKS, ROI_EXTRACTORS, SHARED_HEADS, HEADS, 5 | LOSSES, DETECTORS) 6 | 7 | 8 | def build(cfg, registry, default_args=None): 9 | if isinstance(cfg, list): 10 | modules = [ 11 | build_from_cfg(cfg_, registry, default_args) for cfg_ in cfg 12 | ] 13 | return nn.Sequential(*modules) 14 | else: 15 | return build_from_cfg(cfg, registry, default_args) 16 | 17 | 18 | def build_backbone(cfg): 19 | return build(cfg, BACKBONES) 20 | 21 | 22 | def build_neck(cfg): 23 | return build(cfg, NECKS) 24 | 25 | 26 | def build_roi_extractor(cfg): 27 | return build(cfg, ROI_EXTRACTORS) 28 | 29 | 30 | def build_shared_head(cfg): 31 | return build(cfg, SHARED_HEADS) 32 | 33 | 34 | def build_head(cfg): 35 | return build(cfg, HEADS) 36 | 37 | 38 | def build_loss(cfg): 39 | return build(cfg, LOSSES) 40 | 41 | 42 | def build_detector(cfg, train_cfg=None, test_cfg=None): 43 | return build(cfg, DETECTORS, dict(train_cfg=train_cfg, test_cfg=test_cfg)) 44 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/detectors/__init__.py: -------------------------------------------------------------------------------- 1 | from .base import BaseDetector 2 | from .double_head_rcnn import DoubleHeadRCNN 3 | from .single_stage import SingleStageDetector 4 | from .two_stage import TwoStageDetector 5 | from .rpn import RPN 6 | from .fast_rcnn import FastRCNN 7 | from .faster_rcnn import FasterRCNN 8 | from .mask_rcnn import MaskRCNN 9 | from .cascade_rcnn import CascadeRCNN 10 | from .htc import HybridTaskCascade 11 | from .retinanet import RetinaNet 12 | from .fcos import FCOS 13 | from .grid_rcnn import GridRCNN 14 | from .mask_scoring_rcnn import MaskScoringRCNN 15 | 16 | __all__ = [ 17 | 'BaseDetector', 'SingleStageDetector', 'TwoStageDetector', 'RPN', 18 | 'FastRCNN', 'FasterRCNN', 'MaskRCNN', 'CascadeRCNN', 'HybridTaskCascade', 19 | 'RetinaNet', 'FCOS', 'GridRCNN', 'MaskScoringRCNN', 'DoubleHeadRCNN' 20 | ] 21 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/detectors/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/detectors/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/detectors/__pycache__/base.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/detectors/__pycache__/base.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/detectors/__pycache__/cascade_rcnn.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/detectors/__pycache__/cascade_rcnn.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/detectors/__pycache__/double_head_rcnn.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/detectors/__pycache__/double_head_rcnn.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/detectors/__pycache__/fast_rcnn.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/detectors/__pycache__/fast_rcnn.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/detectors/__pycache__/faster_rcnn.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/detectors/__pycache__/faster_rcnn.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/detectors/__pycache__/fcos.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/detectors/__pycache__/fcos.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/detectors/__pycache__/grid_rcnn.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/detectors/__pycache__/grid_rcnn.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/detectors/__pycache__/htc.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/detectors/__pycache__/htc.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/detectors/__pycache__/mask_rcnn.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/detectors/__pycache__/mask_rcnn.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/detectors/__pycache__/mask_scoring_rcnn.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/detectors/__pycache__/mask_scoring_rcnn.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/detectors/__pycache__/retinanet.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/detectors/__pycache__/retinanet.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/detectors/__pycache__/rpn.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/detectors/__pycache__/rpn.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/detectors/__pycache__/single_stage.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/detectors/__pycache__/single_stage.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/detectors/__pycache__/test_mixins.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/detectors/__pycache__/test_mixins.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/detectors/__pycache__/two_stage.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/detectors/__pycache__/two_stage.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/detectors/faster_rcnn.py: -------------------------------------------------------------------------------- 1 | from .two_stage import TwoStageDetector 2 | from ..registry import DETECTORS 3 | 4 | 5 | @DETECTORS.register_module 6 | class FasterRCNN(TwoStageDetector): 7 | 8 | def __init__(self, 9 | backbone, 10 | rpn_head, 11 | bbox_roi_extractor, 12 | bbox_head, 13 | train_cfg, 14 | test_cfg, 15 | neck=None, 16 | shared_head=None, 17 | cls_roi_scale_factor=None, 18 | reg_roi_scale_factor=None, 19 | pretrained=None): 20 | super(FasterRCNN, self).__init__( 21 | backbone=backbone, 22 | neck=neck, 23 | shared_head=shared_head, 24 | rpn_head=rpn_head, 25 | bbox_roi_extractor=bbox_roi_extractor, 26 | bbox_head=bbox_head, 27 | train_cfg=train_cfg, 28 | test_cfg=test_cfg, 29 | cls_roi_scale_factor = cls_roi_scale_factor, 30 | reg_roi_scale_factor = reg_roi_scale_factor, 31 | pretrained=pretrained) 32 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/detectors/fcos.py: -------------------------------------------------------------------------------- 1 | from .single_stage import SingleStageDetector 2 | from ..registry import DETECTORS 3 | 4 | 5 | @DETECTORS.register_module 6 | class FCOS(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(FCOS, self).__init__(backbone, neck, bbox_head, train_cfg, 16 | test_cfg, pretrained) 17 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/detectors/mask_rcnn.py: -------------------------------------------------------------------------------- 1 | from .two_stage import TwoStageDetector 2 | from ..registry import DETECTORS 3 | 4 | 5 | @DETECTORS.register_module 6 | class MaskRCNN(TwoStageDetector): 7 | 8 | def __init__(self, 9 | backbone, 10 | rpn_head, 11 | bbox_roi_extractor, 12 | bbox_head, 13 | mask_roi_extractor, 14 | mask_head, 15 | train_cfg, 16 | test_cfg, 17 | neck=None, 18 | shared_head=None, 19 | pretrained=None): 20 | super(MaskRCNN, self).__init__( 21 | backbone=backbone, 22 | neck=neck, 23 | shared_head=shared_head, 24 | rpn_head=rpn_head, 25 | bbox_roi_extractor=bbox_roi_extractor, 26 | bbox_head=bbox_head, 27 | mask_roi_extractor=mask_roi_extractor, 28 | mask_head=mask_head, 29 | train_cfg=train_cfg, 30 | test_cfg=test_cfg, 31 | pretrained=pretrained) 32 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/detectors/retinanet.py: -------------------------------------------------------------------------------- 1 | from .single_stage import SingleStageDetector 2 | from ..registry import DETECTORS 3 | 4 | 5 | @DETECTORS.register_module 6 | class RetinaNet(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(RetinaNet, self).__init__(backbone, neck, bbox_head, train_cfg, 16 | test_cfg, pretrained) 17 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/losses/__init__.py: -------------------------------------------------------------------------------- 1 | from .accuracy import accuracy, Accuracy 2 | from .cross_entropy_loss import (cross_entropy, binary_cross_entropy, 3 | mask_cross_entropy, CrossEntropyLoss) 4 | from .focal_loss import sigmoid_focal_loss, FocalLoss 5 | from .smooth_l1_loss import smooth_l1_loss, SmoothL1Loss 6 | from .ghm_loss import GHMC, GHMR 7 | from .balanced_l1_loss import balanced_l1_loss, BalancedL1Loss 8 | from .mse_loss import mse_loss, MSELoss 9 | from .iou_loss import iou_loss, bounded_iou_loss, IoULoss, BoundedIoULoss 10 | from .utils import reduce_loss, weight_reduce_loss, weighted_loss 11 | 12 | __all__ = [ 13 | 'accuracy', 'Accuracy', 'cross_entropy', 'binary_cross_entropy', 14 | 'mask_cross_entropy', 'CrossEntropyLoss', 'sigmoid_focal_loss', 15 | 'FocalLoss', 'smooth_l1_loss', 'SmoothL1Loss', 'balanced_l1_loss', 16 | 'BalancedL1Loss', 'mse_loss', 'MSELoss', 'iou_loss', 'bounded_iou_loss', 17 | 'IoULoss', 'BoundedIoULoss', 'GHMC', 'GHMR', 'reduce_loss', 18 | 'weight_reduce_loss', 'weighted_loss' 19 | ] 20 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/losses/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/losses/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/losses/__pycache__/accuracy.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/losses/__pycache__/accuracy.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/losses/__pycache__/balanced_l1_loss.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/losses/__pycache__/balanced_l1_loss.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/losses/__pycache__/cross_entropy_loss.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/losses/__pycache__/cross_entropy_loss.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/losses/__pycache__/focal_loss.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/losses/__pycache__/focal_loss.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/losses/__pycache__/ghm_loss.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/losses/__pycache__/ghm_loss.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/losses/__pycache__/iou_loss.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/losses/__pycache__/iou_loss.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/losses/__pycache__/mse_loss.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/losses/__pycache__/mse_loss.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/losses/__pycache__/smooth_l1_loss.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/losses/__pycache__/smooth_l1_loss.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/losses/__pycache__/utils.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/losses/__pycache__/utils.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/losses/accuracy.py: -------------------------------------------------------------------------------- 1 | import torch.nn as nn 2 | 3 | 4 | def accuracy(pred, target, topk=1): 5 | assert isinstance(topk, (int, tuple)) 6 | if isinstance(topk, int): 7 | topk = (topk, ) 8 | return_single = True 9 | else: 10 | return_single = False 11 | 12 | maxk = max(topk) 13 | _, pred_label = pred.topk(maxk, dim=1) 14 | pred_label = pred_label.t() 15 | correct = pred_label.eq(target.view(1, -1).expand_as(pred_label)) 16 | 17 | res = [] 18 | for k in topk: 19 | correct_k = correct[:k].view(-1).float().sum(0, keepdim=True) 20 | res.append(correct_k.mul_(100.0 / pred.size(0))) 21 | return res[0] if return_single else res 22 | 23 | 24 | class Accuracy(nn.Module): 25 | 26 | def __init__(self, topk=(1, )): 27 | super().__init__() 28 | self.topk = topk 29 | 30 | def forward(self, pred, target): 31 | return accuracy(pred, target, self.topk) 32 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/losses/mse_loss.py: -------------------------------------------------------------------------------- 1 | import torch.nn as nn 2 | import torch.nn.functional as F 3 | 4 | from .utils import weighted_loss 5 | from ..registry import LOSSES 6 | 7 | mse_loss = weighted_loss(F.mse_loss) 8 | 9 | 10 | @LOSSES.register_module 11 | class MSELoss(nn.Module): 12 | 13 | def __init__(self, reduction='mean', loss_weight=1.0): 14 | super().__init__() 15 | self.reduction = reduction 16 | self.loss_weight = loss_weight 17 | 18 | def forward(self, pred, target, weight=None, avg_factor=None): 19 | loss = self.loss_weight * mse_loss( 20 | pred, 21 | target, 22 | weight, 23 | reduction=self.reduction, 24 | avg_factor=avg_factor) 25 | return loss 26 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/mask_heads/__init__.py: -------------------------------------------------------------------------------- 1 | from .fcn_mask_head import FCNMaskHead 2 | from .fused_semantic_head import FusedSemanticHead 3 | from .grid_head import GridHead 4 | from .htc_mask_head import HTCMaskHead 5 | from .maskiou_head import MaskIoUHead 6 | 7 | __all__ = [ 8 | 'FCNMaskHead', 'HTCMaskHead', 'FusedSemanticHead', 'GridHead', 9 | 'MaskIoUHead' 10 | ] 11 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/mask_heads/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/mask_heads/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/mask_heads/__pycache__/fcn_mask_head.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/mask_heads/__pycache__/fcn_mask_head.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/mask_heads/__pycache__/fused_semantic_head.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/mask_heads/__pycache__/fused_semantic_head.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/mask_heads/__pycache__/grid_head.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/mask_heads/__pycache__/grid_head.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/mask_heads/__pycache__/htc_mask_head.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/mask_heads/__pycache__/htc_mask_head.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/mask_heads/__pycache__/maskiou_head.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/mask_heads/__pycache__/maskiou_head.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/necks/__init__.py: -------------------------------------------------------------------------------- 1 | from .fpn import FPN 2 | from .fpn_panet import PAFPN 3 | from .bfp import BFP 4 | from .hrfpn import HRFPN 5 | from .nas_fpn import NASFPN 6 | from .search_pafpn import SearchPAFPN 7 | 8 | __all__ = ['FPN', 'BFP', 'HRFPN', 'NASFPN', 9 | 'PAFPN', 'SearchPAFPN'] 10 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/necks/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/necks/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/necks/__pycache__/bfp.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/necks/__pycache__/bfp.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/necks/__pycache__/fpn.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/necks/__pycache__/fpn.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/necks/__pycache__/fpn_panet.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/necks/__pycache__/fpn_panet.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/necks/__pycache__/hrfpn.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/necks/__pycache__/hrfpn.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/necks/__pycache__/nas_fpn.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/necks/__pycache__/nas_fpn.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/necks/__pycache__/search_pafpn.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/necks/__pycache__/search_pafpn.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/necks/auto_neck/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/necks/auto_neck/__init__.py -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/necks/auto_neck/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/necks/auto_neck/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/necks/auto_neck/__pycache__/build_neck.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/necks/auto_neck/__pycache__/build_neck.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/necks/auto_neck/__pycache__/hit_neck_search.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/necks/auto_neck/__pycache__/hit_neck_search.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/necks/auto_neck/__pycache__/hit_ops.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/necks/auto_neck/__pycache__/hit_ops.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/necks/auto_neck/build_neck.py: -------------------------------------------------------------------------------- 1 | # -------------------------------------------------------- 2 | # Copyright (c) 2019 Jianyuan Guo (guojianyuan1@huawei.com) 3 | # -------------------------------------------------------- 4 | 5 | # from .darts_neck_search import DartsNeck 6 | from .hit_neck_search import HitNeck 7 | 8 | 9 | def build_search_neck(cfg): 10 | """Build neck model from config dict. 11 | """ 12 | if cfg is not None: 13 | cfg_ = cfg.copy() 14 | neck_type = cfg_.pop('type') 15 | if neck_type == 'DARTS': 16 | raise NotImplementedError 17 | # return DartsNeck(**cfg_) 18 | elif neck_type == 'HitDet': 19 | return HitNeck(**cfg_) 20 | else: 21 | raise KeyError('Invalid neck type {}'.fromat(neck_type)) 22 | else: 23 | return None -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/plugins/__init__.py: -------------------------------------------------------------------------------- 1 | from .non_local import NonLocal2D 2 | from .generalized_attention import GeneralizedAttention 3 | 4 | __all__ = ['NonLocal2D', 'GeneralizedAttention'] 5 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/plugins/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/plugins/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/plugins/__pycache__/generalized_attention.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/plugins/__pycache__/generalized_attention.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/plugins/__pycache__/non_local.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/plugins/__pycache__/non_local.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/registry.py: -------------------------------------------------------------------------------- 1 | from mmdet.utils import Registry 2 | 3 | BACKBONES = Registry('backbone') 4 | NECKS = Registry('neck') 5 | ROI_EXTRACTORS = Registry('roi_extractor') 6 | SHARED_HEADS = Registry('shared_head') 7 | HEADS = Registry('head') 8 | LOSSES = Registry('loss') 9 | DETECTORS = Registry('detector') -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/roi_extractors/__init__.py: -------------------------------------------------------------------------------- 1 | from .single_level import SingleRoIExtractor 2 | 3 | __all__ = ['SingleRoIExtractor'] 4 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/roi_extractors/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/roi_extractors/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/roi_extractors/__pycache__/single_level.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/roi_extractors/__pycache__/single_level.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/shared_heads/__init__.py: -------------------------------------------------------------------------------- 1 | from .res_layer import ResLayer 2 | 3 | __all__ = ['ResLayer'] 4 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/shared_heads/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/shared_heads/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/shared_heads/__pycache__/res_layer.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/shared_heads/__pycache__/res_layer.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/utils/__init__.py: -------------------------------------------------------------------------------- 1 | from .conv_ws import conv_ws_2d, ConvWS2d 2 | from .conv_module import build_conv_layer, ConvModule 3 | from .norm import build_norm_layer 4 | from .scale import Scale 5 | from .weight_init import (xavier_init, normal_init, uniform_init, kaiming_init, 6 | bias_init_with_prob) 7 | 8 | __all__ = [ 9 | 'conv_ws_2d', 'ConvWS2d', 'build_conv_layer', 'ConvModule', 10 | 'build_norm_layer', 'xavier_init', 'normal_init', 'uniform_init', 11 | 'kaiming_init', 'bias_init_with_prob', 'Scale' 12 | ] 13 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/utils/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/utils/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/utils/__pycache__/conv_module.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/utils/__pycache__/conv_module.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/utils/__pycache__/conv_ws.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/utils/__pycache__/conv_ws.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/utils/__pycache__/norm.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/utils/__pycache__/norm.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/utils/__pycache__/quant_conv.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/utils/__pycache__/quant_conv.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/utils/__pycache__/scale.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/utils/__pycache__/scale.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/utils/__pycache__/weight_init.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/models/utils/__pycache__/weight_init.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/models/utils/scale.py: -------------------------------------------------------------------------------- 1 | import torch 2 | import torch.nn as nn 3 | 4 | 5 | class Scale(nn.Module): 6 | 7 | def __init__(self, scale=1.0): 8 | super(Scale, self).__init__() 9 | self.scale = nn.Parameter(torch.tensor(scale, dtype=torch.float)) 10 | 11 | def forward(self, x): 12 | return x * self.scale 13 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/__init__.py: -------------------------------------------------------------------------------- 1 | from .dcn import (DeformConv, DeformConvPack, ModulatedDeformConv, 2 | ModulatedDeformConvPack, DeformRoIPooling, 3 | DeformRoIPoolingPack, ModulatedDeformRoIPoolingPack, 4 | deform_conv, modulated_deform_conv, deform_roi_pooling) 5 | from .gcb import ContextBlock 6 | from .nms import nms, soft_nms 7 | from .roi_align import RoIAlign, roi_align 8 | from .roi_pool import RoIPool, roi_pool 9 | from .sigmoid_focal_loss import SigmoidFocalLoss, sigmoid_focal_loss 10 | from .masked_conv import MaskedConv2d 11 | 12 | __all__ = [ 13 | 'nms', 'soft_nms', 'RoIAlign', 'roi_align', 'RoIPool', 'roi_pool', 14 | 'DeformConv', 'DeformConvPack', 'DeformRoIPooling', 'DeformRoIPoolingPack', 15 | 'ModulatedDeformRoIPoolingPack', 'ModulatedDeformConv', 16 | 'ModulatedDeformConvPack', 'deform_conv', 'modulated_deform_conv', 17 | 'deform_roi_pooling', 'SigmoidFocalLoss', 'sigmoid_focal_loss', 18 | 'MaskedConv2d', 'ContextBlock' 19 | ] 20 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/dcn/__init__.py: -------------------------------------------------------------------------------- 1 | from .functions.deform_conv import deform_conv, modulated_deform_conv 2 | from .functions.deform_pool import deform_roi_pooling 3 | from .modules.deform_conv import (DeformConv, ModulatedDeformConv, 4 | DeformConvPack, ModulatedDeformConvPack) 5 | from .modules.deform_pool import (DeformRoIPooling, DeformRoIPoolingPack, 6 | ModulatedDeformRoIPoolingPack) 7 | 8 | __all__ = [ 9 | 'DeformConv', 'DeformConvPack', 'ModulatedDeformConv', 10 | 'ModulatedDeformConvPack', 'DeformRoIPooling', 'DeformRoIPoolingPack', 11 | 'ModulatedDeformRoIPoolingPack', 'deform_conv', 'modulated_deform_conv', 12 | 'deform_roi_pooling' 13 | ] 14 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/dcn/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/dcn/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/dcn/functions/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/dcn/functions/__init__.py -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/dcn/functions/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/dcn/functions/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/dcn/functions/__pycache__/deform_conv.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/dcn/functions/__pycache__/deform_conv.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/dcn/functions/__pycache__/deform_pool.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/dcn/functions/__pycache__/deform_pool.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/dcn/modules/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/dcn/modules/__init__.py -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/dcn/modules/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/dcn/modules/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/dcn/modules/__pycache__/deform_conv.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/dcn/modules/__pycache__/deform_conv.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/dcn/modules/__pycache__/deform_pool.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/dcn/modules/__pycache__/deform_pool.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/dcn/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | from torch.utils.cpp_extension import BuildExtension, CUDAExtension 3 | 4 | setup( 5 | name='deform_conv', 6 | ext_modules=[ 7 | CUDAExtension('deform_conv_cuda', [ 8 | 'src/deform_conv_cuda.cpp', 9 | 'src/deform_conv_cuda_kernel.cu', 10 | ]), 11 | CUDAExtension( 12 | 'deform_pool_cuda', 13 | ['src/deform_pool_cuda.cpp', 'src/deform_pool_cuda_kernel.cu']), 14 | ], 15 | cmdclass={'build_ext': BuildExtension}) 16 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/gcb/__init__.py: -------------------------------------------------------------------------------- 1 | from .context_block import ContextBlock 2 | 3 | __all__ = [ 4 | 'ContextBlock', 5 | ] 6 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/gcb/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/gcb/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/gcb/__pycache__/context_block.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/gcb/__pycache__/context_block.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/masked_conv/__init__.py: -------------------------------------------------------------------------------- 1 | from .functions.masked_conv import masked_conv2d 2 | from .modules.masked_conv import MaskedConv2d 3 | 4 | __all__ = ['masked_conv2d', 'MaskedConv2d'] 5 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/masked_conv/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/masked_conv/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/masked_conv/functions/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/masked_conv/functions/__init__.py -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/masked_conv/functions/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/masked_conv/functions/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/masked_conv/functions/__pycache__/masked_conv.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/masked_conv/functions/__pycache__/masked_conv.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/masked_conv/modules/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/masked_conv/modules/__init__.py -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/masked_conv/modules/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/masked_conv/modules/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/masked_conv/modules/__pycache__/masked_conv.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/masked_conv/modules/__pycache__/masked_conv.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/masked_conv/modules/masked_conv.py: -------------------------------------------------------------------------------- 1 | import torch.nn as nn 2 | from ..functions.masked_conv import masked_conv2d 3 | 4 | 5 | class MaskedConv2d(nn.Conv2d): 6 | """A MaskedConv2d which inherits the official Conv2d. 7 | 8 | The masked forward doesn't implement the backward function and only 9 | supports the stride parameter to be 1 currently. 10 | """ 11 | 12 | def __init__(self, 13 | in_channels, 14 | out_channels, 15 | kernel_size, 16 | stride=1, 17 | padding=0, 18 | dilation=1, 19 | groups=1, 20 | bias=True): 21 | super(MaskedConv2d, 22 | self).__init__(in_channels, out_channels, kernel_size, stride, 23 | padding, dilation, groups, bias) 24 | 25 | def forward(self, input, mask=None): 26 | if mask is None: # fallback to the normal Conv2d 27 | return super(MaskedConv2d, self).forward(input) 28 | else: 29 | return masked_conv2d(input, mask, self.weight, self.bias, 30 | self.padding) 31 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/masked_conv/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | from torch.utils.cpp_extension import BuildExtension, CUDAExtension 3 | 4 | setup( 5 | name='masked_conv2d_cuda', 6 | ext_modules=[ 7 | CUDAExtension('masked_conv2d_cuda', [ 8 | 'src/masked_conv2d_cuda.cpp', 9 | 'src/masked_conv2d_kernel.cu', 10 | ]), 11 | ], 12 | cmdclass={'build_ext': BuildExtension}) 13 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/nms/__init__.py: -------------------------------------------------------------------------------- 1 | from .nms_wrapper import nms, soft_nms 2 | 3 | __all__ = ['nms', 'soft_nms'] 4 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/nms/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/nms/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/nms/__pycache__/nms_wrapper.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/nms/__pycache__/nms_wrapper.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/nms/src/nms_cuda.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. 2 | #include 3 | 4 | #define CHECK_CUDA(x) TORCH_CHECK(x.type().is_cuda(), #x, " must be a CUDAtensor ") 5 | 6 | at::Tensor nms_cuda(const at::Tensor boxes, float nms_overlap_thresh); 7 | 8 | at::Tensor nms(const at::Tensor& dets, const float threshold) { 9 | CHECK_CUDA(dets); 10 | if (dets.numel() == 0) 11 | return at::empty({0}, dets.options().dtype(at::kLong).device(at::kCPU)); 12 | return nms_cuda(dets, threshold); 13 | } 14 | 15 | PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { 16 | m.def("nms", &nms, "non-maximum suppression"); 17 | } 18 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/roi_align/__init__.py: -------------------------------------------------------------------------------- 1 | from .roi_align import RoIAlign, roi_align 2 | 3 | __all__ = ['roi_align', 'RoIAlign'] 4 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/roi_align/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/roi_align/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/roi_align/__pycache__/roi_align.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/roi_align/__pycache__/roi_align.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/roi_align/functions/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/roi_align/functions/__init__.py -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/roi_align/gradcheck.py: -------------------------------------------------------------------------------- 1 | import os.path as osp 2 | import sys 3 | 4 | import numpy as np 5 | import torch 6 | from torch.autograd import gradcheck 7 | 8 | sys.path.append(osp.abspath(osp.join(__file__, '../../'))) 9 | from roi_align import RoIAlign # noqa: E402, isort:skip 10 | 11 | feat_size = 15 12 | spatial_scale = 1.0 / 8 13 | img_size = feat_size / spatial_scale 14 | num_imgs = 2 15 | num_rois = 20 16 | 17 | batch_ind = np.random.randint(num_imgs, size=(num_rois, 1)) 18 | rois = np.random.rand(num_rois, 4) * img_size * 0.5 19 | rois[:, 2:] += img_size * 0.5 20 | rois = np.hstack((batch_ind, rois)) 21 | 22 | feat = torch.randn( 23 | num_imgs, 16, feat_size, feat_size, requires_grad=True, device='cuda:0') 24 | rois = torch.from_numpy(rois).float().cuda() 25 | inputs = (feat, rois) 26 | print('Gradcheck for roi align...') 27 | test = gradcheck(RoIAlign(3, spatial_scale), inputs, atol=1e-3, eps=1e-3) 28 | print(test) 29 | test = gradcheck(RoIAlign(3, spatial_scale, 2), inputs, atol=1e-3, eps=1e-3) 30 | print(test) 31 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/roi_align/modules/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/roi_align/modules/__init__.py -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/roi_align/modules/roi_align.py: -------------------------------------------------------------------------------- 1 | from torch.nn.modules.module import Module 2 | from ..functions.roi_align import RoIAlignFunction 3 | 4 | 5 | class RoIAlign(Module): 6 | 7 | def __init__(self, out_size, spatial_scale, sample_num=0): 8 | super(RoIAlign, self).__init__() 9 | 10 | self.out_size = out_size 11 | self.spatial_scale = float(spatial_scale) 12 | self.sample_num = int(sample_num) 13 | 14 | def forward(self, features, rois): 15 | return RoIAlignFunction.apply(features, rois, self.out_size, 16 | self.spatial_scale, self.sample_num) 17 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/roi_align/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | from torch.utils.cpp_extension import BuildExtension, CUDAExtension 3 | 4 | setup( 5 | name='roi_align_cuda', 6 | ext_modules=[ 7 | CUDAExtension('roi_align_cuda', [ 8 | 'src/roi_align_cuda.cpp', 9 | 'src/roi_align_kernel.cu', 10 | ]), 11 | ], 12 | cmdclass={'build_ext': BuildExtension}) 13 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/roi_pool/__init__.py: -------------------------------------------------------------------------------- 1 | from .functions.roi_pool import roi_pool 2 | from .modules.roi_pool import RoIPool 3 | 4 | __all__ = ['roi_pool', 'RoIPool'] 5 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/roi_pool/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/roi_pool/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/roi_pool/functions/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/roi_pool/functions/__init__.py -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/roi_pool/functions/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/roi_pool/functions/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/roi_pool/functions/__pycache__/roi_pool.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/roi_pool/functions/__pycache__/roi_pool.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/roi_pool/gradcheck.py: -------------------------------------------------------------------------------- 1 | import torch 2 | from torch.autograd import gradcheck 3 | 4 | import os.path as osp 5 | import sys 6 | sys.path.append(osp.abspath(osp.join(__file__, '../../'))) 7 | from roi_pool import RoIPool # noqa: E402 8 | 9 | feat = torch.randn(4, 16, 15, 15, requires_grad=True).cuda() 10 | rois = torch.Tensor([[0, 0, 0, 50, 50], [0, 10, 30, 43, 55], 11 | [1, 67, 40, 110, 120]]).cuda() 12 | inputs = (feat, rois) 13 | print('Gradcheck for roi pooling...') 14 | test = gradcheck(RoIPool(4, 1.0 / 8), inputs, eps=1e-5, atol=1e-3) 15 | print(test) 16 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/roi_pool/modules/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/roi_pool/modules/__init__.py -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/roi_pool/modules/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/roi_pool/modules/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/roi_pool/modules/__pycache__/roi_pool.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/roi_pool/modules/__pycache__/roi_pool.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/roi_pool/modules/roi_pool.py: -------------------------------------------------------------------------------- 1 | from torch.nn.modules.module import Module 2 | from ..functions.roi_pool import roi_pool 3 | 4 | 5 | class RoIPool(Module): 6 | 7 | def __init__(self, out_size, spatial_scale): 8 | super(RoIPool, self).__init__() 9 | 10 | self.out_size = out_size 11 | self.spatial_scale = float(spatial_scale) 12 | 13 | def forward(self, features, rois): 14 | return roi_pool(features, rois, self.out_size, self.spatial_scale) 15 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/roi_pool/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | from torch.utils.cpp_extension import BuildExtension, CUDAExtension 3 | 4 | setup( 5 | name='roi_pool', 6 | ext_modules=[ 7 | CUDAExtension('roi_pool_cuda', [ 8 | 'src/roi_pool_cuda.cpp', 9 | 'src/roi_pool_kernel.cu', 10 | ]) 11 | ], 12 | cmdclass={'build_ext': BuildExtension}) 13 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/sigmoid_focal_loss/__init__.py: -------------------------------------------------------------------------------- 1 | from .modules.sigmoid_focal_loss import SigmoidFocalLoss, sigmoid_focal_loss 2 | 3 | __all__ = ['SigmoidFocalLoss', 'sigmoid_focal_loss'] 4 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/sigmoid_focal_loss/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/sigmoid_focal_loss/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/sigmoid_focal_loss/functions/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/sigmoid_focal_loss/functions/__init__.py -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/sigmoid_focal_loss/functions/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/sigmoid_focal_loss/functions/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/sigmoid_focal_loss/functions/__pycache__/sigmoid_focal_loss.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/sigmoid_focal_loss/functions/__pycache__/sigmoid_focal_loss.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/sigmoid_focal_loss/functions/sigmoid_focal_loss.py: -------------------------------------------------------------------------------- 1 | from torch.autograd import Function 2 | from torch.autograd.function import once_differentiable 3 | 4 | from .. import sigmoid_focal_loss_cuda 5 | 6 | 7 | class SigmoidFocalLossFunction(Function): 8 | 9 | @staticmethod 10 | def forward(ctx, input, target, gamma=2.0, alpha=0.25): 11 | ctx.save_for_backward(input, target) 12 | num_classes = input.shape[1] 13 | ctx.num_classes = num_classes 14 | ctx.gamma = gamma 15 | ctx.alpha = alpha 16 | 17 | loss = sigmoid_focal_loss_cuda.forward(input, target, num_classes, 18 | gamma, alpha) 19 | return loss 20 | 21 | @staticmethod 22 | @once_differentiable 23 | def backward(ctx, d_loss): 24 | input, target = ctx.saved_tensors 25 | num_classes = ctx.num_classes 26 | gamma = ctx.gamma 27 | alpha = ctx.alpha 28 | d_loss = d_loss.contiguous() 29 | d_input = sigmoid_focal_loss_cuda.backward(input, target, d_loss, 30 | num_classes, gamma, alpha) 31 | return d_input, None, None, None, None 32 | 33 | 34 | sigmoid_focal_loss = SigmoidFocalLossFunction.apply 35 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/sigmoid_focal_loss/modules/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/sigmoid_focal_loss/modules/__init__.py -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/sigmoid_focal_loss/modules/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/sigmoid_focal_loss/modules/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/sigmoid_focal_loss/modules/__pycache__/sigmoid_focal_loss.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/ops/sigmoid_focal_loss/modules/__pycache__/sigmoid_focal_loss.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/sigmoid_focal_loss/modules/sigmoid_focal_loss.py: -------------------------------------------------------------------------------- 1 | from torch import nn 2 | 3 | from ..functions.sigmoid_focal_loss import sigmoid_focal_loss 4 | 5 | 6 | # TODO: remove this module 7 | class SigmoidFocalLoss(nn.Module): 8 | 9 | def __init__(self, gamma, alpha): 10 | super(SigmoidFocalLoss, self).__init__() 11 | self.gamma = gamma 12 | self.alpha = alpha 13 | 14 | def forward(self, logits, targets): 15 | assert logits.is_cuda 16 | loss = sigmoid_focal_loss(logits, targets, self.gamma, self.alpha) 17 | return loss.sum() 18 | 19 | def __repr__(self): 20 | tmpstr = self.__class__.__name__ + "(" 21 | tmpstr += "gamma=" + str(self.gamma) 22 | tmpstr += ", alpha=" + str(self.alpha) 23 | tmpstr += ")" 24 | return tmpstr 25 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/ops/sigmoid_focal_loss/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | from torch.utils.cpp_extension import BuildExtension, CUDAExtension 3 | 4 | setup( 5 | name='SigmoidFocalLoss', 6 | ext_modules=[ 7 | CUDAExtension('sigmoid_focal_loss_cuda', [ 8 | 'src/sigmoid_focal_loss.cpp', 9 | 'src/sigmoid_focal_loss_cuda.cu', 10 | ]), 11 | ], 12 | cmdclass={'build_ext': BuildExtension}) 13 | -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/utils/__init__.py: -------------------------------------------------------------------------------- 1 | from .collect_env import collect_env 2 | from .flops_counter import get_model_complexity_info 3 | from .logger import get_root_logger, print_log 4 | from .registry import Registry, build_from_cfg 5 | 6 | 7 | __all__ = [ 8 | 'Registry', 'build_from_cfg', 'get_model_complexity_info', 9 | 'get_root_logger', 'print_log', 'collect_env' 10 | ] -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/utils/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/utils/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/utils/__pycache__/collect_env.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/utils/__pycache__/collect_env.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/utils/__pycache__/flops_counter.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/utils/__pycache__/flops_counter.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/utils/__pycache__/logger.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/utils/__pycache__/logger.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/utils/__pycache__/registry.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_detection/mmdet/utils/__pycache__/registry.cpython-36.pyc -------------------------------------------------------------------------------- /CDARTS_detection/mmdet/version.py: -------------------------------------------------------------------------------- 1 | # GENERATED VERSION FILE 2 | # TIME: Fri Oct 15 17:01:16 2021 3 | 4 | __version__ = '0.6.0+0889383' 5 | short_version = '0.6.0' 6 | -------------------------------------------------------------------------------- /CDARTS_detection/scripts/train_hit_det.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cd ../ 4 | 5 | GPUs=8 6 | CONFIG='configs/nas_trinity/2stage_hitdet.py' 7 | WORKDIR='./work_dirs/hitdet_1x/' 8 | 9 | python -m torch.distributed.launch \ 10 | --nproc_per_node=${GPUs} train.py \ 11 | --validate \ 12 | --gpus ${GPUs} \ 13 | --launcher pytorch \ 14 | --config ${CONFIG} \ 15 | --work_dir ${WORKDIR} 16 | -------------------------------------------------------------------------------- /CDARTS_detection/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 | args = parser.parse_args() 24 | coco_eval(args.result, args.types, args.ann, args.max_dets) 25 | 26 | 27 | if __name__ == '__main__': 28 | main() 29 | -------------------------------------------------------------------------------- /CDARTS_detection/tools/dist_test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | PYTHON=${PYTHON:-"python"} 4 | 5 | CONFIG=$1 6 | CHECKPOINT=$2 7 | GPUS=$3 8 | 9 | $PYTHON -m torch.distributed.launch --nproc_per_node=$GPUS \ 10 | $(dirname "$0")/test.py $CONFIG $CHECKPOINT --launcher pytorch ${@:4} 11 | -------------------------------------------------------------------------------- /CDARTS_detection/tools/dist_train.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | PYTHON=${PYTHON:-"python"} 4 | 5 | CONFIG=$1 6 | GPUS=$2 7 | 8 | $PYTHON -m torch.distributed.launch --nproc_per_node=$GPUS \ 9 | $(dirname "$0")/train.py $CONFIG --launcher pytorch ${@:3} 10 | -------------------------------------------------------------------------------- /CDARTS_detection/tools/publish_model.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import subprocess 3 | import torch 4 | 5 | 6 | def parse_args(): 7 | parser = argparse.ArgumentParser( 8 | description='Process a checkpoint to be published') 9 | parser.add_argument('in_file', help='input checkpoint filename') 10 | parser.add_argument('out_file', help='output checkpoint filename') 11 | args = parser.parse_args() 12 | return args 13 | 14 | 15 | def process_checkpoint(in_file, out_file): 16 | checkpoint = torch.load(in_file, map_location='cpu') 17 | # remove optimizer for smaller file size 18 | if 'optimizer' in checkpoint: 19 | del checkpoint['optimizer'] 20 | # if it is necessary to remove some sensitive data in checkpoint['meta'], 21 | # add the code here. 22 | torch.save(checkpoint, out_file) 23 | sha = subprocess.check_output(['sha256sum', out_file]).decode() 24 | final_file = out_file.rstrip('.pth') + '-{}.pth'.format(sha[:8]) 25 | subprocess.Popen(['mv', out_file, final_file]) 26 | 27 | 28 | def main(): 29 | args = parse_args() 30 | process_checkpoint(args.in_file, args.out_file) 31 | 32 | 33 | if __name__ == '__main__': 34 | main() 35 | -------------------------------------------------------------------------------- /CDARTS_detection/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 | srun -p ${PARTITION} \ 16 | --job-name=${JOB_NAME} \ 17 | --gres=gpu:${GPUS_PER_NODE} \ 18 | --ntasks=${GPUS} \ 19 | --ntasks-per-node=${GPUS_PER_NODE} \ 20 | --cpus-per-task=${CPUS_PER_TASK} \ 21 | --kill-on-bad-exit=1 \ 22 | ${SRUN_ARGS} \ 23 | python -u tools/test.py ${CONFIG} ${CHECKPOINT} --launcher="slurm" ${PY_ARGS} 24 | -------------------------------------------------------------------------------- /CDARTS_detection/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=${5:-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=${PY_ARGS:-"--validate"} 14 | 15 | srun -p ${PARTITION} \ 16 | --job-name=${JOB_NAME} \ 17 | --gres=gpu:${GPUS_PER_NODE} \ 18 | --ntasks=${GPUS} \ 19 | --ntasks-per-node=${GPUS_PER_NODE} \ 20 | --cpus-per-task=${CPUS_PER_TASK} \ 21 | --kill-on-bad-exit=1 \ 22 | ${SRUN_ARGS} \ 23 | python -u tools/train.py ${CONFIG} --work_dir=${WORK_DIR} --launcher="slurm" ${PY_ARGS} 24 | -------------------------------------------------------------------------------- /CDARTS_detection/train.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | 4 | GPUs=8 5 | CONFIG='configs/CyDAS_retinanet_1x.py' 6 | WORKDIR='./work_dirs/CyDAS_1x/' 7 | 8 | python -m torch.distributed.launch \ 9 | --nproc_per_node=${GPUs} train.py \ 10 | --validate \ 11 | --gpus ${GPUs} \ 12 | --launcher pytorch \ 13 | --config ${CONFIG} \ 14 | --work_dir ${WORKDIR} 15 | -------------------------------------------------------------------------------- /CDARTS_segmentation/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Wuyang 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /CDARTS_segmentation/configs/ade/cydas.yaml: -------------------------------------------------------------------------------- 1 | json_file: "jsons/big4.json" 2 | data_path: "../DATASET/ADEChallengeData2016/" 3 | dataset: "coco" 4 | det2_cfg: "configs/ADE20K/base.yaml" 5 | num_classes: 150 6 | max_iteration: 160000 7 | seed: 12345 8 | random_sample: False 9 | eval_flag: True 10 | opt: "sgd" 11 | opt_eps: 0.001 12 | sched: "new" #"raw for original" 13 | epochs: 1000 14 | drop_path_prob: 0.2 15 | image_height: 640 16 | image_width: 640 17 | eval_height: 640 18 | eval_width: 640 19 | crop_size: 640 20 | batch_size: 4 21 | mode: "poly" 22 | base_lr: 0.05 23 | Fch: 16 24 | bn_momentum: 0.01 25 | warmup_start_lr: 5e-6 26 | warmup_iters: 1000 27 | weight_decay: 1e-4 28 | model_ema: True 29 | model_ema_decay: 0.9998 30 | clip_grad: 1.0 31 | lamb: 0.2 32 | ignore: 255 33 | topk_percent: 0.2 34 | semantic_loss_weight: 1.0 35 | center_loss_weight: 200 36 | offset_loss_weight: 0.01 37 | eval_flip: False 38 | -------------------------------------------------------------------------------- /CDARTS_segmentation/configs/cityscapes/cydas.yaml: -------------------------------------------------------------------------------- 1 | data_path: "../DATASET/cityscapes/" 2 | det2_cfg: "configs/Cityscapes-PanopticSegmentation/panoptic_deeplab_R_52_os16_mg124_poly_90k_bs32_crop_512_1024.yaml" 3 | seed: 12345 4 | random_sample: False 5 | opt: "sgd" 6 | opt_eps: 0.001 7 | sched: "new" #"raw for original" 8 | epochs: 4000 9 | drop_path_prob: 0.2 10 | image_height: 512 11 | image_width: 1024 12 | eval_height: 1024 13 | eval_width: 2048 14 | batch_size: 4 15 | mode: "poly" 16 | base_lr: 0.05 17 | workers: 4 18 | Fch: 6 19 | warmup_start_lr: 5e-6 20 | warmup_iters: 1000 21 | weight_decay: 1e-4 22 | model_ema: True 23 | model_ema_decay: 0.9998 24 | stem_head_width: 1.0 25 | -------------------------------------------------------------------------------- /CDARTS_segmentation/dataloaders/datasets/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_segmentation/dataloaders/datasets/__init__.py -------------------------------------------------------------------------------- /CDARTS_segmentation/dataloaders/segdatasets/__init__.py: -------------------------------------------------------------------------------- 1 | from .base_dataset import BaseDataset 2 | from .cityscapes import Cityscapes 3 | from .cityscapes_panoptic import CityscapesPanoptic 4 | from .coco_panoptic import COCOPanoptic 5 | -------------------------------------------------------------------------------- /CDARTS_segmentation/dataloaders/segdatasets/utils.py: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Reference: https://github.com/tensorflow/models/blob/master/research/deeplab/datasets/data_generator.py 3 | # ------------------------------------------------------------------------------ 4 | 5 | import collections 6 | 7 | # Named tuple to describe the dataset properties. 8 | DatasetDescriptor = collections.namedtuple( 9 | 'DatasetDescriptor', 10 | [ 11 | 'splits_to_sizes', # Splits of the dataset into training, val and test. 12 | 'num_classes', # Number of semantic classes, including the 13 | # background class (if exists). For example, there 14 | # are 20 foreground classes + 1 background class in 15 | # the PASCAL VOC 2012 dataset. Thus, we set 16 | # num_classes=21. 17 | 'ignore_label', # Ignore label value. 18 | ]) 19 | -------------------------------------------------------------------------------- /CDARTS_segmentation/dataloaders/transforms/__init__.py: -------------------------------------------------------------------------------- 1 | from .build import build_transforms 2 | from .pre_augmentation_transforms import Resize 3 | from .target_transforms import PanopticTargetGenerator, SemanticTargetGenerator 4 | -------------------------------------------------------------------------------- /CDARTS_segmentation/segmentation/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_segmentation/segmentation/__init__.py -------------------------------------------------------------------------------- /CDARTS_segmentation/segmentation/config/__init__.py: -------------------------------------------------------------------------------- 1 | from .default import _C as config 2 | from .default import update_config 3 | seg_config = config 4 | update_seg_config = update_config -------------------------------------------------------------------------------- /CDARTS_segmentation/segmentation/data/__init__.py: -------------------------------------------------------------------------------- 1 | from .build import ( 2 | build_dataset_from_cfg, build_train_loader_from_cfg, build_test_loader_from_cfg) 3 | -------------------------------------------------------------------------------- /CDARTS_segmentation/segmentation/data/datasets/__init__.py: -------------------------------------------------------------------------------- 1 | from .base_dataset import BaseDataset 2 | from .cityscapes import Cityscapes 3 | from .cityscapes_panoptic import CityscapesPanoptic 4 | from .coco_panoptic import COCOPanoptic 5 | -------------------------------------------------------------------------------- /CDARTS_segmentation/segmentation/data/datasets/utils.py: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Reference: https://github.com/tensorflow/models/blob/master/research/deeplab/datasets/data_generator.py 3 | # ------------------------------------------------------------------------------ 4 | 5 | import collections 6 | 7 | # Named tuple to describe the dataset properties. 8 | DatasetDescriptor = collections.namedtuple( 9 | 'DatasetDescriptor', 10 | [ 11 | 'splits_to_sizes', # Splits of the dataset into training, val and test. 12 | 'num_classes', # Number of semantic classes, including the 13 | # background class (if exists). For example, there 14 | # are 20 foreground classes + 1 background class in 15 | # the PASCAL VOC 2012 dataset. Thus, we set 16 | # num_classes=21. 17 | 'ignore_label', # Ignore label value. 18 | ]) 19 | -------------------------------------------------------------------------------- /CDARTS_segmentation/segmentation/data/samplers/__init__.py: -------------------------------------------------------------------------------- 1 | from .distributed_sampler import TrainingSampler, InferenceSampler 2 | -------------------------------------------------------------------------------- /CDARTS_segmentation/segmentation/data/transforms/__init__.py: -------------------------------------------------------------------------------- 1 | from .build import build_transforms 2 | from .pre_augmentation_transforms import Resize 3 | from .target_transforms import PanopticTargetGenerator, SemanticTargetGenerator 4 | -------------------------------------------------------------------------------- /CDARTS_segmentation/segmentation/evaluation/__init__.py: -------------------------------------------------------------------------------- 1 | from .semantic import SemanticEvaluator 2 | from .instance import CityscapesInstanceEvaluator 3 | from .panoptic import CityscapesPanopticEvaluator 4 | from .coco_instance import COCOInstanceEvaluator 5 | from .coco_panoptic import COCOPanopticEvaluator 6 | -------------------------------------------------------------------------------- /CDARTS_segmentation/segmentation/model/__init__.py: -------------------------------------------------------------------------------- 1 | from .build import build_segmentation_model_from_cfg 2 | -------------------------------------------------------------------------------- /CDARTS_segmentation/segmentation/model/backbone/__init__.py: -------------------------------------------------------------------------------- 1 | from .resnet import * 2 | from .mobilenet import * 3 | from .mnasnet import * 4 | from .hrnet import * 5 | from .xception import * 6 | -------------------------------------------------------------------------------- /CDARTS_segmentation/segmentation/model/decoder/__init__.py: -------------------------------------------------------------------------------- 1 | from .aspp import ASPP 2 | from .deeplabv3 import DeepLabV3Decoder 3 | from .deeplabv3plus import DeepLabV3PlusDecoder 4 | from .panoptic_deeplab import PanopticDeepLabDecoder 5 | -------------------------------------------------------------------------------- /CDARTS_segmentation/segmentation/model/loss/__init__.py: -------------------------------------------------------------------------------- 1 | from torch import nn 2 | 3 | from .criterion import RegularCE, OhemCE, DeepLabCE 4 | 5 | L1Loss = nn.L1Loss 6 | MSELoss = nn.MSELoss 7 | CrossEntropyLoss = nn.CrossEntropyLoss 8 | -------------------------------------------------------------------------------- /CDARTS_segmentation/segmentation/model/meta_arch/__init__.py: -------------------------------------------------------------------------------- 1 | from .deeplabv3 import DeepLabV3 2 | from .deeplabv3plus import DeepLabV3Plus 3 | from .panoptic_deeplab import PanopticDeepLab 4 | -------------------------------------------------------------------------------- /CDARTS_segmentation/segmentation/model/post_processing/__init__.py: -------------------------------------------------------------------------------- 1 | from .semantic_post_processing import get_semantic_segmentation 2 | from .instance_post_processing import get_panoptic_segmentation 3 | from .evaluation_format import get_cityscapes_instance_format 4 | -------------------------------------------------------------------------------- /CDARTS_segmentation/segmentation/model/post_processing/semantic_post_processing.py: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Post-processing to get semantic segmentation results. 3 | # Written by Bowen Cheng (bcheng9@illinois.edu) 4 | # ------------------------------------------------------------------------------ 5 | 6 | import torch 7 | 8 | __all__ = ['get_semantic_segmentation'] 9 | 10 | 11 | def get_semantic_segmentation(sem): 12 | """ 13 | Post-processing for semantic segmentation branch. 14 | Arguments: 15 | sem: A Tensor of shape [N, C, H, W], where N is the batch size, for consistent, we only 16 | support N=1. 17 | Returns: 18 | A Tensor of shape [1, H, W] (to be gathered by distributed data parallel). 19 | Raises: 20 | ValueError, if batch size is not 1. 21 | """ 22 | if sem.size(0) != 1: 23 | raise ValueError('Only supports inference for batch size = 1') 24 | sem = sem.squeeze(0) 25 | return torch.argmax(sem, dim=0, keepdim=True) 26 | -------------------------------------------------------------------------------- /CDARTS_segmentation/segmentation/solver/__init__.py: -------------------------------------------------------------------------------- 1 | from .build import build_optimizer, build_lr_scheduler 2 | from .lr_scheduler import WarmupMultiStepLR, WarmupCosineLR, WarmupPolyLR 3 | from .utils import get_lr_group_id 4 | -------------------------------------------------------------------------------- /CDARTS_segmentation/segmentation/utils/__init__.py: -------------------------------------------------------------------------------- 1 | from .save_annotation import ( 2 | save_annotation, save_instance_annotation, save_panoptic_annotation, save_center_image, save_heatmap_image, 3 | save_heatmap_and_center_image, save_offset_image) 4 | from .flow_vis import flow_compute_color 5 | from .utils import AverageMeter 6 | from .debug import save_debug_images 7 | -------------------------------------------------------------------------------- /CDARTS_segmentation/segmentation/utils/env.py: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Reference: https://github.com/facebookresearch/detectron2/blob/master/detectron2/utils/env.py#L15 3 | # Modified by Bowen Cheng (bcheng9@illinois.edu) 4 | # ------------------------------------------------------------------------------ 5 | 6 | import importlib 7 | import importlib.util 8 | import logging 9 | import numpy as np 10 | import os 11 | import random 12 | import sys 13 | from datetime import datetime 14 | import torch 15 | 16 | __all__ = ["seed_all_rng"] 17 | 18 | 19 | def seed_all_rng(seed=None): 20 | """ 21 | Set the random seed for the RNG in torch, numpy and python. 22 | Args: 23 | seed (int): if None, will use a strong random seed. 24 | """ 25 | if seed is None: 26 | seed = ( 27 | os.getpid() 28 | + int(datetime.now().strftime("%S%f")) 29 | + int.from_bytes(os.urandom(2), "big") 30 | ) 31 | logger = logging.getLogger(__name__) 32 | logger.info("Using a generated random seed {}".format(seed)) 33 | np.random.seed(seed) 34 | torch.set_rng_state(torch.manual_seed(seed).get_state()) 35 | random.seed(seed) 36 | -------------------------------------------------------------------------------- /CDARTS_segmentation/tools/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_segmentation/tools/__init__.py -------------------------------------------------------------------------------- /CDARTS_segmentation/tools/datasets/__init__.py: -------------------------------------------------------------------------------- 1 | from .cityscapes import Cityscapes 2 | from .bdd import BDD 3 | from .coco import COCO 4 | from .camvid import CamVid 5 | 6 | __all__ = ['Cityscapes', 'BDD', 'CamVid', 'COCO'] 7 | -------------------------------------------------------------------------------- /CDARTS_segmentation/tools/datasets/bdd/__init__.py: -------------------------------------------------------------------------------- 1 | from .bdd import BDD 2 | 3 | __all__ = ['BDD'] 4 | -------------------------------------------------------------------------------- /CDARTS_segmentation/tools/datasets/camvid/__init__.py: -------------------------------------------------------------------------------- 1 | from .camvid import CamVid 2 | 3 | __all__ = ['CamVid'] -------------------------------------------------------------------------------- /CDARTS_segmentation/tools/datasets/camvid/camvid.py: -------------------------------------------------------------------------------- 1 | from datasets.BaseDataset import BaseDataset 2 | 3 | 4 | class CamVid(BaseDataset): 5 | @classmethod 6 | def get_class_colors(*args): 7 | return [[128, 0, 0], [128, 128, 0], [128, 128, 128], [64, 0, 128], 8 | [192, 128, 128], [128, 64, 128], [64, 64, 0], [64, 64, 128], 9 | [192, 192, 128], [0, 0, 192], [0, 128, 192]] 10 | 11 | @classmethod 12 | def get_class_names(*args): 13 | # class counting(gtFine) 14 | # 2953 2811 2934 970 1296 2949 1658 2808 2891 1654 2686 2343 1023 2832 15 | # 359 274 142 513 1646 16 | return ['Building', 'Tree', 'Sky', 'Car', 'Sign-Symbol', 'Road', 17 | 'Pedestrian', 'Fence', 'Column-Pole', 'Side-Walk', 'Bicyclist', 'Void'] 18 | -------------------------------------------------------------------------------- /CDARTS_segmentation/tools/datasets/cityscapes/__init__.py: -------------------------------------------------------------------------------- 1 | from .cityscapes import Cityscapes 2 | 3 | __all__ = ['Cityscapes'] -------------------------------------------------------------------------------- /CDARTS_segmentation/tools/datasets/coco/__init__.py: -------------------------------------------------------------------------------- 1 | from .coco import COCO 2 | 3 | __all__ = ['COCO'] 4 | -------------------------------------------------------------------------------- /CDARTS_segmentation/tools/engine/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_segmentation/tools/engine/__init__.py -------------------------------------------------------------------------------- /CDARTS_segmentation/tools/seg_opr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_segmentation/tools/seg_opr/__init__.py -------------------------------------------------------------------------------- /CDARTS_segmentation/tools/utils/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_segmentation/tools/utils/__init__.py -------------------------------------------------------------------------------- /CDARTS_segmentation/train/_init_paths.py: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Adds `segmentation` package into Python path. 3 | # Written by Bowen Cheng (bcheng9@illinois.edu) 4 | # ------------------------------------------------------------------------------ 5 | 6 | import os.path as osp 7 | import sys 8 | 9 | 10 | def add_path(path): 11 | if path not in sys.path: 12 | sys.path.insert(0, path) 13 | 14 | 15 | this_dir = osp.dirname(__file__) 16 | lib_path = osp.join(this_dir, '..') 17 | add_path(lib_path) 18 | add_path(this_dir) 19 | add_path(osp.join(lib_path, 'tools')) 20 | -------------------------------------------------------------------------------- /CDARTS_segmentation/train/configs/ADE20K/512.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: ../Cityscapes-PanopticSegmentation/Base-PanopticDeepLab-OS16.yaml 2 | MODEL: 3 | WEIGHTS: "detectron2://DeepLab/R-52.pkl" 4 | PIXEL_MEAN: [123.675, 116.280, 103.530] 5 | PIXEL_STD: [58.395, 57.120, 57.375] 6 | BACKBONE: 7 | NAME: "build_resnet_deeplab_backbone" 8 | RESNETS: 9 | DEPTH: 50 10 | NORM: "SyncBN" 11 | RES5_MULTI_GRID: [1, 2, 4] 12 | STEM_TYPE: "deeplab" 13 | STEM_OUT_CHANNELS: 128 14 | STRIDE_IN_1X1: False 15 | SEM_SEG_HEAD: 16 | NUM_CLASSES: 133 17 | LOSS_TOP_K: 1.0 18 | USE_DEPTHWISE_SEPARABLE_CONV: True 19 | PANOPTIC_DEEPLAB: 20 | STUFF_AREA: 4096 21 | NMS_KERNEL: 41 22 | SIZE_DIVISIBILITY: 640 23 | USE_DEPTHWISE_SEPARABLE_CONV: True 24 | DATASETS: 25 | TRAIN: ("ade20k_sem_seg_train",) 26 | TEST: ("ade20k_sem_seg_val",) 27 | SOLVER: 28 | BASE_LR: 0.0005 29 | MAX_ITER: 200000000 30 | IMS_PER_BATCH: 32 31 | INPUT: 32 | FORMAT: "RGB" 33 | GAUSSIAN_SIGMA: 8 34 | MIN_SIZE_TRAIN: (256, 320, 352, 416, 448, 512, 576, 608, 672, 704, 768, 832, 864, 928, 960, 1024) 35 | MIN_SIZE_TRAIN_SAMPLING: "choice" 36 | MIN_SIZE_TEST: 512 37 | MAX_SIZE_TRAIN: 1024 38 | MAX_SIZE_TEST: 512 39 | CROP: 40 | ENABLED: True 41 | TYPE: "absolute" 42 | SIZE: (512, 512) 43 | -------------------------------------------------------------------------------- /CDARTS_segmentation/train/configs/ADE20K/base.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: ../Cityscapes-PanopticSegmentation/Base-PanopticDeepLab-OS16.yaml 2 | MODEL: 3 | WEIGHTS: "detectron2://DeepLab/R-52.pkl" 4 | PIXEL_MEAN: [123.675, 116.280, 103.530] 5 | PIXEL_STD: [58.395, 57.120, 57.375] 6 | BACKBONE: 7 | NAME: "build_resnet_deeplab_backbone" 8 | RESNETS: 9 | DEPTH: 50 10 | NORM: "SyncBN" 11 | RES5_MULTI_GRID: [1, 2, 4] 12 | STEM_TYPE: "deeplab" 13 | STEM_OUT_CHANNELS: 128 14 | STRIDE_IN_1X1: False 15 | SEM_SEG_HEAD: 16 | NUM_CLASSES: 133 17 | LOSS_TOP_K: 1.0 18 | USE_DEPTHWISE_SEPARABLE_CONV: True 19 | PANOPTIC_DEEPLAB: 20 | STUFF_AREA: 4096 21 | NMS_KERNEL: 41 22 | SIZE_DIVISIBILITY: 640 23 | USE_DEPTHWISE_SEPARABLE_CONV: True 24 | DATASETS: 25 | TRAIN: ("ade20k_sem_seg_train",) 26 | TEST: ("ade20k_sem_seg_val",) 27 | SOLVER: 28 | BASE_LR: 0.0005 29 | MAX_ITER: 200000000 30 | IMS_PER_BATCH: 32 31 | INPUT: 32 | FORMAT: "RGB" 33 | GAUSSIAN_SIGMA: 8 34 | MIN_SIZE_TRAIN: !!python/object/apply:eval ["[int(x * 0.1 * 640) for x in range(5, 16)]"] 35 | MIN_SIZE_TRAIN_SAMPLING: "choice" 36 | MIN_SIZE_TEST: 640 37 | MAX_SIZE_TRAIN: 960 38 | MAX_SIZE_TEST: 640 39 | CROP: 40 | ENABLED: True 41 | TYPE: "absolute" 42 | SIZE: (640, 640) 43 | -------------------------------------------------------------------------------- /CDARTS_segmentation/train/configs/Cityscapes-PanopticSegmentation/panoptic_deeplab_R_52_os16_mg124_poly_90k_bs32_crop_512_1024.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: Base-PanopticDeepLab-OS16.yaml 2 | MODEL: 3 | WEIGHTS: "detectron2://DeepLab/R-52.pkl" 4 | PIXEL_MEAN: [123.675, 116.280, 103.530] 5 | PIXEL_STD: [58.395, 57.120, 57.375] 6 | BACKBONE: 7 | NAME: "build_resnet_deeplab_backbone" 8 | RESNETS: 9 | DEPTH: 50 10 | NORM: "SyncBN" 11 | RES5_MULTI_GRID: [1, 2, 4] 12 | STEM_TYPE: "deeplab" 13 | STEM_OUT_CHANNELS: 128 14 | STRIDE_IN_1X1: False 15 | SOLVER: 16 | MAX_ITER: 90000 17 | INPUT: 18 | FORMAT: "RGB" 19 | CROP: 20 | SIZE: (512, 1024) 21 | -------------------------------------------------------------------------------- /CDARTS_segmentation/train/configs/Cityscapes-PanopticSegmentation/panoptic_deeplab_R_52_os16_mg124_poly_90k_bs32_crop_512_1024_dsconv.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: Base-PanopticDeepLab-OS16.yaml 2 | MODEL: 3 | WEIGHTS: "detectron2://DeepLab/R-52.pkl" 4 | PIXEL_MEAN: [123.675, 116.280, 103.530] 5 | PIXEL_STD: [58.395, 57.120, 57.375] 6 | BACKBONE: 7 | NAME: "build_resnet_deeplab_backbone" 8 | RESNETS: 9 | DEPTH: 50 10 | NORM: "SyncBN" 11 | RES5_MULTI_GRID: [1, 2, 4] 12 | STEM_TYPE: "deeplab" 13 | STEM_OUT_CHANNELS: 128 14 | STRIDE_IN_1X1: False 15 | PANOPTIC_DEEPLAB: 16 | USE_DEPTHWISE_SEPARABLE_CONV: True 17 | SEM_SEG_HEAD: 18 | USE_DEPTHWISE_SEPARABLE_CONV: True 19 | SOLVER: 20 | MAX_ITER: 90000 21 | INPUT: 22 | FORMAT: "RGB" 23 | CROP: 24 | SIZE: (512, 1024) 25 | -------------------------------------------------------------------------------- /CDARTS_segmentation/train/genotypes.py: -------------------------------------------------------------------------------- 1 | from collections import namedtuple 2 | 3 | Genotype = namedtuple('Genotype', 'normal normal_concat reduce reduce_concat') 4 | 5 | PRIMITIVES = [ 6 | 'skip', 7 | 'conv', 8 | 'conv_downup', 9 | 'conv_2x_downup', 10 | 'sa', 11 | ] 12 | 13 | # 'conv_2x', -------------------------------------------------------------------------------- /CDARTS_segmentation/train/latency_lookup_table.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/CDARTS_segmentation/train/latency_lookup_table.npy -------------------------------------------------------------------------------- /CDARTS_segmentation/train/run_det2.sh: -------------------------------------------------------------------------------- 1 | export DETECTRON2_DATASETS="/home/hongyuan/data/" 2 | NGPUS=8 3 | python -m torch.distributed.launch --nproc_per_node=$NGPUS train_autos4_det2.py --world_size $NGPUS --seed 12367 -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE 22 | 23 | 24 | -------------------------------------------------------------------------------- /benchmark201/README.md: -------------------------------------------------------------------------------- 1 | ## NAS-Bench-201 2 | * Main python file is 3 | ```buildoutcfg 4 | ${ROOT}/benchmark201/search.py 5 | ``` 6 | * Here we present our search script on NAS-Bench-201. 7 | ```buildoutcfg 8 | cd benchmark201 9 | bash run_search_cifar_1gpu.sh 10 | ``` 11 | -------------------------------------------------------------------------------- /benchmark201/run_search_cifar_1gpu.sh: -------------------------------------------------------------------------------- 1 | NGPUS=1 2 | SGPU=0 3 | EGPU=$[NGPUS+SGPU-1] 4 | GPU_ID=`seq -s , $SGPU $EGPU` 5 | CUDA_VISIBLE_DEVICES=$GPU_ID python -m torch.distributed.launch --nproc_per_node=$NGPUS search.py \ 6 | --name cifar10-search --dataset cifar10 --model_type cifar \ 7 | --n_classes 10 --init_channels 16 --layer_num 3 --stem_multiplier 1 \ 8 | --batch_size 64 --sample_ratio 1.0 \ 9 | --workers 1 --print_freq 10 \ 10 | --distributed --world_size $NGPUS --dist_url 'tcp://127.0.0.1:23343' \ 11 | --use_apex --sync_param \ 12 | --regular --regular_ratio 0.667 --regular_coeff 5 \ 13 | --clean_arch --loss_alpha 1 \ 14 | --ensemble_param \ 15 | --w_lr 0.08 --alpha_lr 3e-4 --nasnet_lr 0.08 \ 16 | --w_weight_decay 3e-4 --alpha_weight_decay 0. \ 17 | --one_stage --repeat_cell \ 18 | --interactive_type 3 \ 19 | --pretrain_epochs 0 --pretrain_decay 0 \ 20 | --search_iter 50 --search_iter_epochs 1 --nasnet_warmup 1 21 | -------------------------------------------------------------------------------- /benchmark201/search/cifar10-search/tb/readme.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/benchmark201/search/cifar10-search/tb/readme.md -------------------------------------------------------------------------------- /benchmark201/search/imagenet-search/imagenet-search.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/benchmark201/search/imagenet-search/imagenet-search.log -------------------------------------------------------------------------------- /benchmark201/search/imagenet-search/tb/readme.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/benchmark201/search/imagenet-search/tb/readme.md -------------------------------------------------------------------------------- /demo/NATS_bench.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/demo/NATS_bench.png -------------------------------------------------------------------------------- /demo/ade.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/demo/ade.png -------------------------------------------------------------------------------- /demo/cell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/demo/cell.png -------------------------------------------------------------------------------- /demo/cell_cifar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/demo/cell_cifar.png -------------------------------------------------------------------------------- /demo/cell_imagenet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/demo/cell_imagenet.png -------------------------------------------------------------------------------- /demo/chain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/demo/chain.png -------------------------------------------------------------------------------- /demo/chain_arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/demo/chain_arch.png -------------------------------------------------------------------------------- /demo/city.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/demo/city.png -------------------------------------------------------------------------------- /demo/coco.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/demo/coco.png -------------------------------------------------------------------------------- /demo/framework1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/demo/framework1.png -------------------------------------------------------------------------------- /demo/framework2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/demo/framework2.png -------------------------------------------------------------------------------- /experiments/retrain/cifar10-retrain/cifar10-retrain.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/experiments/retrain/cifar10-retrain/cifar10-retrain.log -------------------------------------------------------------------------------- /experiments/retrain/cifar10-retrain/tb/readme.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/experiments/retrain/cifar10-retrain/tb/readme.md -------------------------------------------------------------------------------- /experiments/retrain/imagenet-retrain/imagenet-retrain.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/experiments/retrain/imagenet-retrain/imagenet-retrain.log -------------------------------------------------------------------------------- /experiments/retrain/imagenet-retrain/tb/readme.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/experiments/retrain/imagenet-retrain/tb/readme.md -------------------------------------------------------------------------------- /experiments/search/cifar10-search/cifar10-search.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/experiments/search/cifar10-search/cifar10-search.log -------------------------------------------------------------------------------- /experiments/search/cifar10-search/tb/readme.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/experiments/search/cifar10-search/tb/readme.md -------------------------------------------------------------------------------- /experiments/search/imagenet-search/imagenet-search.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/experiments/search/imagenet-search/imagenet-search.log -------------------------------------------------------------------------------- /experiments/search/imagenet-search/tb/readme.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchmm/CyDAS/7dddc8d5db4ed343979ed3687c6adfc39dfce284/experiments/search/imagenet-search/tb/readme.md -------------------------------------------------------------------------------- /lib/utils/count_flops.py: -------------------------------------------------------------------------------- 1 | """ Search cell """ 2 | import json 3 | import lib.utils.genotypes as gt 4 | 5 | from torchscope import scope 6 | from lib.models.model_test import ModelTest 7 | 8 | # config 9 | stem_multiplier = 1 10 | n_classes = 1000 11 | init_channels = 48 12 | model_type = 'imagenet' 13 | cell_file = './genotypes.json' 14 | 15 | 16 | #stem_multiplier = 3 17 | #n_classes = 10 18 | #init_channels = 36 19 | #model_type = 'cifar' 20 | #cell_file = './genotypes.json' 21 | 22 | def main(): 23 | file = open(cell_file, 'r') 24 | js = file.read() 25 | r_dict = json.loads(js) 26 | 27 | file.close() 28 | genotypes_dict = {} 29 | for layer_idx, genotype in r_dict.items(): 30 | genotypes_dict[int(layer_idx)] = gt.from_str(genotype) 31 | 32 | model_main = ModelTest(genotypes_dict, model_type, res_stem=False, init_channel=init_channels, \ 33 | stem_multiplier=stem_multiplier, n_nodes=4, num_classes=n_classes) 34 | 35 | if 'cifar' in model_type: 36 | input_x = (3, 32, 32) 37 | elif 'imagenet' in model_type: 38 | input_x = (3, 224, 224) 39 | else: 40 | raise Exception("Not support dataset!") 41 | 42 | scope(model_main, input_size=input_x) 43 | 44 | 45 | if __name__ == "__main__": 46 | main() 47 | -------------------------------------------------------------------------------- /requirements: -------------------------------------------------------------------------------- 1 | graphviz 2 | torch==1.2 3 | torchvision==0.2 4 | tensorboard 5 | tensorboardX --------------------------------------------------------------------------------