├── MS-COCO-2014-dataset-accuracy.png ├── README.md ├── VOC-2007-dataset-accuracy.png ├── shihao_wang_master_thesis.pdf ├── target-after-sigmoid-distill-loss ├── freeze │ ├── Makefile │ ├── detectron │ │ ├── .directory │ │ ├── __init__.py │ │ ├── __init__.pyc │ │ ├── core │ │ │ ├── __init__.py │ │ │ ├── __init__.pyc │ │ │ ├── config.py │ │ │ ├── config.pyc │ │ │ ├── rpn_generator.py │ │ │ ├── rpn_generator.pyc │ │ │ ├── test.py │ │ │ ├── test.pyc │ │ │ ├── test_engine.py │ │ │ ├── test_engine.pyc │ │ │ ├── test_retinanet.py │ │ │ └── test_retinanet.pyc │ │ ├── datasets │ │ │ ├── VOCdevkit-matlab-wrapper │ │ │ │ ├── get_voc_opts.m │ │ │ │ ├── voc_eval.m │ │ │ │ └── xVOCap.m │ │ │ ├── __init__.py │ │ │ ├── __init__.pyc │ │ │ ├── cityscapes_json_dataset_evaluator.py │ │ │ ├── cityscapes_json_dataset_evaluator.pyc │ │ │ ├── coco_to_cityscapes_id.py │ │ │ ├── data │ │ │ │ └── README.md │ │ │ ├── dataset_catalog.py │ │ │ ├── dataset_catalog.pyc │ │ │ ├── dummy_datasets.py │ │ │ ├── dummy_datasets.pyc │ │ │ ├── json_dataset.py │ │ │ ├── json_dataset.pyc │ │ │ ├── json_dataset_evaluator.py │ │ │ ├── json_dataset_evaluator.pyc │ │ │ ├── roidb.py │ │ │ ├── roidb.pyc │ │ │ ├── task_evaluation.py │ │ │ ├── task_evaluation.pyc │ │ │ ├── voc_dataset_evaluator.py │ │ │ ├── voc_dataset_evaluator.pyc │ │ │ ├── voc_eval.py │ │ │ └── voc_eval.pyc │ │ ├── modeling │ │ │ ├── FPN.py │ │ │ ├── FPN.pyc │ │ │ ├── ResNet.py │ │ │ ├── ResNet.pyc │ │ │ ├── VGG16.py │ │ │ ├── VGG16.pyc │ │ │ ├── VGG_CNN_M_1024.py │ │ │ ├── VGG_CNN_M_1024.pyc │ │ │ ├── __init__.py │ │ │ ├── __init__.pyc │ │ │ ├── detector.py │ │ │ ├── detector.pyc │ │ │ ├── fast_rcnn_heads.py │ │ │ ├── fast_rcnn_heads.pyc │ │ │ ├── generate_anchors.py │ │ │ ├── generate_anchors.pyc │ │ │ ├── keypoint_rcnn_heads.py │ │ │ ├── keypoint_rcnn_heads.pyc │ │ │ ├── mask_rcnn_heads.py │ │ │ ├── mask_rcnn_heads.pyc │ │ │ ├── model_builder.py │ │ │ ├── model_builder.pyc │ │ │ ├── name_compat.py │ │ │ ├── name_compat.pyc │ │ │ ├── optimizer.py │ │ │ ├── optimizer.pyc │ │ │ ├── retinanet_heads.py │ │ │ ├── retinanet_heads.pyc │ │ │ ├── rfcn_heads.py │ │ │ ├── rfcn_heads.pyc │ │ │ ├── rpn_heads.py │ │ │ └── rpn_heads.pyc │ │ ├── ops │ │ │ ├── __init__.py │ │ │ ├── __init__.pyc │ │ │ ├── collect_and_distribute_fpn_rpn_proposals.py │ │ │ ├── collect_and_distribute_fpn_rpn_proposals.pyc │ │ │ ├── generate_proposal_labels.py │ │ │ ├── generate_proposal_labels.pyc │ │ │ ├── generate_proposals.py │ │ │ ├── generate_proposals.pyc │ │ │ ├── zero_even_op.cc │ │ │ ├── zero_even_op.cu │ │ │ └── zero_even_op.h │ │ ├── roi_data │ │ │ ├── __init__.py │ │ │ ├── __init__.pyc │ │ │ ├── data_utils.py │ │ │ ├── data_utils.pyc │ │ │ ├── fast_rcnn.py │ │ │ ├── fast_rcnn.pyc │ │ │ ├── keypoint_rcnn.py │ │ │ ├── keypoint_rcnn.pyc │ │ │ ├── loader.py │ │ │ ├── loader.pyc │ │ │ ├── mask_rcnn.py │ │ │ ├── mask_rcnn.pyc │ │ │ ├── minibatch.py │ │ │ ├── minibatch.pyc │ │ │ ├── retinanet.py │ │ │ ├── retinanet.pyc │ │ │ ├── rpn.py │ │ │ └── rpn.pyc │ │ ├── tests │ │ │ ├── data_loader_benchmark.py │ │ │ ├── test_batch_permutation_op.py │ │ │ ├── test_bbox_transform.py │ │ │ ├── test_cfg.py │ │ │ ├── test_loader.py │ │ │ ├── test_restore_checkpoint.py │ │ │ ├── test_smooth_l1_loss_op.py │ │ │ ├── test_spatial_narrow_as_op.py │ │ │ └── test_zero_even_op.py │ │ └── utils │ │ │ ├── __init__.py │ │ │ ├── __init__.pyc │ │ │ ├── blob.py │ │ │ ├── blob.pyc │ │ │ ├── boxes.py │ │ │ ├── boxes.pyc │ │ │ ├── c2.py │ │ │ ├── c2.pyc │ │ │ ├── collections.py │ │ │ ├── collections.pyc │ │ │ ├── colormap.py │ │ │ ├── colormap.pyc │ │ │ ├── coordinator.py │ │ │ ├── coordinator.pyc │ │ │ ├── cython_bbox.c │ │ │ ├── cython_bbox.pyx │ │ │ ├── cython_bbox.so │ │ │ ├── cython_nms.c │ │ │ ├── cython_nms.pyx │ │ │ ├── cython_nms.so │ │ │ ├── env.py │ │ │ ├── env.pyc │ │ │ ├── image.py │ │ │ ├── image.pyc │ │ │ ├── io.py │ │ │ ├── io.pyc │ │ │ ├── keypoints.py │ │ │ ├── keypoints.pyc │ │ │ ├── logging.py │ │ │ ├── logging.pyc │ │ │ ├── lr_policy.py │ │ │ ├── lr_policy.pyc │ │ │ ├── model_convert_utils.py │ │ │ ├── net.py │ │ │ ├── net.pyc │ │ │ ├── segms.py │ │ │ ├── segms.pyc │ │ │ ├── subprocess.py │ │ │ ├── subprocess.pyc │ │ │ ├── timer.py │ │ │ ├── timer.pyc │ │ │ ├── train.py │ │ │ ├── train.pyc │ │ │ ├── training_stats.py │ │ │ ├── training_stats.pyc │ │ │ ├── vis.py │ │ │ └── vis.pyc │ ├── e2e_faster_rcnn_R-50-FPN_2x.yaml │ ├── setup.py │ └── tools │ │ ├── convert_cityscapes_to_coco.py │ │ ├── convert_coco_model_to_cityscapes.py │ │ ├── convert_pkl_to_pb.py │ │ ├── convert_selective_search.py │ │ ├── generate_testdev_from_test.py │ │ ├── infer.py │ │ ├── infer_simple.py │ │ ├── pickle_caffe_blobs.py │ │ ├── reval.py │ │ ├── test_net.py │ │ ├── train_net.py │ │ └── visualize_results.py └── train │ ├── Makefile │ ├── detectron │ ├── .directory │ ├── __init__.py │ ├── __init__.pyc │ ├── core │ │ ├── __init__.py │ │ ├── __init__.pyc │ │ ├── config.py │ │ ├── config.pyc │ │ ├── rpn_generator.py │ │ ├── rpn_generator.pyc │ │ ├── test.py │ │ ├── test.pyc │ │ ├── test_engine.py │ │ └── test_engine.pyc │ ├── datasets │ │ ├── VOCdevkit-matlab-wrapper │ │ │ ├── get_voc_opts.m │ │ │ ├── voc_eval.m │ │ │ └── xVOCap.m │ │ ├── __init__.py │ │ ├── __init__.pyc │ │ ├── cityscapes_json_dataset_evaluator.py │ │ ├── cityscapes_json_dataset_evaluator.pyc │ │ ├── coco_to_cityscapes_id.py │ │ ├── data │ │ │ └── README.md │ │ ├── dataset_catalog.py │ │ ├── dataset_catalog.pyc │ │ ├── dummy_datasets.py │ │ ├── dummy_datasets.pyc │ │ ├── json_dataset.py │ │ ├── json_dataset.pyc │ │ ├── json_dataset_evaluator.py │ │ ├── json_dataset_evaluator.pyc │ │ ├── roidb.py │ │ ├── roidb.pyc │ │ ├── task_evaluation.py │ │ ├── task_evaluation.pyc │ │ ├── voc_dataset_evaluator.py │ │ ├── voc_dataset_evaluator.pyc │ │ ├── voc_eval.py │ │ └── voc_eval.pyc │ ├── modeling │ │ ├── FPN.py │ │ ├── FPN.pyc │ │ ├── ResNet.py │ │ ├── ResNet.pyc │ │ ├── __init__.py │ │ ├── __init__.pyc │ │ ├── detector.py │ │ ├── detector.pyc │ │ ├── fast_rcnn_heads.py │ │ ├── fast_rcnn_heads.pyc │ │ ├── generate_anchors.py │ │ ├── generate_anchors.pyc │ │ ├── model_builder.py │ │ ├── model_builder.pyc │ │ ├── name_compat.py │ │ ├── name_compat.pyc │ │ ├── optimizer.py │ │ ├── optimizer.pyc │ │ ├── rpn_heads.py │ │ └── rpn_heads.pyc │ ├── ops │ │ ├── __init__.py │ │ ├── __init__.pyc │ │ ├── collect_and_distribute_fpn_rpn_proposals.py │ │ ├── collect_and_distribute_fpn_rpn_proposals.pyc │ │ ├── distillLossOp.py │ │ ├── distillLossOp.py.bak │ │ ├── distillLossOp.pyc │ │ ├── generate_proposals.py │ │ ├── generate_proposals.pyc │ │ ├── get_weightsOpFastrcnn.py │ │ ├── get_weightsOpFastrcnn.pyc │ │ ├── get_weightsOpRPN.py │ │ ├── get_weightsOpRPN.pyc │ │ ├── zero_even_op.cc │ │ ├── zero_even_op.cu │ │ └── zero_even_op.h │ ├── roi_data │ │ ├── __init__.py │ │ ├── __init__.pyc │ │ ├── data_utils.py │ │ ├── data_utils.pyc │ │ ├── fast_rcnn.py │ │ ├── fast_rcnn.pyc │ │ ├── loader.py │ │ ├── loader.pyc │ │ ├── minibatch.py │ │ ├── minibatch.pyc │ │ ├── rpn.py │ │ └── rpn.pyc │ ├── tests │ │ ├── data_loader_benchmark.py │ │ ├── test_batch_permutation_op.py │ │ ├── test_bbox_transform.py │ │ ├── test_cfg.py │ │ ├── test_loader.py │ │ ├── test_restore_checkpoint.py │ │ ├── test_smooth_l1_loss_op.py │ │ ├── test_spatial_narrow_as_op.py │ │ └── test_zero_even_op.py │ └── utils │ │ ├── __init__.py │ │ ├── __init__.pyc │ │ ├── blob.py │ │ ├── blob.pyc │ │ ├── boxes.py │ │ ├── boxes.pyc │ │ ├── c2.py │ │ ├── c2.pyc │ │ ├── collections.py │ │ ├── collections.pyc │ │ ├── colormap.py │ │ ├── colormap.pyc │ │ ├── coordinator.py │ │ ├── coordinator.pyc │ │ ├── cython_bbox.c │ │ ├── cython_bbox.pyx │ │ ├── cython_bbox.so │ │ ├── cython_nms.c │ │ ├── cython_nms.pyx │ │ ├── cython_nms.so │ │ ├── env.py │ │ ├── env.pyc │ │ ├── image.py │ │ ├── image.pyc │ │ ├── io.py │ │ ├── io.pyc │ │ ├── keypoints.py │ │ ├── keypoints.pyc │ │ ├── logging.py │ │ ├── logging.pyc │ │ ├── lr_policy.py │ │ ├── lr_policy.pyc │ │ ├── model_convert_utils.py │ │ ├── net.py │ │ ├── net.pyc │ │ ├── segms.py │ │ ├── segms.pyc │ │ ├── subprocess.py │ │ ├── subprocess.pyc │ │ ├── timer.py │ │ ├── timer.pyc │ │ ├── train.py │ │ ├── train.pyc │ │ ├── training_stats.py │ │ ├── training_stats.pyc │ │ ├── vis.py │ │ └── vis.pyc │ ├── e2e_faster_rcnn_R-50-FPN_2x.yaml │ ├── setup.py │ └── tools │ ├── convert_cityscapes_to_coco.py │ ├── convert_coco_model_to_cityscapes.py │ ├── convert_pkl_to_pb.py │ ├── convert_selective_search.py │ ├── generate_testdev_from_test.py │ ├── infer.py │ ├── infer_simple.py │ ├── pickle_caffe_blobs.py │ ├── reval.py │ ├── test_net.py │ ├── train_net.py │ └── visualize_results.py ├── test-newC ├── Makefile ├── detectron │ ├── .directory │ ├── __init__.py │ ├── __init__.pyc │ ├── core │ │ ├── __init__.py │ │ ├── __init__.pyc │ │ ├── config.py │ │ ├── config.pyc │ │ ├── rpn_generator.py │ │ ├── rpn_generator.pyc │ │ ├── test.py │ │ ├── test.pyc │ │ ├── test_engine.py │ │ ├── test_engine.pyc │ │ ├── test_retinanet.py │ │ └── test_retinanet.pyc │ ├── datasets │ │ ├── .directory │ │ ├── VOCdevkit-matlab-wrapper │ │ │ ├── get_voc_opts.m │ │ │ ├── voc_eval.m │ │ │ └── xVOCap.m │ │ ├── __init__.py │ │ ├── __init__.pyc │ │ ├── cityscapes_json_dataset_evaluator.py │ │ ├── cityscapes_json_dataset_evaluator.pyc │ │ ├── coco_to_cityscapes_id.py │ │ ├── data │ │ │ ├── .directory │ │ │ └── README.md │ │ ├── dataset_catalog.py │ │ ├── dataset_catalog.pyc │ │ ├── dummy_datasets.py │ │ ├── dummy_datasets.pyc │ │ ├── json_dataset.py │ │ ├── json_dataset.pyc │ │ ├── json_dataset_evaluator.py │ │ ├── json_dataset_evaluator.pyc │ │ ├── roidb.py │ │ ├── roidb.pyc │ │ ├── task_evaluation.py │ │ ├── task_evaluation.pyc │ │ ├── voc_dataset_evaluator.py │ │ ├── voc_dataset_evaluator.pyc │ │ ├── voc_eval.py │ │ └── voc_eval.pyc │ ├── modeling │ │ ├── FPN.py │ │ ├── FPN.pyc │ │ ├── ResNet.py │ │ ├── ResNet.pyc │ │ ├── VGG16.py │ │ ├── VGG16.pyc │ │ ├── VGG_CNN_M_1024.py │ │ ├── VGG_CNN_M_1024.pyc │ │ ├── __init__.py │ │ ├── __init__.pyc │ │ ├── detector.py │ │ ├── detector.pyc │ │ ├── fast_rcnn_heads.py │ │ ├── fast_rcnn_heads.pyc │ │ ├── generate_anchors.py │ │ ├── generate_anchors.pyc │ │ ├── keypoint_rcnn_heads.py │ │ ├── keypoint_rcnn_heads.pyc │ │ ├── mask_rcnn_heads.py │ │ ├── mask_rcnn_heads.pyc │ │ ├── model_builder.py │ │ ├── model_builder.pyc │ │ ├── name_compat.py │ │ ├── name_compat.pyc │ │ ├── optimizer.py │ │ ├── optimizer.pyc │ │ ├── retinanet_heads.py │ │ ├── retinanet_heads.pyc │ │ ├── rfcn_heads.py │ │ ├── rfcn_heads.pyc │ │ ├── rpn_heads.py │ │ └── rpn_heads.pyc │ ├── ops │ │ ├── __init__.py │ │ ├── __init__.pyc │ │ ├── collect_and_distribute_fpn_rpn_proposals.py │ │ ├── collect_and_distribute_fpn_rpn_proposals.pyc │ │ ├── generate_proposal_labels.py │ │ ├── generate_proposal_labels.pyc │ │ ├── generate_proposals.py │ │ ├── generate_proposals.pyc │ │ ├── mySplitOp.py │ │ ├── mySplitOp.pyc │ │ ├── zero_even_op.cc │ │ ├── zero_even_op.cu │ │ └── zero_even_op.h │ ├── roi_data │ │ ├── __init__.py │ │ ├── __init__.pyc │ │ ├── data_utils.py │ │ ├── data_utils.pyc │ │ ├── fast_rcnn.py │ │ ├── fast_rcnn.pyc │ │ ├── keypoint_rcnn.py │ │ ├── keypoint_rcnn.pyc │ │ ├── loader.py │ │ ├── loader.pyc │ │ ├── mask_rcnn.py │ │ ├── mask_rcnn.pyc │ │ ├── minibatch.py │ │ ├── minibatch.pyc │ │ ├── retinanet.py │ │ ├── retinanet.pyc │ │ ├── rpn.py │ │ └── rpn.pyc │ ├── tests │ │ ├── data_loader_benchmark.py │ │ ├── test_batch_permutation_op.py │ │ ├── test_bbox_transform.py │ │ ├── test_cfg.py │ │ ├── test_loader.py │ │ ├── test_restore_checkpoint.py │ │ ├── test_smooth_l1_loss_op.py │ │ ├── test_spatial_narrow_as_op.py │ │ └── test_zero_even_op.py │ └── utils │ │ ├── __init__.py │ │ ├── __init__.pyc │ │ ├── blob.py │ │ ├── blob.pyc │ │ ├── boxes.py │ │ ├── boxes.pyc │ │ ├── c2.py │ │ ├── c2.pyc │ │ ├── collections.py │ │ ├── collections.pyc │ │ ├── colormap.py │ │ ├── colormap.pyc │ │ ├── coordinator.py │ │ ├── coordinator.pyc │ │ ├── cython_bbox.c │ │ ├── cython_bbox.pyx │ │ ├── cython_bbox.so │ │ ├── cython_nms.c │ │ ├── cython_nms.pyx │ │ ├── cython_nms.so │ │ ├── env.py │ │ ├── env.pyc │ │ ├── image.py │ │ ├── image.pyc │ │ ├── io.py │ │ ├── io.pyc │ │ ├── keypoints.py │ │ ├── keypoints.pyc │ │ ├── logging.py │ │ ├── logging.pyc │ │ ├── lr_policy.py │ │ ├── lr_policy.pyc │ │ ├── model_convert_utils.py │ │ ├── net.py │ │ ├── net.pyc │ │ ├── segms.py │ │ ├── segms.pyc │ │ ├── subprocess.py │ │ ├── subprocess.pyc │ │ ├── timer.py │ │ ├── timer.pyc │ │ ├── train.py │ │ ├── train.pyc │ │ ├── training_stats.py │ │ ├── training_stats.pyc │ │ ├── vis.py │ │ └── vis.pyc ├── e2e_faster_rcnn_R-50-FPN_2x.yaml ├── setup.py └── tools │ ├── convert_cityscapes_to_coco.py │ ├── convert_coco_model_to_cityscapes.py │ ├── convert_pkl_to_pb.py │ ├── convert_selective_search.py │ ├── generate_testdev_from_test.py │ ├── infer.py │ ├── infer_simple.py │ ├── pickle_caffe_blobs.py │ ├── reval.py │ ├── test_net.py │ ├── train_net.py │ └── visualize_results.py └── test-oldC ├── Makefile ├── detectron ├── .directory ├── __init__.py ├── __init__.pyc ├── core │ ├── __init__.py │ ├── __init__.pyc │ ├── config.py │ ├── config.pyc │ ├── rpn_generator.py │ ├── rpn_generator.pyc │ ├── test.py │ ├── test.pyc │ ├── test_engine.py │ ├── test_engine.pyc │ ├── test_retinanet.py │ └── test_retinanet.pyc ├── datasets │ ├── .directory │ ├── VOCdevkit-matlab-wrapper │ │ ├── get_voc_opts.m │ │ ├── voc_eval.m │ │ └── xVOCap.m │ ├── __init__.py │ ├── __init__.pyc │ ├── cityscapes_json_dataset_evaluator.py │ ├── cityscapes_json_dataset_evaluator.pyc │ ├── coco_to_cityscapes_id.py │ ├── data │ │ ├── .directory │ │ └── README.md │ ├── dataset_catalog.py │ ├── dataset_catalog.pyc │ ├── dummy_datasets.py │ ├── dummy_datasets.pyc │ ├── json_dataset.py │ ├── json_dataset.pyc │ ├── json_dataset_evaluator.py │ ├── json_dataset_evaluator.pyc │ ├── roidb.py │ ├── roidb.pyc │ ├── task_evaluation.py │ ├── task_evaluation.pyc │ ├── voc_dataset_evaluator.py │ ├── voc_dataset_evaluator.pyc │ ├── voc_eval.py │ └── voc_eval.pyc ├── modeling │ ├── FPN.py │ ├── FPN.pyc │ ├── ResNet.py │ ├── ResNet.pyc │ ├── VGG16.py │ ├── VGG16.pyc │ ├── VGG_CNN_M_1024.py │ ├── VGG_CNN_M_1024.pyc │ ├── __init__.py │ ├── __init__.pyc │ ├── detector.py │ ├── detector.pyc │ ├── fast_rcnn_heads.py │ ├── fast_rcnn_heads.pyc │ ├── generate_anchors.py │ ├── generate_anchors.pyc │ ├── keypoint_rcnn_heads.py │ ├── keypoint_rcnn_heads.pyc │ ├── mask_rcnn_heads.py │ ├── mask_rcnn_heads.pyc │ ├── model_builder.py │ ├── model_builder.pyc │ ├── name_compat.py │ ├── name_compat.pyc │ ├── optimizer.py │ ├── optimizer.pyc │ ├── retinanet_heads.py │ ├── retinanet_heads.pyc │ ├── rfcn_heads.py │ ├── rfcn_heads.pyc │ ├── rpn_heads.py │ └── rpn_heads.pyc ├── ops │ ├── __init__.py │ ├── __init__.pyc │ ├── collect_and_distribute_fpn_rpn_proposals.py │ ├── collect_and_distribute_fpn_rpn_proposals.pyc │ ├── generate_proposal_labels.py │ ├── generate_proposal_labels.pyc │ ├── generate_proposals.py │ ├── generate_proposals.pyc │ ├── mySplitOp.py │ ├── mySplitOp.pyc │ ├── zero_even_op.cc │ ├── zero_even_op.cu │ └── zero_even_op.h ├── roi_data │ ├── __init__.py │ ├── __init__.pyc │ ├── data_utils.py │ ├── data_utils.pyc │ ├── fast_rcnn.py │ ├── fast_rcnn.pyc │ ├── keypoint_rcnn.py │ ├── keypoint_rcnn.pyc │ ├── loader.py │ ├── loader.pyc │ ├── mask_rcnn.py │ ├── mask_rcnn.pyc │ ├── minibatch.py │ ├── minibatch.pyc │ ├── retinanet.py │ ├── retinanet.pyc │ ├── rpn.py │ └── rpn.pyc ├── tests │ ├── data_loader_benchmark.py │ ├── test_batch_permutation_op.py │ ├── test_bbox_transform.py │ ├── test_cfg.py │ ├── test_loader.py │ ├── test_restore_checkpoint.py │ ├── test_smooth_l1_loss_op.py │ ├── test_spatial_narrow_as_op.py │ └── test_zero_even_op.py └── utils │ ├── __init__.py │ ├── __init__.pyc │ ├── blob.py │ ├── blob.pyc │ ├── boxes.py │ ├── boxes.pyc │ ├── c2.py │ ├── c2.pyc │ ├── collections.py │ ├── collections.pyc │ ├── colormap.py │ ├── colormap.pyc │ ├── coordinator.py │ ├── coordinator.pyc │ ├── cython_bbox.c │ ├── cython_bbox.pyx │ ├── cython_bbox.so │ ├── cython_nms.c │ ├── cython_nms.pyx │ ├── cython_nms.so │ ├── env.py │ ├── env.pyc │ ├── image.py │ ├── image.pyc │ ├── io.py │ ├── io.pyc │ ├── keypoints.py │ ├── keypoints.pyc │ ├── logging.py │ ├── logging.pyc │ ├── lr_policy.py │ ├── lr_policy.pyc │ ├── model_convert_utils.py │ ├── net.py │ ├── net.pyc │ ├── segms.py │ ├── segms.pyc │ ├── subprocess.py │ ├── subprocess.pyc │ ├── timer.py │ ├── timer.pyc │ ├── train.py │ ├── train.pyc │ ├── training_stats.py │ ├── training_stats.pyc │ ├── vis.py │ └── vis.pyc ├── e2e_faster_rcnn_R-50-FPN_2x.yaml ├── setup.py └── tools ├── convert_cityscapes_to_coco.py ├── convert_coco_model_to_cityscapes.py ├── convert_pkl_to_pb.py ├── convert_selective_search.py ├── generate_testdev_from_test.py ├── infer.py ├── infer_simple.py ├── pickle_caffe_blobs.py ├── reval.py ├── test_net.py ├── train_net.py └── visualize_results.py /MS-COCO-2014-dataset-accuracy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/MS-COCO-2014-dataset-accuracy.png -------------------------------------------------------------------------------- /VOC-2007-dataset-accuracy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/VOC-2007-dataset-accuracy.png -------------------------------------------------------------------------------- /shihao_wang_master_thesis.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/shihao_wang_master_thesis.pdf -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/Makefile: -------------------------------------------------------------------------------- 1 | # Don't use the --user flag for setup.py develop mode with virtualenv. 2 | DEV_USER_FLAG=$(shell python -c "import sys; print('' if hasattr(sys, 'real_prefix') else '--user')") 3 | 4 | .PHONY: default 5 | default: dev 6 | 7 | .PHONY: install 8 | install: 9 | python setup.py install 10 | 11 | .PHONY: ops 12 | ops: 13 | mkdir -p build && cd build && cmake .. && make -j$(shell nproc) 14 | 15 | .PHONY: dev 16 | dev: 17 | python setup.py develop $(DEV_USER_FLAG) 18 | 19 | .PHONY: clean 20 | clean: 21 | python setup.py develop --uninstall $(DEV_USER_FLAG) 22 | rm -rf build 23 | -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/.directory: -------------------------------------------------------------------------------- 1 | [Dolphin] 2 | PreviewsShown=true 3 | Timestamp=2019,11,6,15,3,8 4 | Version=3 5 | -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/__init__.py -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/__init__.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/core/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/core/__init__.py -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/core/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/core/__init__.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/core/config.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/core/config.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/core/rpn_generator.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/core/rpn_generator.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/core/test.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/core/test.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/core/test_engine.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/core/test_engine.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/core/test_retinanet.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/core/test_retinanet.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/datasets/VOCdevkit-matlab-wrapper/get_voc_opts.m: -------------------------------------------------------------------------------- 1 | function VOCopts = get_voc_opts(path) 2 | 3 | tmp = pwd; 4 | cd(path); 5 | try 6 | addpath('VOCcode'); 7 | VOCinit; 8 | catch 9 | rmpath('VOCcode'); 10 | cd(tmp); 11 | error(sprintf('VOCcode directory not found under %s', path)); 12 | end 13 | rmpath('VOCcode'); 14 | cd(tmp); 15 | -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/datasets/VOCdevkit-matlab-wrapper/voc_eval.m: -------------------------------------------------------------------------------- 1 | function res = voc_eval(path, comp_id, test_set, output_dir) 2 | 3 | VOCopts = get_voc_opts(path); 4 | VOCopts.testset = test_set; 5 | 6 | for i = 1:length(VOCopts.classes) 7 | cls = VOCopts.classes{i}; 8 | res(i) = voc_eval_cls(cls, VOCopts, comp_id, output_dir); 9 | end 10 | 11 | fprintf('\n~~~~~~~~~~~~~~~~~~~~\n'); 12 | fprintf('Results:\n'); 13 | aps = [res(:).ap]'; 14 | fprintf('%.1f\n', aps * 100); 15 | fprintf('%.1f\n', mean(aps) * 100); 16 | fprintf('~~~~~~~~~~~~~~~~~~~~\n'); 17 | 18 | function res = voc_eval_cls(cls, VOCopts, comp_id, output_dir) 19 | 20 | test_set = VOCopts.testset; 21 | year = VOCopts.dataset(4:end); 22 | 23 | addpath(fullfile(VOCopts.datadir, 'VOCcode')); 24 | 25 | res_fn = sprintf(VOCopts.detrespath, comp_id, cls); 26 | 27 | recall = []; 28 | prec = []; 29 | ap = 0; 30 | ap_auc = 0; 31 | 32 | do_eval = (str2num(year) <= 2007) | ~strcmp(test_set, 'test'); 33 | if do_eval 34 | % Bug in VOCevaldet requires that tic has been called first 35 | tic; 36 | [recall, prec, ap] = VOCevaldet(VOCopts, comp_id, cls, true); 37 | ap_auc = xVOCap(recall, prec); 38 | 39 | % force plot limits 40 | ylim([0 1]); 41 | xlim([0 1]); 42 | 43 | print(gcf, '-djpeg', '-r0', ... 44 | [output_dir '/' cls '_pr.jpg']); 45 | end 46 | fprintf('!!! %s : %.4f %.4f\n', cls, ap, ap_auc); 47 | 48 | res.recall = recall; 49 | res.prec = prec; 50 | res.ap = ap; 51 | res.ap_auc = ap_auc; 52 | 53 | save([output_dir '/' cls '_pr.mat'], ... 54 | 'res', 'recall', 'prec', 'ap', 'ap_auc'); 55 | 56 | rmpath(fullfile(VOCopts.datadir, 'VOCcode')); 57 | -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/datasets/VOCdevkit-matlab-wrapper/xVOCap.m: -------------------------------------------------------------------------------- 1 | function ap = xVOCap(rec,prec) 2 | % From the PASCAL VOC 2011 devkit 3 | 4 | mrec=[0 ; rec ; 1]; 5 | mpre=[0 ; prec ; 0]; 6 | for i=numel(mpre)-1:-1:1 7 | mpre(i)=max(mpre(i),mpre(i+1)); 8 | end 9 | i=find(mrec(2:end)~=mrec(1:end-1))+1; 10 | ap=sum((mrec(i)-mrec(i-1)).*mpre(i)); 11 | -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/datasets/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/datasets/__init__.py -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/datasets/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/datasets/__init__.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/datasets/cityscapes_json_dataset_evaluator.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/datasets/cityscapes_json_dataset_evaluator.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/datasets/dataset_catalog.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/datasets/dataset_catalog.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/datasets/dummy_datasets.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/datasets/dummy_datasets.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/datasets/json_dataset.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/datasets/json_dataset.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/datasets/json_dataset_evaluator.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/datasets/json_dataset_evaluator.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/datasets/roidb.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/datasets/roidb.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/datasets/task_evaluation.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/datasets/task_evaluation.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/datasets/voc_dataset_evaluator.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/datasets/voc_dataset_evaluator.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/datasets/voc_eval.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/datasets/voc_eval.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/modeling/FPN.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/modeling/FPN.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/modeling/ResNet.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/modeling/ResNet.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/modeling/VGG16.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/modeling/VGG16.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/modeling/VGG_CNN_M_1024.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/modeling/VGG_CNN_M_1024.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/modeling/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017-present, Facebook, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | ############################################################################## 15 | -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/modeling/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/modeling/__init__.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/modeling/detector.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/modeling/detector.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/modeling/fast_rcnn_heads.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from __future__ import division 3 | from __future__ import print_function 4 | from __future__ import unicode_literals 5 | from detectron.core.config import cfg 6 | from detectron.utils.c2 import const_fill 7 | from detectron.utils.c2 import gauss_fill 8 | import logging 9 | 10 | logger = logging.getLogger(__name__) 11 | 12 | def add_fast_rcnn_outputs(model, blob_in, dim): 13 | 14 | model.FC( 15 | blob_in, 16 | 'cls_score', 17 | dim, 18 | model.num_classes, 19 | weight_init=gauss_fill(0.01), 20 | bias_init=const_fill(0.0) 21 | ) 22 | model.StopGradient('cls_score','cls_score') 23 | 24 | 25 | num_bbox_reg_classes = ( 26 | 2 if cfg.MODEL.CLS_AGNOSTIC_BBOX_REG else model.num_classes 27 | ) 28 | model.FC( 29 | blob_in, 30 | 'bbox_pred', 31 | dim, 32 | num_bbox_reg_classes * 4, 33 | weight_init=gauss_fill(0.001), 34 | bias_init=const_fill(0.0) 35 | ) 36 | model.StopGradient('bbox_pred','bbox_pred') 37 | 38 | 39 | def add_roi_2mlp_head(model, blob_in, dim_in, spatial_scale): 40 | 41 | hidden_dim = cfg.FAST_RCNN.MLP_HEAD_DIM 42 | roi_size = cfg.FAST_RCNN.ROI_XFORM_RESOLUTION 43 | roi_feat = model.RoIFeatureTransform( 44 | blob_in, 45 | 'roi_feat', 46 | blob_rois='rois', 47 | method=cfg.FAST_RCNN.ROI_XFORM_METHOD, 48 | resolution=roi_size, 49 | sampling_ratio=cfg.FAST_RCNN.ROI_XFORM_SAMPLING_RATIO, 50 | spatial_scale=spatial_scale 51 | ) 52 | model.FC(roi_feat, 'fc6', dim_in * roi_size * roi_size, hidden_dim) 53 | model.Relu('fc6', 'fc6') 54 | model.FC('fc6', 'fc7', hidden_dim, hidden_dim) 55 | model.Relu('fc7', 'fc7') 56 | return 'fc7', hidden_dim -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/modeling/fast_rcnn_heads.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/modeling/fast_rcnn_heads.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/modeling/generate_anchors.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/modeling/generate_anchors.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/modeling/keypoint_rcnn_heads.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/modeling/keypoint_rcnn_heads.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/modeling/mask_rcnn_heads.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/modeling/mask_rcnn_heads.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/modeling/model_builder.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/modeling/model_builder.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/modeling/name_compat.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/modeling/name_compat.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/modeling/optimizer.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/modeling/optimizer.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/modeling/retinanet_heads.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/modeling/retinanet_heads.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/modeling/rfcn_heads.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/modeling/rfcn_heads.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/modeling/rpn_heads.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/modeling/rpn_heads.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/ops/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/ops/__init__.py -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/ops/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/ops/__init__.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/ops/collect_and_distribute_fpn_rpn_proposals.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/ops/collect_and_distribute_fpn_rpn_proposals.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/ops/generate_proposal_labels.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/ops/generate_proposal_labels.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/ops/generate_proposals.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/ops/generate_proposals.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/ops/zero_even_op.cc: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "zero_even_op.h" 18 | 19 | namespace caffe2 { 20 | 21 | template <> 22 | bool ZeroEvenOp::RunOnDevice() { 23 | // Retrieve the input tensor. 24 | const auto& X = Input(0); 25 | CAFFE_ENFORCE(X.dim() == 1); 26 | 27 | // Initialize the output tensor to a copy of the input tensor. 28 | auto* Y = Output(0); 29 | Y->CopyFrom(X); 30 | 31 | // Set output elements at even indices to zero. 32 | auto* Y_data = Y->mutable_data(); 33 | for (auto i = 0; i < Y->numel(); i += 2) { 34 | Y_data[i] = 0.0f; 35 | } 36 | 37 | return true; 38 | } 39 | 40 | REGISTER_CPU_OPERATOR(ZeroEven, ZeroEvenOp); 41 | 42 | OPERATOR_SCHEMA(ZeroEven) 43 | .NumInputs(1) 44 | .NumOutputs(1) 45 | .Input( 46 | 0, 47 | "X", 48 | "1D input tensor") 49 | .Output( 50 | 0, 51 | "Y", 52 | "1D output tensor"); 53 | 54 | } // namespace caffe2 55 | -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/ops/zero_even_op.cu: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "caffe2/core/context_gpu.h" 18 | 19 | #include "zero_even_op.h" 20 | 21 | namespace caffe2 { 22 | 23 | namespace { 24 | 25 | template 26 | __global__ void SetEvenIndsToVal(size_t num_even_inds, T val, T* data) { 27 | CUDA_1D_KERNEL_LOOP(i, num_even_inds) { 28 | data[i << 1] = val; 29 | } 30 | } 31 | 32 | } // namespace 33 | 34 | template <> 35 | bool ZeroEvenOp::RunOnDevice() { 36 | // Retrieve the input tensor. 37 | const auto& X = Input(0); 38 | CAFFE_ENFORCE(X.ndim() == 1); 39 | 40 | // Initialize the output tensor to a copy of the input tensor. 41 | auto* Y = Output(0); 42 | Y->CopyFrom(X); 43 | 44 | // Set output elements at even indices to zero. 45 | auto output_size = Y->size(); 46 | 47 | if (output_size > 0) { 48 | size_t num_even_inds = output_size / 2 + output_size % 2; 49 | SetEvenIndsToVal 50 | <<>>( 54 | num_even_inds, 55 | 0.0f, 56 | Y->mutable_data()); 57 | } 58 | 59 | return true; 60 | } 61 | 62 | REGISTER_CUDA_OPERATOR(ZeroEven, ZeroEvenOp); 63 | 64 | } // namespace caffe2 65 | -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/ops/zero_even_op.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ZERO_EVEN_OP_H_ 18 | #define ZERO_EVEN_OP_H_ 19 | 20 | #include "caffe2/core/context.h" 21 | #include "caffe2/core/operator.h" 22 | 23 | namespace caffe2 { 24 | 25 | /** 26 | * ZeroEven operator. Zeros elements at even indices of an 1D array. 27 | * Elements at odd indices are preserved. 28 | * 29 | * This toy operator is an example of a custom operator and may be a useful 30 | * reference for adding new custom operators to the Detectron codebase. 31 | */ 32 | template 33 | class ZeroEvenOp final : public Operator { 34 | public: 35 | // Introduce Operator helper members. 36 | USE_OPERATOR_CONTEXT_FUNCTIONS; 37 | 38 | ZeroEvenOp(const OperatorDef& operator_def, Workspace* ws) 39 | : Operator(operator_def, ws) {} 40 | 41 | bool RunOnDevice() override; 42 | }; 43 | 44 | } // namespace caffe2 45 | 46 | #endif // ZERO_EVEN_OP_H_ 47 | -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/roi_data/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/roi_data/__init__.py -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/roi_data/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/roi_data/__init__.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/roi_data/data_utils.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/roi_data/data_utils.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/roi_data/fast_rcnn.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/roi_data/fast_rcnn.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/roi_data/keypoint_rcnn.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/roi_data/keypoint_rcnn.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/roi_data/loader.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/roi_data/loader.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/roi_data/mask_rcnn.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/roi_data/mask_rcnn.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/roi_data/minibatch.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/roi_data/minibatch.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/roi_data/retinanet.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/roi_data/retinanet.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/roi_data/rpn.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/roi_data/rpn.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/utils/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/utils/__init__.py -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/utils/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/utils/__init__.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/utils/blob.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/utils/blob.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/utils/boxes.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/utils/boxes.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/utils/c2.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/utils/c2.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/utils/collections.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/utils/collections.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/utils/colormap.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/utils/colormap.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/utils/coordinator.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017-present, Facebook, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | ############################################################################## 15 | 16 | """Coordinated access to a shared multithreading/processing queue.""" 17 | 18 | from __future__ import absolute_import 19 | from __future__ import division 20 | from __future__ import print_function 21 | from __future__ import unicode_literals 22 | 23 | import contextlib 24 | import logging 25 | import threading 26 | import traceback 27 | from six.moves import queue as Queue 28 | 29 | log = logging.getLogger(__name__) 30 | 31 | 32 | class Coordinator(object): 33 | 34 | def __init__(self): 35 | self._event = threading.Event() 36 | 37 | def request_stop(self): 38 | log.debug('Coordinator stopping') 39 | self._event.set() 40 | 41 | def should_stop(self): 42 | return self._event.is_set() 43 | 44 | def wait_for_stop(self): 45 | return self._event.wait() 46 | 47 | @contextlib.contextmanager 48 | def stop_on_exception(self): 49 | try: 50 | yield 51 | except Exception: 52 | if not self.should_stop(): 53 | traceback.print_exc() 54 | self.request_stop() 55 | 56 | 57 | def coordinated_get(coordinator, queue): 58 | while not coordinator.should_stop(): 59 | try: 60 | return queue.get(block=True, timeout=1.0) 61 | except Queue.Empty: 62 | continue 63 | raise Exception('Coordinator stopped during get()') 64 | 65 | 66 | def coordinated_put(coordinator, queue, element): 67 | while not coordinator.should_stop(): 68 | try: 69 | queue.put(element, block=True, timeout=1.0) 70 | return 71 | except Queue.Full: 72 | continue 73 | raise Exception('Coordinator stopped during put()') 74 | -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/utils/coordinator.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/utils/coordinator.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/utils/cython_bbox.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/utils/cython_bbox.so -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/utils/cython_nms.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/utils/cython_nms.so -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/utils/env.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/utils/env.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/utils/image.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017-present, Facebook, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | ############################################################################## 15 | 16 | """Image helper functions.""" 17 | 18 | from __future__ import absolute_import 19 | from __future__ import division 20 | from __future__ import print_function 21 | from __future__ import unicode_literals 22 | 23 | import cv2 24 | import numpy as np 25 | 26 | 27 | def aspect_ratio_rel(im, aspect_ratio): 28 | """Performs width-relative aspect ratio transformation.""" 29 | im_h, im_w = im.shape[:2] 30 | im_ar_w = int(round(aspect_ratio * im_w)) 31 | im_ar = cv2.resize(im, dsize=(im_ar_w, im_h)) 32 | return im_ar 33 | 34 | 35 | def aspect_ratio_abs(im, aspect_ratio): 36 | """Performs absolute aspect ratio transformation.""" 37 | im_h, im_w = im.shape[:2] 38 | im_area = im_h * im_w 39 | 40 | im_ar_w = np.sqrt(im_area * aspect_ratio) 41 | im_ar_h = np.sqrt(im_area / aspect_ratio) 42 | assert np.isclose(im_ar_w / im_ar_h, aspect_ratio) 43 | 44 | im_ar = cv2.resize(im, dsize=(int(im_ar_w), int(im_ar_h))) 45 | return im_ar 46 | -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/utils/image.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/utils/image.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/utils/io.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/utils/io.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/utils/keypoints.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/utils/keypoints.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/utils/logging.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/utils/logging.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/utils/lr_policy.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/utils/lr_policy.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/utils/net.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/utils/net.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/utils/segms.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/utils/segms.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/utils/subprocess.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/utils/subprocess.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/utils/timer.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017-present, Facebook, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | ############################################################################## 15 | # 16 | # Based on: 17 | # -------------------------------------------------------- 18 | # Fast R-CNN 19 | # Copyright (c) 2015 Microsoft 20 | # Licensed under The MIT License [see LICENSE for details] 21 | # Written by Ross Girshick 22 | # -------------------------------------------------------- 23 | 24 | """Timing related functions.""" 25 | 26 | from __future__ import absolute_import 27 | from __future__ import division 28 | from __future__ import print_function 29 | from __future__ import unicode_literals 30 | 31 | import time 32 | 33 | 34 | class Timer(object): 35 | """A simple timer.""" 36 | 37 | def __init__(self): 38 | self.reset() 39 | 40 | def tic(self): 41 | # using time.time instead of time.clock because time time.clock 42 | # does not normalize for multithreading 43 | self.start_time = time.time() 44 | 45 | def toc(self, average=True): 46 | self.diff = time.time() - self.start_time 47 | self.total_time += self.diff 48 | self.calls += 1 49 | self.average_time = self.total_time / self.calls 50 | if average: 51 | return self.average_time 52 | else: 53 | return self.diff 54 | 55 | def reset(self): 56 | self.total_time = 0. 57 | self.calls = 0 58 | self.start_time = 0. 59 | self.diff = 0. 60 | self.average_time = 0. 61 | -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/utils/timer.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/utils/timer.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/utils/train.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/utils/train.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/utils/training_stats.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/utils/training_stats.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/detectron/utils/vis.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/freeze/detectron/utils/vis.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/e2e_faster_rcnn_R-50-FPN_2x.yaml: -------------------------------------------------------------------------------- 1 | MODEL: 2 | TYPE: generalized_rcnn 3 | CONV_BODY: FPN.add_fpn_ResNet50_conv5_body 4 | NUM_CLASSES: 11 5 | FASTER_RCNN: True 6 | NUM_GPUS: 1 7 | SOLVER: 8 | WEIGHT_DECAY: 0.0 9 | LR_POLICY: steps_with_decay 10 | BASE_LR: 0.0 11 | GAMMA: 0.0 12 | MAX_ITER: 60000 13 | STEPS: [0, 20000, 40000] 14 | FPN: 15 | FPN_ON: True 16 | MULTILEVEL_ROIS: True 17 | MULTILEVEL_RPN: True 18 | # RPN_ASPECT_RATIOS: (1/3, 0.5, 1, 2, 3) # (0.5, 1, 2) Next to (0.25, 0.33, 0.5, 1, 2, 3, 4) 19 | RPN_ANCHOR_START_SIZE: 32 20 | FAST_RCNN: 21 | ROI_BOX_HEAD: fast_rcnn_heads.add_roi_2mlp_head 22 | ROI_XFORM_METHOD: RoIAlign 23 | ROI_XFORM_RESOLUTION: 7 24 | ROI_XFORM_SAMPLING_RATIO: 2 25 | TRAIN: 26 | WEIGHTS: /home/wsh/remote-newc-warm-up/dior/train/coco_2014_train/generalized_rcnn/model_final.pkl 27 | DATASETS: ('coco_2014_train',) 28 | SCALES: (800,) 29 | MAX_SIZE: 1333 30 | BATCH_SIZE_PER_IM: 512 31 | RPN_PRE_NMS_TOP_N: 2000 # Per FPN level 32 | RPN_BATCH_SIZE_PER_IM: 256 # 2000 33 | TEST: 34 | DATASETS: ('coco_2014_val',) 35 | SCALE: 800 36 | MAX_SIZE: 1333 37 | NMS: 0.5 38 | # RPN_PRE_NMS_TOP_N: 1000 # Per FPN level 39 | RPN_PRE_NMS_TOP_N: 2000 # For DOTA 40 | # RPN_POST_NMS_TOP_N: 1000 41 | RPN_POST_NMS_TOP_N: 2000 # For DOTA 42 | DETECTIONS_PER_IM: 1500 #100 43 | OUTPUT_DIR: . 44 | -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/setup.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017-present, Facebook, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | ############################################################################## 15 | 16 | from __future__ import absolute_import 17 | from __future__ import division 18 | from __future__ import print_function 19 | 20 | from Cython.Build import cythonize 21 | from setuptools import Extension 22 | from setuptools import setup 23 | 24 | import numpy as np 25 | 26 | _NP_INCLUDE_DIRS = np.get_include() 27 | 28 | 29 | # Extension modules 30 | ext_modules = [ 31 | Extension( 32 | name='detectron.utils.cython_bbox', 33 | sources=[ 34 | 'detectron/utils/cython_bbox.pyx' 35 | ], 36 | extra_compile_args=[ 37 | '-Wno-cpp' 38 | ], 39 | include_dirs=[ 40 | _NP_INCLUDE_DIRS 41 | ] 42 | ), 43 | Extension( 44 | name='detectron.utils.cython_nms', 45 | sources=[ 46 | 'detectron/utils/cython_nms.pyx' 47 | ], 48 | extra_compile_args=[ 49 | '-Wno-cpp' 50 | ], 51 | include_dirs=[ 52 | _NP_INCLUDE_DIRS 53 | ] 54 | ) 55 | ] 56 | 57 | setup( 58 | name='Detectron', 59 | packages=['detectron'], 60 | ext_modules=cythonize(ext_modules) 61 | ) 62 | -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/freeze/tools/convert_selective_search.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright (c) 2017-present, Facebook, Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | ############################################################################## 17 | 18 | """Script to convert Selective Search proposal boxes into the Detectron proposal 19 | file format. 20 | """ 21 | 22 | from __future__ import absolute_import 23 | from __future__ import division 24 | from __future__ import print_function 25 | from __future__ import unicode_literals 26 | 27 | import numpy as np 28 | import scipy.io as sio 29 | import sys 30 | 31 | from detectron.datasets.json_dataset import JsonDataset 32 | from detectron.utils.io import save_object 33 | 34 | 35 | if __name__ == '__main__': 36 | dataset_name = sys.argv[1] 37 | file_in = sys.argv[2] 38 | file_out = sys.argv[3] 39 | 40 | ds = JsonDataset(dataset_name) 41 | roidb = ds.get_roidb() 42 | raw_data = sio.loadmat(file_in)['boxes'].ravel() 43 | assert raw_data.shape[0] == len(roidb) 44 | 45 | boxes = [] 46 | scores = [] 47 | ids = [] 48 | for i in range(raw_data.shape[0]): 49 | if i % 1000 == 0: 50 | print('{}/{}'.format(i + 1, len(roidb))) 51 | # selective search boxes are 1-indexed and (y1, x1, y2, x2) 52 | i_boxes = raw_data[i][:, (1, 0, 3, 2)] - 1 53 | boxes.append(i_boxes.astype(np.float32)) 54 | scores.append(np.zeros((i_boxes.shape[0]), dtype=np.float32)) 55 | ids.append(roidb[i]['id']) 56 | 57 | save_object(dict(boxes=boxes, scores=scores, indexes=ids), file_out) 58 | -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/Makefile: -------------------------------------------------------------------------------- 1 | # Don't use the --user flag for setup.py develop mode with virtualenv. 2 | DEV_USER_FLAG=$(shell python -c "import sys; print('' if hasattr(sys, 'real_prefix') else '--user')") 3 | 4 | .PHONY: default 5 | default: dev 6 | 7 | .PHONY: install 8 | install: 9 | python setup.py install 10 | 11 | .PHONY: ops 12 | ops: 13 | mkdir -p build && cd build && cmake .. && make -j$(shell nproc) 14 | 15 | .PHONY: dev 16 | dev: 17 | python setup.py develop $(DEV_USER_FLAG) 18 | 19 | .PHONY: clean 20 | clean: 21 | python setup.py develop --uninstall $(DEV_USER_FLAG) 22 | rm -rf build 23 | -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/.directory: -------------------------------------------------------------------------------- 1 | [Dolphin] 2 | SortOrder=1 3 | SortRole=date 4 | Timestamp=2019,9,30,10,48,5 5 | Version=3 6 | -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/__init__.py -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/__init__.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/core/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/core/__init__.py -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/core/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/core/__init__.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/core/config.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/core/config.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/core/rpn_generator.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/core/rpn_generator.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/core/test.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/core/test.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/core/test_engine.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/core/test_engine.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/datasets/VOCdevkit-matlab-wrapper/get_voc_opts.m: -------------------------------------------------------------------------------- 1 | function VOCopts = get_voc_opts(path) 2 | 3 | tmp = pwd; 4 | cd(path); 5 | try 6 | addpath('VOCcode'); 7 | VOCinit; 8 | catch 9 | rmpath('VOCcode'); 10 | cd(tmp); 11 | error(sprintf('VOCcode directory not found under %s', path)); 12 | end 13 | rmpath('VOCcode'); 14 | cd(tmp); 15 | -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/datasets/VOCdevkit-matlab-wrapper/voc_eval.m: -------------------------------------------------------------------------------- 1 | function res = voc_eval(path, comp_id, test_set, output_dir) 2 | 3 | VOCopts = get_voc_opts(path); 4 | VOCopts.testset = test_set; 5 | 6 | for i = 1:length(VOCopts.classes) 7 | cls = VOCopts.classes{i}; 8 | res(i) = voc_eval_cls(cls, VOCopts, comp_id, output_dir); 9 | end 10 | 11 | fprintf('\n~~~~~~~~~~~~~~~~~~~~\n'); 12 | fprintf('Results:\n'); 13 | aps = [res(:).ap]'; 14 | fprintf('%.1f\n', aps * 100); 15 | fprintf('%.1f\n', mean(aps) * 100); 16 | fprintf('~~~~~~~~~~~~~~~~~~~~\n'); 17 | 18 | function res = voc_eval_cls(cls, VOCopts, comp_id, output_dir) 19 | 20 | test_set = VOCopts.testset; 21 | year = VOCopts.dataset(4:end); 22 | 23 | addpath(fullfile(VOCopts.datadir, 'VOCcode')); 24 | 25 | res_fn = sprintf(VOCopts.detrespath, comp_id, cls); 26 | 27 | recall = []; 28 | prec = []; 29 | ap = 0; 30 | ap_auc = 0; 31 | 32 | do_eval = (str2num(year) <= 2007) | ~strcmp(test_set, 'test'); 33 | if do_eval 34 | % Bug in VOCevaldet requires that tic has been called first 35 | tic; 36 | [recall, prec, ap] = VOCevaldet(VOCopts, comp_id, cls, true); 37 | ap_auc = xVOCap(recall, prec); 38 | 39 | % force plot limits 40 | ylim([0 1]); 41 | xlim([0 1]); 42 | 43 | print(gcf, '-djpeg', '-r0', ... 44 | [output_dir '/' cls '_pr.jpg']); 45 | end 46 | fprintf('!!! %s : %.4f %.4f\n', cls, ap, ap_auc); 47 | 48 | res.recall = recall; 49 | res.prec = prec; 50 | res.ap = ap; 51 | res.ap_auc = ap_auc; 52 | 53 | save([output_dir '/' cls '_pr.mat'], ... 54 | 'res', 'recall', 'prec', 'ap', 'ap_auc'); 55 | 56 | rmpath(fullfile(VOCopts.datadir, 'VOCcode')); 57 | -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/datasets/VOCdevkit-matlab-wrapper/xVOCap.m: -------------------------------------------------------------------------------- 1 | function ap = xVOCap(rec,prec) 2 | % From the PASCAL VOC 2011 devkit 3 | 4 | mrec=[0 ; rec ; 1]; 5 | mpre=[0 ; prec ; 0]; 6 | for i=numel(mpre)-1:-1:1 7 | mpre(i)=max(mpre(i),mpre(i+1)); 8 | end 9 | i=find(mrec(2:end)~=mrec(1:end-1))+1; 10 | ap=sum((mrec(i)-mrec(i-1)).*mpre(i)); 11 | -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/datasets/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/datasets/__init__.py -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/datasets/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/datasets/__init__.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/datasets/cityscapes_json_dataset_evaluator.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/datasets/cityscapes_json_dataset_evaluator.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/datasets/dataset_catalog.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/datasets/dataset_catalog.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/datasets/dummy_datasets.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/datasets/dummy_datasets.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/datasets/json_dataset.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/datasets/json_dataset.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/datasets/json_dataset_evaluator.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/datasets/json_dataset_evaluator.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/datasets/roidb.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/datasets/roidb.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/datasets/task_evaluation.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/datasets/task_evaluation.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/datasets/voc_dataset_evaluator.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/datasets/voc_dataset_evaluator.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/datasets/voc_eval.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/datasets/voc_eval.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/modeling/FPN.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/modeling/FPN.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/modeling/ResNet.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/modeling/ResNet.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/modeling/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017-present, Facebook, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | ############################################################################## 15 | -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/modeling/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/modeling/__init__.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/modeling/detector.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/modeling/detector.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/modeling/fast_rcnn_heads.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/modeling/fast_rcnn_heads.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/modeling/generate_anchors.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/modeling/generate_anchors.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/modeling/model_builder.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/modeling/model_builder.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/modeling/name_compat.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/modeling/name_compat.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/modeling/optimizer.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/modeling/optimizer.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/modeling/rpn_heads.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017-present, Facebook, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | ############################################################################## 15 | 16 | from __future__ import absolute_import 17 | from __future__ import division 18 | from __future__ import print_function 19 | from __future__ import unicode_literals 20 | 21 | from detectron.core.config import cfg 22 | import detectron.modeling.FPN as FPN 23 | 24 | # ---------------------------------------------------------------------------- # 25 | # RPN and Faster R-CNN outputs and losses 26 | # ---------------------------------------------------------------------------- # 27 | 28 | def add_generic_rpn_outputs(model, blob_in, dim_in, spatial_scale_in): 29 | """Add RPN outputs (objectness classification and bounding box regression) 30 | to an RPN model. Abstracts away the use of FPN. 31 | """ 32 | loss_gradients = None 33 | if cfg.FPN.FPN_ON: 34 | # Delegate to the FPN module 35 | FPN.add_fpn_rpn_outputs(model, blob_in, dim_in, spatial_scale_in) 36 | if cfg.MODEL.FASTER_RCNN: 37 | # CollectAndDistributeFpnRpnProposals also labels proposals when in 38 | # training mode 39 | model.CollectAndDistributeFpnRpnProposals() 40 | if model.train: 41 | loss_gradients = FPN.add_fpn_rpn_losses(model) 42 | 43 | return loss_gradients 44 | 45 | -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/modeling/rpn_heads.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/modeling/rpn_heads.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/ops/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/ops/__init__.py -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/ops/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/ops/__init__.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/ops/collect_and_distribute_fpn_rpn_proposals.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from __future__ import division 3 | from __future__ import print_function 4 | from __future__ import unicode_literals 5 | import numpy as np 6 | from detectron.core.config import cfg 7 | from detectron.datasets import json_dataset 8 | from detectron.datasets import roidb as roidb_utils 9 | import detectron.roi_data.fast_rcnn as fast_rcnn_roi_data 10 | import detectron.utils.blob as blob_utils 11 | import logging 12 | import pylibmc 13 | 14 | logger = logging.getLogger(__name__) 15 | 16 | class CollectAndDistributeFpnRpnProposalsOp(object): 17 | def __init__(self, train): 18 | self._train = train 19 | self._mc = pylibmc.Client(["127.0.0.1:11212"], binary=True, 20 | behaviors={"tcp_nodelay": True, 21 | "ketama": True}) 22 | 23 | def forward(self, inputs, outputs): 24 | 25 | rois = collect(inputs, self._train) 26 | 27 | 28 | 29 | im_info = inputs[-1].data 30 | im_scales = im_info[:, 2] 31 | roidb = blob_utils.deserialize(inputs[-2].data) 32 | 33 | json_dataset.add_proposals(roidb, rois, im_scales, crowd_thresh=0) 34 | roidb_utils.add_bbox_regression_targets(roidb) 35 | 36 | output_blob_names = fast_rcnn_roi_data.get_fast_rcnn_blob_names() 37 | blobs = {k: [] for k in output_blob_names} 38 | fast_rcnn_roi_data.add_fast_rcnn_blobs(blobs, im_scales, roidb, self._mc) 39 | for i, k in enumerate(output_blob_names): 40 | blob_utils.py_op_copy_blob(blobs[k], outputs[i]) 41 | 42 | 43 | 44 | 45 | def collect(inputs, is_training): 46 | 47 | post_nms_topN = cfg['TRAIN'].RPN_POST_NMS_TOP_N 48 | k_max = cfg.FPN.RPN_MAX_LEVEL 49 | k_min = cfg.FPN.RPN_MIN_LEVEL 50 | num_lvls = k_max - k_min + 1 51 | 52 | roi_inputs = inputs[0:num_lvls] 53 | score_inputs = inputs[num_lvls:num_lvls*2] 54 | 55 | rois = np.concatenate([blob.data for blob in roi_inputs]) 56 | scores = np.concatenate([blob.data for blob in score_inputs]).squeeze() 57 | inds = np.argsort(-scores)[:post_nms_topN] 58 | rois = rois[inds, :] 59 | 60 | return rois -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/ops/collect_and_distribute_fpn_rpn_proposals.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/ops/collect_and_distribute_fpn_rpn_proposals.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/ops/distillLossOp.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from __future__ import division 3 | from __future__ import print_function 4 | from __future__ import unicode_literals 5 | import numpy as np 6 | import pylibmc 7 | import math 8 | 9 | import logging 10 | 11 | logger = logging.getLogger(__name__) 12 | 13 | 14 | class distillLossOp(object): 15 | def __init__(self, train,temperature): 16 | self._train = train 17 | self._mc = pylibmc.Client(["127.0.0.1:11212"], binary=True, 18 | behaviors={"tcp_nodelay": True, 19 | "ketama": True}) 20 | self._temperature=temperature 21 | 22 | def forward(self, inputs, outputs): 23 | 24 | outputs[0].reshape((1,)) 25 | outputs[0].data[0]=0.5 26 | 27 | def backwardd(self,inputs,outputs): 28 | 29 | #inputs[0] distilled logits 30 | #inputs[1] label 31 | #inputs[2] loss 32 | #inputs[3] loss gradient 33 | 34 | #outputs[0] distilled logits gradient 35 | #outputs[1] label logits gradient 36 | 37 | outputs[0].reshape(inputs[0].data.shape) 38 | 39 | probDistilled=inputs[0].data 40 | probLabel=inputs[1].data 41 | 42 | probDistilled_row_max=np.max(probDistilled,axis=1) 43 | probLabel_row_max=np.max(probLabel,axis=1) 44 | 45 | probDistilled = probDistilled - probDistilled_row_max[:, np.newaxis] 46 | probLabel=probLabel - probLabel_row_max[:, np.newaxis] 47 | 48 | probDistilled=probDistilled/self._temperature 49 | probLabel=probLabel/self._temperature 50 | 51 | 52 | logger.info(np.max(probDistilled)) 53 | 54 | probDistilled=math.e**probDistilled 55 | probLabel=math.e**probLabel 56 | 57 | probDistilled_row_sum=np.sum(probDistilled,axis=1) 58 | probLabel_row_sum=np.sum(probLabel,axis=1) 59 | 60 | probDistilled = probDistilled / probDistilled_row_sum[:, np.newaxis] 61 | probLabel=probLabel/probLabel_row_sum[:, np.newaxis] 62 | 63 | outputs[0].data[...]=2*2/3*(1./self._temperature)*(self._temperature**2)*(1./512.)*(probDistilled-probLabel) 64 | 65 | -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/ops/distillLossOp.py.bak: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from __future__ import division 3 | from __future__ import print_function 4 | from __future__ import unicode_literals 5 | import numpy as np 6 | import pylibmc 7 | import math 8 | 9 | class distillLossOp(object): 10 | def __init__(self, train,temperature): 11 | self._train = train 12 | self._mc = pylibmc.Client(["127.0.0.1:11212"], binary=True, 13 | behaviors={"tcp_nodelay": True, 14 | "ketama": True}) 15 | self._temperature=temperature 16 | 17 | def forward(self, inputs, outputs): 18 | 19 | outputs[0].reshape((1,)) 20 | outputs[0].data[0]=0.5 21 | 22 | def backwardd(self,inputs,outputs): 23 | 24 | #inputs[0] distilled logits 25 | #inputs[1] label 26 | #inputs[2] loss 27 | #inputs[3] loss gradient 28 | 29 | #outputs[0] distilled logits gradient 30 | #outputs[1] label logits gradient 31 | 32 | outputs[0].reshape(inputs[0].data.shape) 33 | 34 | probDistilled=inputs[0].data/self._temperature 35 | probLabel=inputs[1].data/self._temperature 36 | 37 | probDistilled=math.e**probDistilled 38 | probLabel=math.e**probLabel 39 | 40 | probDistilled_row_sum=np.sum(probDistilled,axis=1) 41 | probLabel_row_sum=np.sum(probLabel,axis=1) 42 | 43 | probDistilled = probDistilled / probDistilled_row_sum[:, np.newaxis] 44 | probLabel=probLabel/probLabel_row_sum[:, np.newaxis] 45 | 46 | outputs[0].data[...]=1*2/11*(1./self._temperature)*(self._temperature**2)*(1./512.)*(probDistilled-probLabel) 47 | 48 | -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/ops/distillLossOp.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/ops/distillLossOp.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/ops/generate_proposals.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/ops/generate_proposals.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/ops/get_weightsOpFastrcnn.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from __future__ import division 3 | from __future__ import print_function 4 | from __future__ import unicode_literals 5 | import pylibmc 6 | 7 | class get_weightsOpFastrcnn(object): 8 | def __init__(self, train): 9 | self._train = train 10 | self._mc = pylibmc.Client(["127.0.0.1:11212"], binary=True, 11 | behaviors={"tcp_nodelay": True, 12 | "ketama": True}) 13 | 14 | def forward(self, inputs, outputs): 15 | 16 | while True: 17 | if(self._mc.get('freeze_fastrcnn_label_s')=='weidu'): 18 | break 19 | freeze_fastrcnn_label=self._mc.get('freeze_fastrcnn_label') 20 | self._mc.replace('freeze_fastrcnn_label_s','yidu') 21 | 22 | for i in range(2): 23 | 24 | outputs[3*i].reshape(freeze_fastrcnn_label[i].shape) 25 | outputs[3*i].data[...]=freeze_fastrcnn_label[i][...] 26 | 27 | outputs[3*i+1].reshape(freeze_fastrcnn_label[i].shape) 28 | outputs[3*i+1].data[...]=1.0 29 | 30 | outputs[3*i+2].reshape(freeze_fastrcnn_label[i].shape) 31 | outputs[3*i+2].data[...]=1.0/(freeze_fastrcnn_label[i].shape[1]) 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/ops/get_weightsOpFastrcnn.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/ops/get_weightsOpFastrcnn.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/ops/get_weightsOpRPN.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from __future__ import division 3 | from __future__ import print_function 4 | from __future__ import unicode_literals 5 | import pylibmc 6 | 7 | class get_weightsOpRPN(object): 8 | def __init__(self, train,slvl,tag): 9 | self._train = train 10 | self._slvl=slvl 11 | self._tag=tag 12 | self._mc = pylibmc.Client(["127.0.0.1:11212"], binary=True, 13 | behaviors={"tcp_nodelay": True, 14 | "ketama": True}) 15 | 16 | def forward(self, inputs, outputs): 17 | 18 | if self._tag=='cls_probs': 19 | while True: 20 | if(self._mc.get('rpn_cls_probs_fpn'+self._slvl+'_s')=='weidu'): 21 | break 22 | tmp=self._mc.get('rpn_cls_probs_fpn'+self._slvl) 23 | self._mc.replace('rpn_cls_probs_fpn'+self._slvl+'_s','yidu') 24 | 25 | if self._tag=='bbox_pred': 26 | while True: 27 | if(self._mc.get('rpn_bbox_pred_fpn'+self._slvl+'_s')=='weidu'): 28 | break 29 | tmp=self._mc.get('rpn_bbox_pred_fpn'+self._slvl) 30 | self._mc.replace('rpn_bbox_pred_fpn'+self._slvl+'_s','yidu') 31 | 32 | outputs[0].reshape(tmp.shape) 33 | outputs[0].data[...]=tmp[...] 34 | 35 | outputs[1].reshape(tmp.shape) 36 | outputs[1].data[...]=1.0 37 | 38 | outputs[2].reshape(tmp.shape) 39 | outputs[2].data[...]=1.0/(tmp.shape[1]*tmp.shape[2]*tmp.shape[3]) 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/ops/get_weightsOpRPN.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/ops/get_weightsOpRPN.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/ops/zero_even_op.cc: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "zero_even_op.h" 18 | 19 | namespace caffe2 { 20 | 21 | template <> 22 | bool ZeroEvenOp::RunOnDevice() { 23 | // Retrieve the input tensor. 24 | const auto& X = Input(0); 25 | CAFFE_ENFORCE(X.dim() == 1); 26 | 27 | // Initialize the output tensor to a copy of the input tensor. 28 | auto* Y = Output(0); 29 | Y->CopyFrom(X); 30 | 31 | // Set output elements at even indices to zero. 32 | auto* Y_data = Y->mutable_data(); 33 | for (auto i = 0; i < Y->numel(); i += 2) { 34 | Y_data[i] = 0.0f; 35 | } 36 | 37 | return true; 38 | } 39 | 40 | REGISTER_CPU_OPERATOR(ZeroEven, ZeroEvenOp); 41 | 42 | OPERATOR_SCHEMA(ZeroEven) 43 | .NumInputs(1) 44 | .NumOutputs(1) 45 | .Input( 46 | 0, 47 | "X", 48 | "1D input tensor") 49 | .Output( 50 | 0, 51 | "Y", 52 | "1D output tensor"); 53 | 54 | } // namespace caffe2 55 | -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/ops/zero_even_op.cu: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "caffe2/core/context_gpu.h" 18 | 19 | #include "zero_even_op.h" 20 | 21 | namespace caffe2 { 22 | 23 | namespace { 24 | 25 | template 26 | __global__ void SetEvenIndsToVal(size_t num_even_inds, T val, T* data) { 27 | CUDA_1D_KERNEL_LOOP(i, num_even_inds) { 28 | data[i << 1] = val; 29 | } 30 | } 31 | 32 | } // namespace 33 | 34 | template <> 35 | bool ZeroEvenOp::RunOnDevice() { 36 | // Retrieve the input tensor. 37 | const auto& X = Input(0); 38 | CAFFE_ENFORCE(X.ndim() == 1); 39 | 40 | // Initialize the output tensor to a copy of the input tensor. 41 | auto* Y = Output(0); 42 | Y->CopyFrom(X); 43 | 44 | // Set output elements at even indices to zero. 45 | auto output_size = Y->size(); 46 | 47 | if (output_size > 0) { 48 | size_t num_even_inds = output_size / 2 + output_size % 2; 49 | SetEvenIndsToVal 50 | <<>>( 54 | num_even_inds, 55 | 0.0f, 56 | Y->mutable_data()); 57 | } 58 | 59 | return true; 60 | } 61 | 62 | REGISTER_CUDA_OPERATOR(ZeroEven, ZeroEvenOp); 63 | 64 | } // namespace caffe2 65 | -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/ops/zero_even_op.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ZERO_EVEN_OP_H_ 18 | #define ZERO_EVEN_OP_H_ 19 | 20 | #include "caffe2/core/context.h" 21 | #include "caffe2/core/operator.h" 22 | 23 | namespace caffe2 { 24 | 25 | /** 26 | * ZeroEven operator. Zeros elements at even indices of an 1D array. 27 | * Elements at odd indices are preserved. 28 | * 29 | * This toy operator is an example of a custom operator and may be a useful 30 | * reference for adding new custom operators to the Detectron codebase. 31 | */ 32 | template 33 | class ZeroEvenOp final : public Operator { 34 | public: 35 | // Introduce Operator helper members. 36 | USE_OPERATOR_CONTEXT_FUNCTIONS; 37 | 38 | ZeroEvenOp(const OperatorDef& operator_def, Workspace* ws) 39 | : Operator(operator_def, ws) {} 40 | 41 | bool RunOnDevice() override; 42 | }; 43 | 44 | } // namespace caffe2 45 | 46 | #endif // ZERO_EVEN_OP_H_ 47 | -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/roi_data/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/roi_data/__init__.py -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/roi_data/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/roi_data/__init__.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/roi_data/data_utils.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/roi_data/data_utils.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/roi_data/fast_rcnn.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/roi_data/fast_rcnn.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/roi_data/loader.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/roi_data/loader.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/roi_data/minibatch.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/roi_data/minibatch.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/roi_data/rpn.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/roi_data/rpn.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/utils/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/utils/__init__.py -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/utils/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/utils/__init__.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/utils/blob.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/utils/blob.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/utils/boxes.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/utils/boxes.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/utils/c2.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/utils/c2.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/utils/collections.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/utils/collections.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/utils/colormap.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/utils/colormap.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/utils/coordinator.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017-present, Facebook, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | ############################################################################## 15 | 16 | """Coordinated access to a shared multithreading/processing queue.""" 17 | 18 | from __future__ import absolute_import 19 | from __future__ import division 20 | from __future__ import print_function 21 | from __future__ import unicode_literals 22 | 23 | import contextlib 24 | import logging 25 | import threading 26 | import traceback 27 | from six.moves import queue as Queue 28 | 29 | log = logging.getLogger(__name__) 30 | 31 | 32 | class Coordinator(object): 33 | 34 | def __init__(self): 35 | self._event = threading.Event() 36 | 37 | def request_stop(self): 38 | log.debug('Coordinator stopping') 39 | self._event.set() 40 | 41 | def should_stop(self): 42 | return self._event.is_set() 43 | 44 | def wait_for_stop(self): 45 | return self._event.wait() 46 | 47 | @contextlib.contextmanager 48 | def stop_on_exception(self): 49 | try: 50 | yield 51 | except Exception: 52 | if not self.should_stop(): 53 | traceback.print_exc() 54 | self.request_stop() 55 | 56 | 57 | def coordinated_get(coordinator, queue): 58 | while not coordinator.should_stop(): 59 | try: 60 | return queue.get(block=True, timeout=1.0) 61 | except Queue.Empty: 62 | continue 63 | raise Exception('Coordinator stopped during get()') 64 | 65 | 66 | def coordinated_put(coordinator, queue, element): 67 | while not coordinator.should_stop(): 68 | try: 69 | queue.put(element, block=True, timeout=1.0) 70 | return 71 | except Queue.Full: 72 | continue 73 | raise Exception('Coordinator stopped during put()') 74 | -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/utils/coordinator.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/utils/coordinator.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/utils/cython_bbox.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/utils/cython_bbox.so -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/utils/cython_nms.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/utils/cython_nms.so -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/utils/env.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/utils/env.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/utils/image.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017-present, Facebook, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | ############################################################################## 15 | 16 | """Image helper functions.""" 17 | 18 | from __future__ import absolute_import 19 | from __future__ import division 20 | from __future__ import print_function 21 | from __future__ import unicode_literals 22 | 23 | import cv2 24 | import numpy as np 25 | 26 | 27 | def aspect_ratio_rel(im, aspect_ratio): 28 | """Performs width-relative aspect ratio transformation.""" 29 | im_h, im_w = im.shape[:2] 30 | im_ar_w = int(round(aspect_ratio * im_w)) 31 | im_ar = cv2.resize(im, dsize=(im_ar_w, im_h)) 32 | return im_ar 33 | 34 | 35 | def aspect_ratio_abs(im, aspect_ratio): 36 | """Performs absolute aspect ratio transformation.""" 37 | im_h, im_w = im.shape[:2] 38 | im_area = im_h * im_w 39 | 40 | im_ar_w = np.sqrt(im_area * aspect_ratio) 41 | im_ar_h = np.sqrt(im_area / aspect_ratio) 42 | assert np.isclose(im_ar_w / im_ar_h, aspect_ratio) 43 | 44 | im_ar = cv2.resize(im, dsize=(int(im_ar_w), int(im_ar_h))) 45 | return im_ar 46 | -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/utils/image.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/utils/image.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/utils/io.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/utils/io.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/utils/keypoints.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/utils/keypoints.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/utils/logging.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/utils/logging.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/utils/lr_policy.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/utils/lr_policy.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/utils/net.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/utils/net.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/utils/segms.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/utils/segms.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/utils/subprocess.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/utils/subprocess.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/utils/timer.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017-present, Facebook, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | ############################################################################## 15 | # 16 | # Based on: 17 | # -------------------------------------------------------- 18 | # Fast R-CNN 19 | # Copyright (c) 2015 Microsoft 20 | # Licensed under The MIT License [see LICENSE for details] 21 | # Written by Ross Girshick 22 | # -------------------------------------------------------- 23 | 24 | """Timing related functions.""" 25 | 26 | from __future__ import absolute_import 27 | from __future__ import division 28 | from __future__ import print_function 29 | from __future__ import unicode_literals 30 | 31 | import time 32 | 33 | 34 | class Timer(object): 35 | """A simple timer.""" 36 | 37 | def __init__(self): 38 | self.reset() 39 | 40 | def tic(self): 41 | # using time.time instead of time.clock because time time.clock 42 | # does not normalize for multithreading 43 | self.start_time = time.time() 44 | 45 | def toc(self, average=True): 46 | self.diff = time.time() - self.start_time 47 | self.total_time += self.diff 48 | self.calls += 1 49 | self.average_time = self.total_time / self.calls 50 | if average: 51 | return self.average_time 52 | else: 53 | return self.diff 54 | 55 | def reset(self): 56 | self.total_time = 0. 57 | self.calls = 0 58 | self.start_time = 0. 59 | self.diff = 0. 60 | self.average_time = 0. 61 | -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/utils/timer.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/utils/timer.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/utils/train.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/utils/train.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/utils/training_stats.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/utils/training_stats.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/detectron/utils/vis.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/target-after-sigmoid-distill-loss/train/detectron/utils/vis.pyc -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/e2e_faster_rcnn_R-50-FPN_2x.yaml: -------------------------------------------------------------------------------- 1 | MODEL: 2 | TYPE: generalized_rcnn 3 | CONV_BODY: FPN.add_fpn_ResNet50_conv5_body 4 | NUM_CLASSES: 11 5 | FASTER_RCNN: True 6 | NUM_GPUS: 1 7 | SOLVER: 8 | WEIGHT_DECAY: 0.0001 9 | LR_POLICY: steps_with_decay 10 | BASE_LR: 0.0018 11 | GAMMA: 0.1 12 | MAX_ITER: 70000 #10000 13 | STEPS: [0, 30000, 50000] 14 | 15 | #LR_POLICY: step 16 | #STEP_SIZE: 1 17 | #BASE_LR: 0.00018 18 | #GAMMA: 1.0001151358822766 19 | #MAX_ITER: 20000 20 | FPN: 21 | FPN_ON: True 22 | MULTILEVEL_ROIS: True 23 | MULTILEVEL_RPN: True 24 | # RPN_ASPECT_RATIOS: (1/3, 0.5, 1, 2, 3) # (0.5, 1, 2) Next to (0.25, 0.33, 0.5, 1, 2, 3, 4) 25 | RPN_ANCHOR_START_SIZE: 32 26 | FAST_RCNN: 27 | ROI_BOX_HEAD: fast_rcnn_heads.add_roi_2mlp_head 28 | ROI_XFORM_METHOD: RoIAlign 29 | ROI_XFORM_RESOLUTION: 7 30 | ROI_XFORM_SAMPLING_RATIO: 2 31 | TRAIN: 32 | WEIGHTS: /home/wsh/remote-newc-warm-up/dior/train/coco_2014_train/generalized_rcnn/model_final.pkl 33 | DATASETS: ('coco_2014_train',) 34 | SCALES: (800,) 35 | MAX_SIZE: 1333 36 | BATCH_SIZE_PER_IM: 512 37 | RPN_PRE_NMS_TOP_N: 2000 # Per FPN level 38 | RPN_BATCH_SIZE_PER_IM: 256 # 2000 39 | TEST: 40 | DATASETS: ('coco_2014_val',) 41 | SCALE: 800 42 | MAX_SIZE: 1333 43 | NMS: 0.5 44 | # RPN_PRE_NMS_TOP_N: 1000 # Per FPN level 45 | RPN_PRE_NMS_TOP_N: 2000 # For DOTA 46 | # RPN_POST_NMS_TOP_N: 1000 47 | RPN_POST_NMS_TOP_N: 2000 # For DOTA 48 | DETECTIONS_PER_IM: 1500 #100 49 | OUTPUT_DIR: . 50 | -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/setup.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017-present, Facebook, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | ############################################################################## 15 | 16 | from __future__ import absolute_import 17 | from __future__ import division 18 | from __future__ import print_function 19 | 20 | from Cython.Build import cythonize 21 | from setuptools import Extension 22 | from setuptools import setup 23 | 24 | import numpy as np 25 | 26 | _NP_INCLUDE_DIRS = np.get_include() 27 | 28 | 29 | # Extension modules 30 | ext_modules = [ 31 | Extension( 32 | name='detectron.utils.cython_bbox', 33 | sources=[ 34 | 'detectron/utils/cython_bbox.pyx' 35 | ], 36 | extra_compile_args=[ 37 | '-Wno-cpp' 38 | ], 39 | include_dirs=[ 40 | _NP_INCLUDE_DIRS 41 | ] 42 | ), 43 | Extension( 44 | name='detectron.utils.cython_nms', 45 | sources=[ 46 | 'detectron/utils/cython_nms.pyx' 47 | ], 48 | extra_compile_args=[ 49 | '-Wno-cpp' 50 | ], 51 | include_dirs=[ 52 | _NP_INCLUDE_DIRS 53 | ] 54 | ) 55 | ] 56 | 57 | setup( 58 | name='Detectron', 59 | packages=['detectron'], 60 | ext_modules=cythonize(ext_modules) 61 | ) 62 | -------------------------------------------------------------------------------- /target-after-sigmoid-distill-loss/train/tools/convert_selective_search.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright (c) 2017-present, Facebook, Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | ############################################################################## 17 | 18 | """Script to convert Selective Search proposal boxes into the Detectron proposal 19 | file format. 20 | """ 21 | 22 | from __future__ import absolute_import 23 | from __future__ import division 24 | from __future__ import print_function 25 | from __future__ import unicode_literals 26 | 27 | import numpy as np 28 | import scipy.io as sio 29 | import sys 30 | 31 | from detectron.datasets.json_dataset import JsonDataset 32 | from detectron.utils.io import save_object 33 | 34 | 35 | if __name__ == '__main__': 36 | dataset_name = sys.argv[1] 37 | file_in = sys.argv[2] 38 | file_out = sys.argv[3] 39 | 40 | ds = JsonDataset(dataset_name) 41 | roidb = ds.get_roidb() 42 | raw_data = sio.loadmat(file_in)['boxes'].ravel() 43 | assert raw_data.shape[0] == len(roidb) 44 | 45 | boxes = [] 46 | scores = [] 47 | ids = [] 48 | for i in range(raw_data.shape[0]): 49 | if i % 1000 == 0: 50 | print('{}/{}'.format(i + 1, len(roidb))) 51 | # selective search boxes are 1-indexed and (y1, x1, y2, x2) 52 | i_boxes = raw_data[i][:, (1, 0, 3, 2)] - 1 53 | boxes.append(i_boxes.astype(np.float32)) 54 | scores.append(np.zeros((i_boxes.shape[0]), dtype=np.float32)) 55 | ids.append(roidb[i]['id']) 56 | 57 | save_object(dict(boxes=boxes, scores=scores, indexes=ids), file_out) 58 | -------------------------------------------------------------------------------- /test-newC/Makefile: -------------------------------------------------------------------------------- 1 | # Don't use the --user flag for setup.py develop mode with virtualenv. 2 | DEV_USER_FLAG=$(shell python -c "import sys; print('' if hasattr(sys, 'real_prefix') else '--user')") 3 | 4 | .PHONY: default 5 | default: dev 6 | 7 | .PHONY: install 8 | install: 9 | python setup.py install 10 | 11 | .PHONY: ops 12 | ops: 13 | mkdir -p build && cd build && cmake .. && make -j$(shell nproc) 14 | 15 | .PHONY: dev 16 | dev: 17 | python setup.py develop $(DEV_USER_FLAG) 18 | 19 | .PHONY: clean 20 | clean: 21 | python setup.py develop --uninstall $(DEV_USER_FLAG) 22 | rm -rf build 23 | -------------------------------------------------------------------------------- /test-newC/detectron/.directory: -------------------------------------------------------------------------------- 1 | [Dolphin] 2 | PreviewsShown=true 3 | Timestamp=2019,11,21,15,3,41 4 | Version=3 5 | -------------------------------------------------------------------------------- /test-newC/detectron/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/__init__.py -------------------------------------------------------------------------------- /test-newC/detectron/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/__init__.pyc -------------------------------------------------------------------------------- /test-newC/detectron/core/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/core/__init__.py -------------------------------------------------------------------------------- /test-newC/detectron/core/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/core/__init__.pyc -------------------------------------------------------------------------------- /test-newC/detectron/core/config.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/core/config.pyc -------------------------------------------------------------------------------- /test-newC/detectron/core/rpn_generator.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/core/rpn_generator.pyc -------------------------------------------------------------------------------- /test-newC/detectron/core/test.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/core/test.pyc -------------------------------------------------------------------------------- /test-newC/detectron/core/test_engine.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/core/test_engine.pyc -------------------------------------------------------------------------------- /test-newC/detectron/core/test_retinanet.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/core/test_retinanet.pyc -------------------------------------------------------------------------------- /test-newC/detectron/datasets/.directory: -------------------------------------------------------------------------------- 1 | [Dolphin] 2 | PreviewsShown=true 3 | Timestamp=2019,11,21,15,3,43 4 | Version=3 5 | -------------------------------------------------------------------------------- /test-newC/detectron/datasets/VOCdevkit-matlab-wrapper/get_voc_opts.m: -------------------------------------------------------------------------------- 1 | function VOCopts = get_voc_opts(path) 2 | 3 | tmp = pwd; 4 | cd(path); 5 | try 6 | addpath('VOCcode'); 7 | VOCinit; 8 | catch 9 | rmpath('VOCcode'); 10 | cd(tmp); 11 | error(sprintf('VOCcode directory not found under %s', path)); 12 | end 13 | rmpath('VOCcode'); 14 | cd(tmp); 15 | -------------------------------------------------------------------------------- /test-newC/detectron/datasets/VOCdevkit-matlab-wrapper/voc_eval.m: -------------------------------------------------------------------------------- 1 | function res = voc_eval(path, comp_id, test_set, output_dir) 2 | 3 | VOCopts = get_voc_opts(path); 4 | VOCopts.testset = test_set; 5 | 6 | for i = 1:length(VOCopts.classes) 7 | cls = VOCopts.classes{i}; 8 | res(i) = voc_eval_cls(cls, VOCopts, comp_id, output_dir); 9 | end 10 | 11 | fprintf('\n~~~~~~~~~~~~~~~~~~~~\n'); 12 | fprintf('Results:\n'); 13 | aps = [res(:).ap]'; 14 | fprintf('%.1f\n', aps * 100); 15 | fprintf('%.1f\n', mean(aps) * 100); 16 | fprintf('~~~~~~~~~~~~~~~~~~~~\n'); 17 | 18 | function res = voc_eval_cls(cls, VOCopts, comp_id, output_dir) 19 | 20 | test_set = VOCopts.testset; 21 | year = VOCopts.dataset(4:end); 22 | 23 | addpath(fullfile(VOCopts.datadir, 'VOCcode')); 24 | 25 | res_fn = sprintf(VOCopts.detrespath, comp_id, cls); 26 | 27 | recall = []; 28 | prec = []; 29 | ap = 0; 30 | ap_auc = 0; 31 | 32 | do_eval = (str2num(year) <= 2007) | ~strcmp(test_set, 'test'); 33 | if do_eval 34 | % Bug in VOCevaldet requires that tic has been called first 35 | tic; 36 | [recall, prec, ap] = VOCevaldet(VOCopts, comp_id, cls, true); 37 | ap_auc = xVOCap(recall, prec); 38 | 39 | % force plot limits 40 | ylim([0 1]); 41 | xlim([0 1]); 42 | 43 | print(gcf, '-djpeg', '-r0', ... 44 | [output_dir '/' cls '_pr.jpg']); 45 | end 46 | fprintf('!!! %s : %.4f %.4f\n', cls, ap, ap_auc); 47 | 48 | res.recall = recall; 49 | res.prec = prec; 50 | res.ap = ap; 51 | res.ap_auc = ap_auc; 52 | 53 | save([output_dir '/' cls '_pr.mat'], ... 54 | 'res', 'recall', 'prec', 'ap', 'ap_auc'); 55 | 56 | rmpath(fullfile(VOCopts.datadir, 'VOCcode')); 57 | -------------------------------------------------------------------------------- /test-newC/detectron/datasets/VOCdevkit-matlab-wrapper/xVOCap.m: -------------------------------------------------------------------------------- 1 | function ap = xVOCap(rec,prec) 2 | % From the PASCAL VOC 2011 devkit 3 | 4 | mrec=[0 ; rec ; 1]; 5 | mpre=[0 ; prec ; 0]; 6 | for i=numel(mpre)-1:-1:1 7 | mpre(i)=max(mpre(i),mpre(i+1)); 8 | end 9 | i=find(mrec(2:end)~=mrec(1:end-1))+1; 10 | ap=sum((mrec(i)-mrec(i-1)).*mpre(i)); 11 | -------------------------------------------------------------------------------- /test-newC/detectron/datasets/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/datasets/__init__.py -------------------------------------------------------------------------------- /test-newC/detectron/datasets/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/datasets/__init__.pyc -------------------------------------------------------------------------------- /test-newC/detectron/datasets/cityscapes_json_dataset_evaluator.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/datasets/cityscapes_json_dataset_evaluator.pyc -------------------------------------------------------------------------------- /test-newC/detectron/datasets/data/.directory: -------------------------------------------------------------------------------- 1 | [Dolphin] 2 | PreviewsShown=true 3 | Timestamp=2019,10,17,10,30,27 4 | Version=3 5 | -------------------------------------------------------------------------------- /test-newC/detectron/datasets/dataset_catalog.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/datasets/dataset_catalog.pyc -------------------------------------------------------------------------------- /test-newC/detectron/datasets/dummy_datasets.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/datasets/dummy_datasets.pyc -------------------------------------------------------------------------------- /test-newC/detectron/datasets/json_dataset.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/datasets/json_dataset.pyc -------------------------------------------------------------------------------- /test-newC/detectron/datasets/json_dataset_evaluator.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/datasets/json_dataset_evaluator.pyc -------------------------------------------------------------------------------- /test-newC/detectron/datasets/roidb.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/datasets/roidb.pyc -------------------------------------------------------------------------------- /test-newC/detectron/datasets/task_evaluation.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/datasets/task_evaluation.pyc -------------------------------------------------------------------------------- /test-newC/detectron/datasets/voc_dataset_evaluator.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/datasets/voc_dataset_evaluator.pyc -------------------------------------------------------------------------------- /test-newC/detectron/datasets/voc_eval.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/datasets/voc_eval.pyc -------------------------------------------------------------------------------- /test-newC/detectron/modeling/FPN.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/modeling/FPN.pyc -------------------------------------------------------------------------------- /test-newC/detectron/modeling/ResNet.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/modeling/ResNet.pyc -------------------------------------------------------------------------------- /test-newC/detectron/modeling/VGG16.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/modeling/VGG16.pyc -------------------------------------------------------------------------------- /test-newC/detectron/modeling/VGG_CNN_M_1024.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/modeling/VGG_CNN_M_1024.pyc -------------------------------------------------------------------------------- /test-newC/detectron/modeling/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017-present, Facebook, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | ############################################################################## 15 | -------------------------------------------------------------------------------- /test-newC/detectron/modeling/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/modeling/__init__.pyc -------------------------------------------------------------------------------- /test-newC/detectron/modeling/detector.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/modeling/detector.pyc -------------------------------------------------------------------------------- /test-newC/detectron/modeling/fast_rcnn_heads.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/modeling/fast_rcnn_heads.pyc -------------------------------------------------------------------------------- /test-newC/detectron/modeling/generate_anchors.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/modeling/generate_anchors.pyc -------------------------------------------------------------------------------- /test-newC/detectron/modeling/keypoint_rcnn_heads.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/modeling/keypoint_rcnn_heads.pyc -------------------------------------------------------------------------------- /test-newC/detectron/modeling/mask_rcnn_heads.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/modeling/mask_rcnn_heads.pyc -------------------------------------------------------------------------------- /test-newC/detectron/modeling/model_builder.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/modeling/model_builder.pyc -------------------------------------------------------------------------------- /test-newC/detectron/modeling/name_compat.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/modeling/name_compat.pyc -------------------------------------------------------------------------------- /test-newC/detectron/modeling/optimizer.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/modeling/optimizer.pyc -------------------------------------------------------------------------------- /test-newC/detectron/modeling/retinanet_heads.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/modeling/retinanet_heads.pyc -------------------------------------------------------------------------------- /test-newC/detectron/modeling/rfcn_heads.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/modeling/rfcn_heads.pyc -------------------------------------------------------------------------------- /test-newC/detectron/modeling/rpn_heads.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/modeling/rpn_heads.pyc -------------------------------------------------------------------------------- /test-newC/detectron/ops/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/ops/__init__.py -------------------------------------------------------------------------------- /test-newC/detectron/ops/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/ops/__init__.pyc -------------------------------------------------------------------------------- /test-newC/detectron/ops/collect_and_distribute_fpn_rpn_proposals.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/ops/collect_and_distribute_fpn_rpn_proposals.pyc -------------------------------------------------------------------------------- /test-newC/detectron/ops/generate_proposal_labels.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/ops/generate_proposal_labels.pyc -------------------------------------------------------------------------------- /test-newC/detectron/ops/generate_proposals.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/ops/generate_proposals.pyc -------------------------------------------------------------------------------- /test-newC/detectron/ops/mySplitOp.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from __future__ import division 3 | from __future__ import print_function 4 | from __future__ import unicode_literals 5 | 6 | import numpy as np 7 | 8 | from detectron.core.config import cfg 9 | from detectron.datasets import json_dataset 10 | from detectron.datasets import roidb as roidb_utils 11 | import detectron.modeling.FPN as fpn 12 | import detectron.roi_data.fast_rcnn as fast_rcnn_roi_data 13 | import detectron.utils.blob as blob_utils 14 | 15 | import logging 16 | logger = logging.getLogger(__name__) 17 | 18 | class mySplitOp(object): 19 | def __init__(self, train): 20 | self._train = train 21 | 22 | def forward(self, inputs, outputs): 23 | 24 | len0=int(inputs[1].data[0]) 25 | len1=int(inputs[1].data[1]) 26 | 27 | channelsNum=(inputs[0].data.shape)[1] 28 | 29 | print('channelsNum ',channelsNum) 30 | 31 | outputs[0].reshape((len0,channelsNum)) 32 | outputs[1].reshape((len1,channelsNum)) 33 | 34 | outputs[0].data[...]=inputs[0].data[:len0,:] 35 | outputs[1].data[...]=inputs[0].data[len0:,:] 36 | 37 | -------------------------------------------------------------------------------- /test-newC/detectron/ops/mySplitOp.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/ops/mySplitOp.pyc -------------------------------------------------------------------------------- /test-newC/detectron/ops/zero_even_op.cc: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "zero_even_op.h" 18 | 19 | namespace caffe2 { 20 | 21 | template <> 22 | bool ZeroEvenOp::RunOnDevice() { 23 | // Retrieve the input tensor. 24 | const auto& X = Input(0); 25 | CAFFE_ENFORCE(X.dim() == 1); 26 | 27 | // Initialize the output tensor to a copy of the input tensor. 28 | auto* Y = Output(0); 29 | Y->CopyFrom(X); 30 | 31 | // Set output elements at even indices to zero. 32 | auto* Y_data = Y->mutable_data(); 33 | for (auto i = 0; i < Y->numel(); i += 2) { 34 | Y_data[i] = 0.0f; 35 | } 36 | 37 | return true; 38 | } 39 | 40 | REGISTER_CPU_OPERATOR(ZeroEven, ZeroEvenOp); 41 | 42 | OPERATOR_SCHEMA(ZeroEven) 43 | .NumInputs(1) 44 | .NumOutputs(1) 45 | .Input( 46 | 0, 47 | "X", 48 | "1D input tensor") 49 | .Output( 50 | 0, 51 | "Y", 52 | "1D output tensor"); 53 | 54 | } // namespace caffe2 55 | -------------------------------------------------------------------------------- /test-newC/detectron/ops/zero_even_op.cu: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "caffe2/core/context_gpu.h" 18 | 19 | #include "zero_even_op.h" 20 | 21 | namespace caffe2 { 22 | 23 | namespace { 24 | 25 | template 26 | __global__ void SetEvenIndsToVal(size_t num_even_inds, T val, T* data) { 27 | CUDA_1D_KERNEL_LOOP(i, num_even_inds) { 28 | data[i << 1] = val; 29 | } 30 | } 31 | 32 | } // namespace 33 | 34 | template <> 35 | bool ZeroEvenOp::RunOnDevice() { 36 | // Retrieve the input tensor. 37 | const auto& X = Input(0); 38 | CAFFE_ENFORCE(X.ndim() == 1); 39 | 40 | // Initialize the output tensor to a copy of the input tensor. 41 | auto* Y = Output(0); 42 | Y->CopyFrom(X); 43 | 44 | // Set output elements at even indices to zero. 45 | auto output_size = Y->size(); 46 | 47 | if (output_size > 0) { 48 | size_t num_even_inds = output_size / 2 + output_size % 2; 49 | SetEvenIndsToVal 50 | <<>>( 54 | num_even_inds, 55 | 0.0f, 56 | Y->mutable_data()); 57 | } 58 | 59 | return true; 60 | } 61 | 62 | REGISTER_CUDA_OPERATOR(ZeroEven, ZeroEvenOp); 63 | 64 | } // namespace caffe2 65 | -------------------------------------------------------------------------------- /test-newC/detectron/ops/zero_even_op.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ZERO_EVEN_OP_H_ 18 | #define ZERO_EVEN_OP_H_ 19 | 20 | #include "caffe2/core/context.h" 21 | #include "caffe2/core/operator.h" 22 | 23 | namespace caffe2 { 24 | 25 | /** 26 | * ZeroEven operator. Zeros elements at even indices of an 1D array. 27 | * Elements at odd indices are preserved. 28 | * 29 | * This toy operator is an example of a custom operator and may be a useful 30 | * reference for adding new custom operators to the Detectron codebase. 31 | */ 32 | template 33 | class ZeroEvenOp final : public Operator { 34 | public: 35 | // Introduce Operator helper members. 36 | USE_OPERATOR_CONTEXT_FUNCTIONS; 37 | 38 | ZeroEvenOp(const OperatorDef& operator_def, Workspace* ws) 39 | : Operator(operator_def, ws) {} 40 | 41 | bool RunOnDevice() override; 42 | }; 43 | 44 | } // namespace caffe2 45 | 46 | #endif // ZERO_EVEN_OP_H_ 47 | -------------------------------------------------------------------------------- /test-newC/detectron/roi_data/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/roi_data/__init__.py -------------------------------------------------------------------------------- /test-newC/detectron/roi_data/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/roi_data/__init__.pyc -------------------------------------------------------------------------------- /test-newC/detectron/roi_data/data_utils.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/roi_data/data_utils.pyc -------------------------------------------------------------------------------- /test-newC/detectron/roi_data/fast_rcnn.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/roi_data/fast_rcnn.pyc -------------------------------------------------------------------------------- /test-newC/detectron/roi_data/keypoint_rcnn.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/roi_data/keypoint_rcnn.pyc -------------------------------------------------------------------------------- /test-newC/detectron/roi_data/loader.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/roi_data/loader.pyc -------------------------------------------------------------------------------- /test-newC/detectron/roi_data/mask_rcnn.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/roi_data/mask_rcnn.pyc -------------------------------------------------------------------------------- /test-newC/detectron/roi_data/minibatch.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/roi_data/minibatch.pyc -------------------------------------------------------------------------------- /test-newC/detectron/roi_data/retinanet.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/roi_data/retinanet.pyc -------------------------------------------------------------------------------- /test-newC/detectron/roi_data/rpn.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/roi_data/rpn.pyc -------------------------------------------------------------------------------- /test-newC/detectron/utils/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/utils/__init__.py -------------------------------------------------------------------------------- /test-newC/detectron/utils/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/utils/__init__.pyc -------------------------------------------------------------------------------- /test-newC/detectron/utils/blob.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/utils/blob.pyc -------------------------------------------------------------------------------- /test-newC/detectron/utils/boxes.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/utils/boxes.pyc -------------------------------------------------------------------------------- /test-newC/detectron/utils/c2.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/utils/c2.pyc -------------------------------------------------------------------------------- /test-newC/detectron/utils/collections.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/utils/collections.pyc -------------------------------------------------------------------------------- /test-newC/detectron/utils/colormap.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/utils/colormap.pyc -------------------------------------------------------------------------------- /test-newC/detectron/utils/coordinator.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017-present, Facebook, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | ############################################################################## 15 | 16 | """Coordinated access to a shared multithreading/processing queue.""" 17 | 18 | from __future__ import absolute_import 19 | from __future__ import division 20 | from __future__ import print_function 21 | from __future__ import unicode_literals 22 | 23 | import contextlib 24 | import logging 25 | import threading 26 | import traceback 27 | from six.moves import queue as Queue 28 | 29 | log = logging.getLogger(__name__) 30 | 31 | 32 | class Coordinator(object): 33 | 34 | def __init__(self): 35 | self._event = threading.Event() 36 | 37 | def request_stop(self): 38 | log.debug('Coordinator stopping') 39 | self._event.set() 40 | 41 | def should_stop(self): 42 | return self._event.is_set() 43 | 44 | def wait_for_stop(self): 45 | return self._event.wait() 46 | 47 | @contextlib.contextmanager 48 | def stop_on_exception(self): 49 | try: 50 | yield 51 | except Exception: 52 | if not self.should_stop(): 53 | traceback.print_exc() 54 | self.request_stop() 55 | 56 | 57 | def coordinated_get(coordinator, queue): 58 | while not coordinator.should_stop(): 59 | try: 60 | return queue.get(block=True, timeout=1.0) 61 | except Queue.Empty: 62 | continue 63 | raise Exception('Coordinator stopped during get()') 64 | 65 | 66 | def coordinated_put(coordinator, queue, element): 67 | while not coordinator.should_stop(): 68 | try: 69 | queue.put(element, block=True, timeout=1.0) 70 | return 71 | except Queue.Full: 72 | continue 73 | raise Exception('Coordinator stopped during put()') 74 | -------------------------------------------------------------------------------- /test-newC/detectron/utils/coordinator.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/utils/coordinator.pyc -------------------------------------------------------------------------------- /test-newC/detectron/utils/cython_bbox.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/utils/cython_bbox.so -------------------------------------------------------------------------------- /test-newC/detectron/utils/cython_nms.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/utils/cython_nms.so -------------------------------------------------------------------------------- /test-newC/detectron/utils/env.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/utils/env.pyc -------------------------------------------------------------------------------- /test-newC/detectron/utils/image.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017-present, Facebook, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | ############################################################################## 15 | 16 | """Image helper functions.""" 17 | 18 | from __future__ import absolute_import 19 | from __future__ import division 20 | from __future__ import print_function 21 | from __future__ import unicode_literals 22 | 23 | import cv2 24 | import numpy as np 25 | 26 | 27 | def aspect_ratio_rel(im, aspect_ratio): 28 | """Performs width-relative aspect ratio transformation.""" 29 | im_h, im_w = im.shape[:2] 30 | im_ar_w = int(round(aspect_ratio * im_w)) 31 | im_ar = cv2.resize(im, dsize=(im_ar_w, im_h)) 32 | return im_ar 33 | 34 | 35 | def aspect_ratio_abs(im, aspect_ratio): 36 | """Performs absolute aspect ratio transformation.""" 37 | im_h, im_w = im.shape[:2] 38 | im_area = im_h * im_w 39 | 40 | im_ar_w = np.sqrt(im_area * aspect_ratio) 41 | im_ar_h = np.sqrt(im_area / aspect_ratio) 42 | assert np.isclose(im_ar_w / im_ar_h, aspect_ratio) 43 | 44 | im_ar = cv2.resize(im, dsize=(int(im_ar_w), int(im_ar_h))) 45 | return im_ar 46 | -------------------------------------------------------------------------------- /test-newC/detectron/utils/image.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/utils/image.pyc -------------------------------------------------------------------------------- /test-newC/detectron/utils/io.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/utils/io.pyc -------------------------------------------------------------------------------- /test-newC/detectron/utils/keypoints.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/utils/keypoints.pyc -------------------------------------------------------------------------------- /test-newC/detectron/utils/logging.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/utils/logging.pyc -------------------------------------------------------------------------------- /test-newC/detectron/utils/lr_policy.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/utils/lr_policy.pyc -------------------------------------------------------------------------------- /test-newC/detectron/utils/net.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/utils/net.pyc -------------------------------------------------------------------------------- /test-newC/detectron/utils/segms.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/utils/segms.pyc -------------------------------------------------------------------------------- /test-newC/detectron/utils/subprocess.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/utils/subprocess.pyc -------------------------------------------------------------------------------- /test-newC/detectron/utils/timer.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017-present, Facebook, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | ############################################################################## 15 | # 16 | # Based on: 17 | # -------------------------------------------------------- 18 | # Fast R-CNN 19 | # Copyright (c) 2015 Microsoft 20 | # Licensed under The MIT License [see LICENSE for details] 21 | # Written by Ross Girshick 22 | # -------------------------------------------------------- 23 | 24 | """Timing related functions.""" 25 | 26 | from __future__ import absolute_import 27 | from __future__ import division 28 | from __future__ import print_function 29 | from __future__ import unicode_literals 30 | 31 | import time 32 | 33 | 34 | class Timer(object): 35 | """A simple timer.""" 36 | 37 | def __init__(self): 38 | self.reset() 39 | 40 | def tic(self): 41 | # using time.time instead of time.clock because time time.clock 42 | # does not normalize for multithreading 43 | self.start_time = time.time() 44 | 45 | def toc(self, average=True): 46 | self.diff = time.time() - self.start_time 47 | self.total_time += self.diff 48 | self.calls += 1 49 | self.average_time = self.total_time / self.calls 50 | if average: 51 | return self.average_time 52 | else: 53 | return self.diff 54 | 55 | def reset(self): 56 | self.total_time = 0. 57 | self.calls = 0 58 | self.start_time = 0. 59 | self.diff = 0. 60 | self.average_time = 0. 61 | -------------------------------------------------------------------------------- /test-newC/detectron/utils/timer.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/utils/timer.pyc -------------------------------------------------------------------------------- /test-newC/detectron/utils/train.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/utils/train.pyc -------------------------------------------------------------------------------- /test-newC/detectron/utils/training_stats.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/utils/training_stats.pyc -------------------------------------------------------------------------------- /test-newC/detectron/utils/vis.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-newC/detectron/utils/vis.pyc -------------------------------------------------------------------------------- /test-newC/e2e_faster_rcnn_R-50-FPN_2x.yaml: -------------------------------------------------------------------------------- 1 | MODEL: 2 | TYPE: generalized_rcnn 3 | CONV_BODY: FPN.add_fpn_ResNet50_conv5_body 4 | NUM_CLASSES: 11 5 | FASTER_RCNN: True 6 | NUM_GPUS: 1 7 | SOLVER: 8 | WEIGHT_DECAY: 0.0001 9 | LR_POLICY: steps_with_decay 10 | BASE_LR: 0.0025 11 | GAMMA: 0.1 12 | MAX_ITER: 60000 13 | STEPS: [0, 20000, 40000] 14 | FPN: 15 | FPN_ON: True 16 | MULTILEVEL_ROIS: True 17 | MULTILEVEL_RPN: True 18 | # RPN_ASPECT_RATIOS: (1/3, 0.5, 1, 2, 3) # (0.5, 1, 2) Next to (0.25, 0.33, 0.5, 1, 2, 3, 4) 19 | RPN_ANCHOR_START_SIZE: 32 20 | FAST_RCNN: 21 | ROI_BOX_HEAD: fast_rcnn_heads.add_roi_2mlp_head 22 | ROI_XFORM_METHOD: RoIAlign 23 | ROI_XFORM_RESOLUTION: 7 24 | ROI_XFORM_SAMPLING_RATIO: 2 25 | TRAIN: 26 | WEIGHTS: /home/wsh/null/dior/train/coco_2014_train/generalized_rcnn/model_final.pkl 27 | DATASETS: ('coco_2014_train',) 28 | SCALES: (800,) 29 | MAX_SIZE: 1333 30 | BATCH_SIZE_PER_IM: 512 31 | RPN_PRE_NMS_TOP_N: 2000 # Per FPN level 32 | RPN_BATCH_SIZE_PER_IM: 256 # 2000 33 | TEST: 34 | DATASETS: ('coco_2014_val',) 35 | SCALE: 800 36 | MAX_SIZE: 1333 37 | NMS: 0.5 38 | # RPN_PRE_NMS_TOP_N: 1000 # Per FPN level 39 | RPN_PRE_NMS_TOP_N: 2000 # For DOTA 40 | # RPN_POST_NMS_TOP_N: 1000 41 | RPN_POST_NMS_TOP_N: 2000 # For DOTA 42 | DETECTIONS_PER_IM: 1500 #100 43 | OUTPUT_DIR: . 44 | -------------------------------------------------------------------------------- /test-newC/setup.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017-present, Facebook, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | ############################################################################## 15 | 16 | from __future__ import absolute_import 17 | from __future__ import division 18 | from __future__ import print_function 19 | 20 | from Cython.Build import cythonize 21 | from setuptools import Extension 22 | from setuptools import setup 23 | 24 | import numpy as np 25 | 26 | _NP_INCLUDE_DIRS = np.get_include() 27 | 28 | 29 | # Extension modules 30 | ext_modules = [ 31 | Extension( 32 | name='detectron.utils.cython_bbox', 33 | sources=[ 34 | 'detectron/utils/cython_bbox.pyx' 35 | ], 36 | extra_compile_args=[ 37 | '-Wno-cpp' 38 | ], 39 | include_dirs=[ 40 | _NP_INCLUDE_DIRS 41 | ] 42 | ), 43 | Extension( 44 | name='detectron.utils.cython_nms', 45 | sources=[ 46 | 'detectron/utils/cython_nms.pyx' 47 | ], 48 | extra_compile_args=[ 49 | '-Wno-cpp' 50 | ], 51 | include_dirs=[ 52 | _NP_INCLUDE_DIRS 53 | ] 54 | ) 55 | ] 56 | 57 | setup( 58 | name='Detectron', 59 | packages=['detectron'], 60 | ext_modules=cythonize(ext_modules) 61 | ) 62 | -------------------------------------------------------------------------------- /test-newC/tools/convert_selective_search.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright (c) 2017-present, Facebook, Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | ############################################################################## 17 | 18 | """Script to convert Selective Search proposal boxes into the Detectron proposal 19 | file format. 20 | """ 21 | 22 | from __future__ import absolute_import 23 | from __future__ import division 24 | from __future__ import print_function 25 | from __future__ import unicode_literals 26 | 27 | import numpy as np 28 | import scipy.io as sio 29 | import sys 30 | 31 | from detectron.datasets.json_dataset import JsonDataset 32 | from detectron.utils.io import save_object 33 | 34 | 35 | if __name__ == '__main__': 36 | dataset_name = sys.argv[1] 37 | file_in = sys.argv[2] 38 | file_out = sys.argv[3] 39 | 40 | ds = JsonDataset(dataset_name) 41 | roidb = ds.get_roidb() 42 | raw_data = sio.loadmat(file_in)['boxes'].ravel() 43 | assert raw_data.shape[0] == len(roidb) 44 | 45 | boxes = [] 46 | scores = [] 47 | ids = [] 48 | for i in range(raw_data.shape[0]): 49 | if i % 1000 == 0: 50 | print('{}/{}'.format(i + 1, len(roidb))) 51 | # selective search boxes are 1-indexed and (y1, x1, y2, x2) 52 | i_boxes = raw_data[i][:, (1, 0, 3, 2)] - 1 53 | boxes.append(i_boxes.astype(np.float32)) 54 | scores.append(np.zeros((i_boxes.shape[0]), dtype=np.float32)) 55 | ids.append(roidb[i]['id']) 56 | 57 | save_object(dict(boxes=boxes, scores=scores, indexes=ids), file_out) 58 | -------------------------------------------------------------------------------- /test-oldC/Makefile: -------------------------------------------------------------------------------- 1 | # Don't use the --user flag for setup.py develop mode with virtualenv. 2 | DEV_USER_FLAG=$(shell python -c "import sys; print('' if hasattr(sys, 'real_prefix') else '--user')") 3 | 4 | .PHONY: default 5 | default: dev 6 | 7 | .PHONY: install 8 | install: 9 | python setup.py install 10 | 11 | .PHONY: ops 12 | ops: 13 | mkdir -p build && cd build && cmake .. && make -j$(shell nproc) 14 | 15 | .PHONY: dev 16 | dev: 17 | python setup.py develop $(DEV_USER_FLAG) 18 | 19 | .PHONY: clean 20 | clean: 21 | python setup.py develop --uninstall $(DEV_USER_FLAG) 22 | rm -rf build 23 | -------------------------------------------------------------------------------- /test-oldC/detectron/.directory: -------------------------------------------------------------------------------- 1 | [Dolphin] 2 | PreviewsShown=true 3 | Timestamp=2019,11,6,11,16,19 4 | Version=3 5 | -------------------------------------------------------------------------------- /test-oldC/detectron/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/__init__.py -------------------------------------------------------------------------------- /test-oldC/detectron/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/__init__.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/core/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/core/__init__.py -------------------------------------------------------------------------------- /test-oldC/detectron/core/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/core/__init__.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/core/config.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/core/config.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/core/rpn_generator.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/core/rpn_generator.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/core/test.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/core/test.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/core/test_engine.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/core/test_engine.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/core/test_retinanet.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/core/test_retinanet.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/datasets/.directory: -------------------------------------------------------------------------------- 1 | [Dolphin] 2 | PreviewsShown=true 3 | Timestamp=2019,11,6,11,17,14 4 | Version=3 5 | -------------------------------------------------------------------------------- /test-oldC/detectron/datasets/VOCdevkit-matlab-wrapper/get_voc_opts.m: -------------------------------------------------------------------------------- 1 | function VOCopts = get_voc_opts(path) 2 | 3 | tmp = pwd; 4 | cd(path); 5 | try 6 | addpath('VOCcode'); 7 | VOCinit; 8 | catch 9 | rmpath('VOCcode'); 10 | cd(tmp); 11 | error(sprintf('VOCcode directory not found under %s', path)); 12 | end 13 | rmpath('VOCcode'); 14 | cd(tmp); 15 | -------------------------------------------------------------------------------- /test-oldC/detectron/datasets/VOCdevkit-matlab-wrapper/voc_eval.m: -------------------------------------------------------------------------------- 1 | function res = voc_eval(path, comp_id, test_set, output_dir) 2 | 3 | VOCopts = get_voc_opts(path); 4 | VOCopts.testset = test_set; 5 | 6 | for i = 1:length(VOCopts.classes) 7 | cls = VOCopts.classes{i}; 8 | res(i) = voc_eval_cls(cls, VOCopts, comp_id, output_dir); 9 | end 10 | 11 | fprintf('\n~~~~~~~~~~~~~~~~~~~~\n'); 12 | fprintf('Results:\n'); 13 | aps = [res(:).ap]'; 14 | fprintf('%.1f\n', aps * 100); 15 | fprintf('%.1f\n', mean(aps) * 100); 16 | fprintf('~~~~~~~~~~~~~~~~~~~~\n'); 17 | 18 | function res = voc_eval_cls(cls, VOCopts, comp_id, output_dir) 19 | 20 | test_set = VOCopts.testset; 21 | year = VOCopts.dataset(4:end); 22 | 23 | addpath(fullfile(VOCopts.datadir, 'VOCcode')); 24 | 25 | res_fn = sprintf(VOCopts.detrespath, comp_id, cls); 26 | 27 | recall = []; 28 | prec = []; 29 | ap = 0; 30 | ap_auc = 0; 31 | 32 | do_eval = (str2num(year) <= 2007) | ~strcmp(test_set, 'test'); 33 | if do_eval 34 | % Bug in VOCevaldet requires that tic has been called first 35 | tic; 36 | [recall, prec, ap] = VOCevaldet(VOCopts, comp_id, cls, true); 37 | ap_auc = xVOCap(recall, prec); 38 | 39 | % force plot limits 40 | ylim([0 1]); 41 | xlim([0 1]); 42 | 43 | print(gcf, '-djpeg', '-r0', ... 44 | [output_dir '/' cls '_pr.jpg']); 45 | end 46 | fprintf('!!! %s : %.4f %.4f\n', cls, ap, ap_auc); 47 | 48 | res.recall = recall; 49 | res.prec = prec; 50 | res.ap = ap; 51 | res.ap_auc = ap_auc; 52 | 53 | save([output_dir '/' cls '_pr.mat'], ... 54 | 'res', 'recall', 'prec', 'ap', 'ap_auc'); 55 | 56 | rmpath(fullfile(VOCopts.datadir, 'VOCcode')); 57 | -------------------------------------------------------------------------------- /test-oldC/detectron/datasets/VOCdevkit-matlab-wrapper/xVOCap.m: -------------------------------------------------------------------------------- 1 | function ap = xVOCap(rec,prec) 2 | % From the PASCAL VOC 2011 devkit 3 | 4 | mrec=[0 ; rec ; 1]; 5 | mpre=[0 ; prec ; 0]; 6 | for i=numel(mpre)-1:-1:1 7 | mpre(i)=max(mpre(i),mpre(i+1)); 8 | end 9 | i=find(mrec(2:end)~=mrec(1:end-1))+1; 10 | ap=sum((mrec(i)-mrec(i-1)).*mpre(i)); 11 | -------------------------------------------------------------------------------- /test-oldC/detectron/datasets/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/datasets/__init__.py -------------------------------------------------------------------------------- /test-oldC/detectron/datasets/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/datasets/__init__.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/datasets/cityscapes_json_dataset_evaluator.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/datasets/cityscapes_json_dataset_evaluator.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/datasets/data/.directory: -------------------------------------------------------------------------------- 1 | [Dolphin] 2 | PreviewsShown=true 3 | Timestamp=2019,11,6,11,17,17 4 | Version=3 5 | -------------------------------------------------------------------------------- /test-oldC/detectron/datasets/dataset_catalog.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/datasets/dataset_catalog.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/datasets/dummy_datasets.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/datasets/dummy_datasets.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/datasets/json_dataset.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/datasets/json_dataset.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/datasets/json_dataset_evaluator.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/datasets/json_dataset_evaluator.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/datasets/roidb.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/datasets/roidb.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/datasets/task_evaluation.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/datasets/task_evaluation.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/datasets/voc_dataset_evaluator.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/datasets/voc_dataset_evaluator.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/datasets/voc_eval.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/datasets/voc_eval.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/modeling/FPN.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/modeling/FPN.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/modeling/ResNet.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/modeling/ResNet.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/modeling/VGG16.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/modeling/VGG16.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/modeling/VGG_CNN_M_1024.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/modeling/VGG_CNN_M_1024.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/modeling/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017-present, Facebook, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | ############################################################################## 15 | -------------------------------------------------------------------------------- /test-oldC/detectron/modeling/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/modeling/__init__.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/modeling/detector.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/modeling/detector.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/modeling/fast_rcnn_heads.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/modeling/fast_rcnn_heads.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/modeling/generate_anchors.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/modeling/generate_anchors.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/modeling/keypoint_rcnn_heads.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/modeling/keypoint_rcnn_heads.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/modeling/mask_rcnn_heads.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/modeling/mask_rcnn_heads.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/modeling/model_builder.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/modeling/model_builder.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/modeling/name_compat.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/modeling/name_compat.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/modeling/optimizer.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/modeling/optimizer.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/modeling/retinanet_heads.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/modeling/retinanet_heads.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/modeling/rfcn_heads.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/modeling/rfcn_heads.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/modeling/rpn_heads.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/modeling/rpn_heads.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/ops/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/ops/__init__.py -------------------------------------------------------------------------------- /test-oldC/detectron/ops/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/ops/__init__.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/ops/collect_and_distribute_fpn_rpn_proposals.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/ops/collect_and_distribute_fpn_rpn_proposals.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/ops/generate_proposal_labels.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/ops/generate_proposal_labels.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/ops/generate_proposals.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/ops/generate_proposals.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/ops/mySplitOp.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from __future__ import division 3 | from __future__ import print_function 4 | from __future__ import unicode_literals 5 | 6 | import numpy as np 7 | 8 | from detectron.core.config import cfg 9 | from detectron.datasets import json_dataset 10 | from detectron.datasets import roidb as roidb_utils 11 | import detectron.modeling.FPN as fpn 12 | import detectron.roi_data.fast_rcnn as fast_rcnn_roi_data 13 | import detectron.utils.blob as blob_utils 14 | 15 | import logging 16 | logger = logging.getLogger(__name__) 17 | 18 | class mySplitOp(object): 19 | def __init__(self, train): 20 | self._train = train 21 | 22 | def forward(self, inputs, outputs): 23 | 24 | len0=int(inputs[1].data[0]) 25 | len1=int(inputs[1].data[1]) 26 | 27 | channelsNum=(inputs[0].data.shape)[1] 28 | 29 | print('channelsNum ',channelsNum) 30 | 31 | outputs[0].reshape((len0,channelsNum)) 32 | outputs[1].reshape((len1,channelsNum)) 33 | 34 | outputs[0].data[...]=inputs[0].data[:len0,:] 35 | outputs[1].data[...]=inputs[0].data[len0:,:] 36 | 37 | -------------------------------------------------------------------------------- /test-oldC/detectron/ops/mySplitOp.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/ops/mySplitOp.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/ops/zero_even_op.cc: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "zero_even_op.h" 18 | 19 | namespace caffe2 { 20 | 21 | template <> 22 | bool ZeroEvenOp::RunOnDevice() { 23 | // Retrieve the input tensor. 24 | const auto& X = Input(0); 25 | CAFFE_ENFORCE(X.dim() == 1); 26 | 27 | // Initialize the output tensor to a copy of the input tensor. 28 | auto* Y = Output(0); 29 | Y->CopyFrom(X); 30 | 31 | // Set output elements at even indices to zero. 32 | auto* Y_data = Y->mutable_data(); 33 | for (auto i = 0; i < Y->numel(); i += 2) { 34 | Y_data[i] = 0.0f; 35 | } 36 | 37 | return true; 38 | } 39 | 40 | REGISTER_CPU_OPERATOR(ZeroEven, ZeroEvenOp); 41 | 42 | OPERATOR_SCHEMA(ZeroEven) 43 | .NumInputs(1) 44 | .NumOutputs(1) 45 | .Input( 46 | 0, 47 | "X", 48 | "1D input tensor") 49 | .Output( 50 | 0, 51 | "Y", 52 | "1D output tensor"); 53 | 54 | } // namespace caffe2 55 | -------------------------------------------------------------------------------- /test-oldC/detectron/ops/zero_even_op.cu: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "caffe2/core/context_gpu.h" 18 | 19 | #include "zero_even_op.h" 20 | 21 | namespace caffe2 { 22 | 23 | namespace { 24 | 25 | template 26 | __global__ void SetEvenIndsToVal(size_t num_even_inds, T val, T* data) { 27 | CUDA_1D_KERNEL_LOOP(i, num_even_inds) { 28 | data[i << 1] = val; 29 | } 30 | } 31 | 32 | } // namespace 33 | 34 | template <> 35 | bool ZeroEvenOp::RunOnDevice() { 36 | // Retrieve the input tensor. 37 | const auto& X = Input(0); 38 | CAFFE_ENFORCE(X.ndim() == 1); 39 | 40 | // Initialize the output tensor to a copy of the input tensor. 41 | auto* Y = Output(0); 42 | Y->CopyFrom(X); 43 | 44 | // Set output elements at even indices to zero. 45 | auto output_size = Y->size(); 46 | 47 | if (output_size > 0) { 48 | size_t num_even_inds = output_size / 2 + output_size % 2; 49 | SetEvenIndsToVal 50 | <<>>( 54 | num_even_inds, 55 | 0.0f, 56 | Y->mutable_data()); 57 | } 58 | 59 | return true; 60 | } 61 | 62 | REGISTER_CUDA_OPERATOR(ZeroEven, ZeroEvenOp); 63 | 64 | } // namespace caffe2 65 | -------------------------------------------------------------------------------- /test-oldC/detectron/ops/zero_even_op.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ZERO_EVEN_OP_H_ 18 | #define ZERO_EVEN_OP_H_ 19 | 20 | #include "caffe2/core/context.h" 21 | #include "caffe2/core/operator.h" 22 | 23 | namespace caffe2 { 24 | 25 | /** 26 | * ZeroEven operator. Zeros elements at even indices of an 1D array. 27 | * Elements at odd indices are preserved. 28 | * 29 | * This toy operator is an example of a custom operator and may be a useful 30 | * reference for adding new custom operators to the Detectron codebase. 31 | */ 32 | template 33 | class ZeroEvenOp final : public Operator { 34 | public: 35 | // Introduce Operator helper members. 36 | USE_OPERATOR_CONTEXT_FUNCTIONS; 37 | 38 | ZeroEvenOp(const OperatorDef& operator_def, Workspace* ws) 39 | : Operator(operator_def, ws) {} 40 | 41 | bool RunOnDevice() override; 42 | }; 43 | 44 | } // namespace caffe2 45 | 46 | #endif // ZERO_EVEN_OP_H_ 47 | -------------------------------------------------------------------------------- /test-oldC/detectron/roi_data/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/roi_data/__init__.py -------------------------------------------------------------------------------- /test-oldC/detectron/roi_data/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/roi_data/__init__.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/roi_data/data_utils.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/roi_data/data_utils.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/roi_data/fast_rcnn.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/roi_data/fast_rcnn.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/roi_data/keypoint_rcnn.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/roi_data/keypoint_rcnn.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/roi_data/loader.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/roi_data/loader.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/roi_data/mask_rcnn.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/roi_data/mask_rcnn.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/roi_data/minibatch.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/roi_data/minibatch.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/roi_data/retinanet.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/roi_data/retinanet.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/roi_data/rpn.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/roi_data/rpn.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/utils/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/utils/__init__.py -------------------------------------------------------------------------------- /test-oldC/detectron/utils/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/utils/__init__.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/utils/blob.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/utils/blob.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/utils/boxes.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/utils/boxes.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/utils/c2.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/utils/c2.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/utils/collections.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/utils/collections.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/utils/colormap.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/utils/colormap.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/utils/coordinator.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017-present, Facebook, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | ############################################################################## 15 | 16 | """Coordinated access to a shared multithreading/processing queue.""" 17 | 18 | from __future__ import absolute_import 19 | from __future__ import division 20 | from __future__ import print_function 21 | from __future__ import unicode_literals 22 | 23 | import contextlib 24 | import logging 25 | import threading 26 | import traceback 27 | from six.moves import queue as Queue 28 | 29 | log = logging.getLogger(__name__) 30 | 31 | 32 | class Coordinator(object): 33 | 34 | def __init__(self): 35 | self._event = threading.Event() 36 | 37 | def request_stop(self): 38 | log.debug('Coordinator stopping') 39 | self._event.set() 40 | 41 | def should_stop(self): 42 | return self._event.is_set() 43 | 44 | def wait_for_stop(self): 45 | return self._event.wait() 46 | 47 | @contextlib.contextmanager 48 | def stop_on_exception(self): 49 | try: 50 | yield 51 | except Exception: 52 | if not self.should_stop(): 53 | traceback.print_exc() 54 | self.request_stop() 55 | 56 | 57 | def coordinated_get(coordinator, queue): 58 | while not coordinator.should_stop(): 59 | try: 60 | return queue.get(block=True, timeout=1.0) 61 | except Queue.Empty: 62 | continue 63 | raise Exception('Coordinator stopped during get()') 64 | 65 | 66 | def coordinated_put(coordinator, queue, element): 67 | while not coordinator.should_stop(): 68 | try: 69 | queue.put(element, block=True, timeout=1.0) 70 | return 71 | except Queue.Full: 72 | continue 73 | raise Exception('Coordinator stopped during put()') 74 | -------------------------------------------------------------------------------- /test-oldC/detectron/utils/coordinator.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/utils/coordinator.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/utils/cython_bbox.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/utils/cython_bbox.so -------------------------------------------------------------------------------- /test-oldC/detectron/utils/cython_nms.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/utils/cython_nms.so -------------------------------------------------------------------------------- /test-oldC/detectron/utils/env.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/utils/env.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/utils/image.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017-present, Facebook, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | ############################################################################## 15 | 16 | """Image helper functions.""" 17 | 18 | from __future__ import absolute_import 19 | from __future__ import division 20 | from __future__ import print_function 21 | from __future__ import unicode_literals 22 | 23 | import cv2 24 | import numpy as np 25 | 26 | 27 | def aspect_ratio_rel(im, aspect_ratio): 28 | """Performs width-relative aspect ratio transformation.""" 29 | im_h, im_w = im.shape[:2] 30 | im_ar_w = int(round(aspect_ratio * im_w)) 31 | im_ar = cv2.resize(im, dsize=(im_ar_w, im_h)) 32 | return im_ar 33 | 34 | 35 | def aspect_ratio_abs(im, aspect_ratio): 36 | """Performs absolute aspect ratio transformation.""" 37 | im_h, im_w = im.shape[:2] 38 | im_area = im_h * im_w 39 | 40 | im_ar_w = np.sqrt(im_area * aspect_ratio) 41 | im_ar_h = np.sqrt(im_area / aspect_ratio) 42 | assert np.isclose(im_ar_w / im_ar_h, aspect_ratio) 43 | 44 | im_ar = cv2.resize(im, dsize=(int(im_ar_w), int(im_ar_h))) 45 | return im_ar 46 | -------------------------------------------------------------------------------- /test-oldC/detectron/utils/image.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/utils/image.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/utils/io.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/utils/io.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/utils/keypoints.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/utils/keypoints.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/utils/logging.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/utils/logging.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/utils/lr_policy.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/utils/lr_policy.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/utils/net.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/utils/net.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/utils/segms.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/utils/segms.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/utils/subprocess.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/utils/subprocess.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/utils/timer.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017-present, Facebook, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | ############################################################################## 15 | # 16 | # Based on: 17 | # -------------------------------------------------------- 18 | # Fast R-CNN 19 | # Copyright (c) 2015 Microsoft 20 | # Licensed under The MIT License [see LICENSE for details] 21 | # Written by Ross Girshick 22 | # -------------------------------------------------------- 23 | 24 | """Timing related functions.""" 25 | 26 | from __future__ import absolute_import 27 | from __future__ import division 28 | from __future__ import print_function 29 | from __future__ import unicode_literals 30 | 31 | import time 32 | 33 | 34 | class Timer(object): 35 | """A simple timer.""" 36 | 37 | def __init__(self): 38 | self.reset() 39 | 40 | def tic(self): 41 | # using time.time instead of time.clock because time time.clock 42 | # does not normalize for multithreading 43 | self.start_time = time.time() 44 | 45 | def toc(self, average=True): 46 | self.diff = time.time() - self.start_time 47 | self.total_time += self.diff 48 | self.calls += 1 49 | self.average_time = self.total_time / self.calls 50 | if average: 51 | return self.average_time 52 | else: 53 | return self.diff 54 | 55 | def reset(self): 56 | self.total_time = 0. 57 | self.calls = 0 58 | self.start_time = 0. 59 | self.diff = 0. 60 | self.average_time = 0. 61 | -------------------------------------------------------------------------------- /test-oldC/detectron/utils/timer.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/utils/timer.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/utils/train.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/utils/train.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/utils/training_stats.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/utils/training_stats.pyc -------------------------------------------------------------------------------- /test-oldC/detectron/utils/vis.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhonhel/Incremental-Object-Detection-with-Feature-Pyramid-Network-and-Knowledge-Distillation/4d6a5936810771b434acc4cd7bb86d54d62d0fbd/test-oldC/detectron/utils/vis.pyc -------------------------------------------------------------------------------- /test-oldC/e2e_faster_rcnn_R-50-FPN_2x.yaml: -------------------------------------------------------------------------------- 1 | MODEL: 2 | TYPE: generalized_rcnn 3 | CONV_BODY: FPN.add_fpn_ResNet50_conv5_body 4 | NUM_CLASSES: 11 5 | FASTER_RCNN: True 6 | NUM_GPUS: 1 7 | SOLVER: 8 | WEIGHT_DECAY: 0.0001 9 | LR_POLICY: steps_with_decay 10 | BASE_LR: 0.0025 11 | GAMMA: 0.1 12 | MAX_ITER: 60000 13 | STEPS: [0, 20000, 40000] 14 | FPN: 15 | FPN_ON: True 16 | MULTILEVEL_ROIS: True 17 | MULTILEVEL_RPN: True 18 | # RPN_ASPECT_RATIOS: (1/3, 0.5, 1, 2, 3) # (0.5, 1, 2) Next to (0.25, 0.33, 0.5, 1, 2, 3, 4) 19 | RPN_ANCHOR_START_SIZE: 32 20 | FAST_RCNN: 21 | ROI_BOX_HEAD: fast_rcnn_heads.add_roi_2mlp_head 22 | ROI_XFORM_METHOD: RoIAlign 23 | ROI_XFORM_RESOLUTION: 7 24 | ROI_XFORM_SAMPLING_RATIO: 2 25 | TRAIN: 26 | WEIGHTS: /home/wsh/null/dior/train/coco_2014_train/generalized_rcnn/model_final.pkl 27 | DATASETS: ('coco_2014_train',) 28 | SCALES: (800,) 29 | MAX_SIZE: 1333 30 | BATCH_SIZE_PER_IM: 512 31 | RPN_PRE_NMS_TOP_N: 2000 # Per FPN level 32 | RPN_BATCH_SIZE_PER_IM: 256 # 2000 33 | TEST: 34 | DATASETS: ('coco_2014_val',) 35 | SCALE: 800 36 | MAX_SIZE: 1333 37 | NMS: 0.5 38 | # RPN_PRE_NMS_TOP_N: 1000 # Per FPN level 39 | RPN_PRE_NMS_TOP_N: 2000 # For DOTA 40 | # RPN_POST_NMS_TOP_N: 1000 41 | RPN_POST_NMS_TOP_N: 2000 # For DOTA 42 | DETECTIONS_PER_IM: 1500 #100 43 | OUTPUT_DIR: . 44 | -------------------------------------------------------------------------------- /test-oldC/setup.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017-present, Facebook, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | ############################################################################## 15 | 16 | from __future__ import absolute_import 17 | from __future__ import division 18 | from __future__ import print_function 19 | 20 | from Cython.Build import cythonize 21 | from setuptools import Extension 22 | from setuptools import setup 23 | 24 | import numpy as np 25 | 26 | _NP_INCLUDE_DIRS = np.get_include() 27 | 28 | 29 | # Extension modules 30 | ext_modules = [ 31 | Extension( 32 | name='detectron.utils.cython_bbox', 33 | sources=[ 34 | 'detectron/utils/cython_bbox.pyx' 35 | ], 36 | extra_compile_args=[ 37 | '-Wno-cpp' 38 | ], 39 | include_dirs=[ 40 | _NP_INCLUDE_DIRS 41 | ] 42 | ), 43 | Extension( 44 | name='detectron.utils.cython_nms', 45 | sources=[ 46 | 'detectron/utils/cython_nms.pyx' 47 | ], 48 | extra_compile_args=[ 49 | '-Wno-cpp' 50 | ], 51 | include_dirs=[ 52 | _NP_INCLUDE_DIRS 53 | ] 54 | ) 55 | ] 56 | 57 | setup( 58 | name='Detectron', 59 | packages=['detectron'], 60 | ext_modules=cythonize(ext_modules) 61 | ) 62 | -------------------------------------------------------------------------------- /test-oldC/tools/convert_selective_search.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright (c) 2017-present, Facebook, Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | ############################################################################## 17 | 18 | """Script to convert Selective Search proposal boxes into the Detectron proposal 19 | file format. 20 | """ 21 | 22 | from __future__ import absolute_import 23 | from __future__ import division 24 | from __future__ import print_function 25 | from __future__ import unicode_literals 26 | 27 | import numpy as np 28 | import scipy.io as sio 29 | import sys 30 | 31 | from detectron.datasets.json_dataset import JsonDataset 32 | from detectron.utils.io import save_object 33 | 34 | 35 | if __name__ == '__main__': 36 | dataset_name = sys.argv[1] 37 | file_in = sys.argv[2] 38 | file_out = sys.argv[3] 39 | 40 | ds = JsonDataset(dataset_name) 41 | roidb = ds.get_roidb() 42 | raw_data = sio.loadmat(file_in)['boxes'].ravel() 43 | assert raw_data.shape[0] == len(roidb) 44 | 45 | boxes = [] 46 | scores = [] 47 | ids = [] 48 | for i in range(raw_data.shape[0]): 49 | if i % 1000 == 0: 50 | print('{}/{}'.format(i + 1, len(roidb))) 51 | # selective search boxes are 1-indexed and (y1, x1, y2, x2) 52 | i_boxes = raw_data[i][:, (1, 0, 3, 2)] - 1 53 | boxes.append(i_boxes.astype(np.float32)) 54 | scores.append(np.zeros((i_boxes.shape[0]), dtype=np.float32)) 55 | ids.append(roidb[i]['id']) 56 | 57 | save_object(dict(boxes=boxes, scores=scores, indexes=ids), file_out) 58 | --------------------------------------------------------------------------------