repo
stringlengths
1
99
file
stringlengths
13
215
code
stringlengths
12
59.2M
file_length
int64
12
59.2M
avg_line_length
float64
3.82
1.48M
max_line_length
int64
12
2.51M
extension_type
stringclasses
1 value
D2Det
D2Det-master/configs/empirical_attention/faster_rcnn_r50_fpn_attention_0010_1x.py
# model settings model = dict( type='FasterRCNN', pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch', gen_attention=dict( spatial_range=-1, n...
5,576
29.983333
79
py
D2Det
D2Det-master/configs/empirical_attention/faster_rcnn_r50_fpn_attention_0010_dcn_1x.py
# model settings model = dict( type='FasterRCNN', pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch', gen_attention=dict( spatial_range=-1, n...
5,707
30.362637
79
py
D2Det
D2Det-master/configs/D2Det/D2Det_detection_r101_fpn_2x.py
# model settings model = dict( type='D2Det', pretrained='torchvision://resnet101', backbone=dict( type='ResNet', depth=101, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch'), neck=dict( type='FPN', in_channels=[256, ...
5,684
28.609375
77
py
D2Det
D2Det-master/configs/D2Det/D2Det_instance_r101_fpn_2x.py
# model settings model = dict( type='D2Det', pretrained='torchvision://resnet101', backbone=dict( type='ResNet', depth=101, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch'), neck=dict( type='FPN', in_channels=[256, ...
5,731
28.699482
77
py
D2Det
D2Det-master/configs/D2Det/D2Det_detection_r101_fpn_dcn_2x.py
# model settings model = dict( type='D2Det', pretrained='torchvision://resnet101', backbone=dict( type='ResNet', depth=101, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch', dcn=dict(type='DCNv2', deformable_groups=1, fallback_o...
5,817
28.989691
78
py
D2Det
D2Det-master/configs/D2Det/D2Det_detection_r50_fpn_2x.py
# model settings model = dict( type='D2Det', pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch'), neck=dict( type='FPN', in_channels=[256, 51...
5,681
28.59375
77
py
D2Det
D2Det-master/configs/foveabox/fovea_align_gn_r101_fpn_4gpu_2x.py
# model settings model = dict( type='FOVEA', pretrained='torchvision://resnet101', backbone=dict( type='ResNet', depth=101, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch'), neck=dict( type='FPN', in_channels=[256, ...
3,678
29.404959
78
py
D2Det
D2Det-master/configs/foveabox/fovea_align_gn_r50_fpn_4gpu_2x.py
# model settings model = dict( type='FOVEA', pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch'), neck=dict( type='FPN', in_channels=[256, 51...
3,675
29.380165
78
py
D2Det
D2Det-master/configs/foveabox/fovea_align_gn_ms_r101_fpn_4gpu_2x.py
# model settings model = dict( type='FOVEA', pretrained='torchvision://resnet101', backbone=dict( type='ResNet', depth=101, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch'), neck=dict( type='FPN', in_channels=[256, ...
3,773
28.952381
78
py
D2Det
D2Det-master/configs/foveabox/fovea_align_gn_ms_r50_fpn_4gpu_2x.py
# model settings model = dict( type='FOVEA', pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch'), neck=dict( type='FPN', in_channels=[256, 51...
3,770
28.928571
78
py
D2Det
D2Det-master/configs/foveabox/fovea_r50_fpn_4gpu_1x.py
# model settings model = dict( type='FOVEA', pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch'), neck=dict( type='FPN', in_channels=[256, 51...
3,616
28.892562
78
py
D2Det
D2Det-master/configs/double_heads/dh_faster_rcnn_r50_fpn_1x.py
# model settings model = dict( type='DoubleHeadRCNN', pretrained='modelzoo://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch'), neck=dict( type='FPN', in_channels=[2...
5,464
29.530726
78
py
D2Det
D2Det-master/configs/wider_face/ssd300_wider_face.py
# model settings input_size = 300 model = dict( type='SingleStageDetector', pretrained='open-mmlab://vgg16_caffe', backbone=dict( type='SSDVGG', input_size=input_size, depth=16, with_last_pool=False, ceil_mode=True, out_indices=(3, 4), out_feature_indi...
3,904
27.713235
79
py
D2Det
D2Det-master/configs/albu_example/mask_rcnn_r50_fpn_1x.py
# model settings model = dict( type='MaskRCNN', pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch'), neck=dict( type='FPN', in_channels=[256,...
7,442
28.891566
78
py
D2Det
D2Det-master/configs/grid_rcnn/grid_rcnn_gn_head_r50_fpn_2x.py
# model settings model = dict( type='GridRCNN', pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch'), neck=dict( type='FPN', in_channels=[256,...
5,630
29.112299
78
py
D2Det
D2Det-master/configs/grid_rcnn/grid_rcnn_gn_head_x101_32x4d_fpn_2x.py
# model settings model = dict( type='GridRCNN', pretrained='open-mmlab://resnext101_32x4d', backbone=dict( type='ResNeXt', depth=101, groups=32, base_width=4, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch'), neck=d...
5,687
29.095238
78
py
D2Det
D2Det-master/configs/libra_rcnn/libra_faster_rcnn_r50_fpn_1x.py
# model settings model = dict( type='FasterRCNN', pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch'), neck=[ dict( type='FPN', ...
5,864
29.231959
78
py
D2Det
D2Det-master/configs/libra_rcnn/libra_faster_rcnn_r101_fpn_1x.py
# model settings model = dict( type='FasterRCNN', pretrained='torchvision://resnet101', backbone=dict( type='ResNet', depth=101, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch'), neck=[ dict( type='FPN', ...
5,867
29.247423
78
py
D2Det
D2Det-master/configs/libra_rcnn/libra_fast_rcnn_r50_fpn_1x.py
# model settings model = dict( type='FastRCNN', pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch'), neck=[ dict( type='FPN', ...
4,903
30.63871
79
py
D2Det
D2Det-master/configs/libra_rcnn/libra_faster_rcnn_x101_64x4d_fpn_1x.py
# model settings model = dict( type='FasterRCNN', pretrained='open-mmlab://resnext101_64x4d', backbone=dict( type='ResNeXt', depth=101, groups=64, base_width=4, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch'), neck...
5,921
29.214286
78
py
D2Det
D2Det-master/configs/libra_rcnn/libra_retinanet_r50_fpn_1x.py
# model settings model = dict( type='RetinaNet', pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch'), neck=[ dict( type='FPN', ...
4,134
27.715278
77
py
D2Det
D2Det-master/configs/free_anchor/retinanet_free_anchor_r50_fpn_1x.py
# model settings model = dict( type='RetinaNet', pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch'), neck=dict( type='FPN', in_channels=[256...
3,729
28.603175
77
py
D2Det
D2Det-master/configs/free_anchor/retinanet_free_anchor_x101-32x4d_fpn_1x.py
# model settings model = dict( type='RetinaNet', pretrained='open-mmlab://resnext101_32x4d', backbone=dict( type='ResNeXt', depth=101, groups=32, base_width=4, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch'), neck=...
3,786
28.585938
77
py
D2Det
D2Det-master/configs/free_anchor/retinanet_free_anchor_r101_fpn_1x.py
# model settings model = dict( type='RetinaNet', pretrained='torchvision://resnet101', backbone=dict( type='ResNet', depth=101, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch'), neck=dict( type='FPN', in_channels=[2...
3,732
28.626984
77
py
D2Det
D2Det-master/configs/scratch/scratch_mask_rcnn_r50_fpn_gn_6x.py
# model settings norm_cfg = dict(type='GN', num_groups=32, requires_grad=True) model = dict( type='MaskRCNN', pretrained=None, backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=-1, style='pytorch', zero_init_...
6,094
29.024631
78
py
D2Det
D2Det-master/configs/scratch/scratch_faster_rcnn_r50_fpn_gn_6x.py
# model settings norm_cfg = dict(type='GN', num_groups=32, requires_grad=True) model = dict( type='FasterRCNN', pretrained=None, backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=-1, style='pytorch', zero_ini...
5,545
28.817204
78
py
D2Det
D2Det-master/configs/pascal_voc/ssd300_voc.py
# model settings input_size = 300 model = dict( type='SingleStageDetector', pretrained='open-mmlab://vgg16_caffe', backbone=dict( type='SSDVGG', input_size=input_size, depth=16, with_last_pool=False, ceil_mode=True, out_indices=(3, 4), out_feature_indi...
4,105
28.539568
79
py
D2Det
D2Det-master/configs/pascal_voc/faster_rcnn_r50_fpn_1x_voc0712.py
# model settings model = dict( type='FasterRCNN', pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch'), neck=dict( type='FPN', in_channels=[25...
5,560
30.418079
78
py
D2Det
D2Det-master/configs/pascal_voc/ssd512_voc.py
# model settings input_size = 512 model = dict( type='SingleStageDetector', pretrained='open-mmlab://vgg16_caffe', backbone=dict( type='SSDVGG', input_size=input_size, depth=16, with_last_pool=False, ceil_mode=True, out_indices=(3, 4), out_feature_indi...
4,124
28.676259
79
py
D2Det
D2Det-master/configs/gcnet/mask_rcnn_r50_fpn_sbn_1x.py
# model settings norm_cfg = dict(type='SyncBN', requires_grad=True) model = dict( type='MaskRCNN', pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch', n...
5,907
29.453608
78
py
D2Det
D2Det-master/configs/gcnet/mask_rcnn_r16_gcb_c3-c5_r50_fpn_1x.py
# model settings model = dict( type='MaskRCNN', pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch', gcb=dict(ratio=1. / 16., ), stage_with_gcb=(F...
5,899
29.729167
78
py
D2Det
D2Det-master/configs/gcnet/mask_rcnn_r4_gcb_c3-c5_r50_fpn_syncbn_1x.py
# model settings norm_cfg = dict(type='SyncBN', requires_grad=True) model = dict( type='MaskRCNN', pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch', g...
6,008
29.658163
78
py
D2Det
D2Det-master/configs/gcnet/mask_rcnn_r4_gcb_c3-c5_r50_fpn_1x.py
# model settings model = dict( type='MaskRCNN', pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch', gcb=dict(ratio=1. / 4., ), stage_with_gcb=(Fa...
5,897
29.71875
78
py
D2Det
D2Det-master/configs/gcnet/mask_rcnn_r16_gcb_c3-c5_r50_fpn_syncbn_1x.py
# model settings norm_cfg = dict(type='SyncBN', requires_grad=True) model = dict( type='MaskRCNN', pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch', g...
6,010
29.668367
78
py
D2Det
D2Det-master/configs/instaboost/ssd300_coco_instaboost_4x.py
# model settings input_size = 300 model = dict( type='SingleStageDetector', pretrained='open-mmlab://vgg16_caffe', backbone=dict( type='SSDVGG', input_size=input_size, depth=16, with_last_pool=False, ceil_mode=True, out_indices=(3, 4), out_feature_indi...
4,276
28.095238
79
py
D2Det
D2Det-master/configs/instaboost/cascade_mask_rcnn_r50_fpn_instaboost_4x.py
# model settings model = dict( type='CascadeRCNN', num_stages=3, pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch'), neck=dict( type='FPN', ...
8,291
30.290566
78
py
D2Det
D2Det-master/configs/instaboost/mask_rcnn_r50_fpn_instaboost_4x.py
# model settings model = dict( type='MaskRCNN', pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch'), neck=dict( type='FPN', in_channels=[256,...
6,086
29.283582
78
py
D2Det
D2Det-master/configs/atss/atss_r50_fpn_1x.py
# model settings model = dict( type='ATSS', pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch'), neck=dict( type='FPN', in_channels=[256, 512...
3,844
28.806202
77
py
D2Det
D2Det-master/configs/gn+ws/mask_rcnn_x101_32x4d_fpn_gn_ws_2x.py
# model settings conv_cfg = dict(type='ConvWS') norm_cfg = dict(type='GN', num_groups=32, requires_grad=True) model = dict( type='MaskRCNN', pretrained='open-mmlab://jhu/resnext101_32x4d_gn_ws', backbone=dict( type='ResNeXt', depth=101, groups=32, base_width=4, num_st...
6,246
29.622549
78
py
D2Det
D2Det-master/configs/gn+ws/mask_rcnn_r50_fpn_gn_ws_2x.py
# model settings conv_cfg = dict(type='ConvWS') norm_cfg = dict(type='GN', num_groups=32, requires_grad=True) model = dict( type='MaskRCNN', pretrained='open-mmlab://jhu/resnet50_gn_ws', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), f...
6,188
29.638614
78
py
D2Det
D2Det-master/configs/gn+ws/mask_rcnn_r50_fpn_gn_ws_20_23_24e.py
# model settings conv_cfg = dict(type='ConvWS') norm_cfg = dict(type='GN', num_groups=32, requires_grad=True) model = dict( type='MaskRCNN', pretrained='open-mmlab://jhu/resnet50_gn_ws', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), f...
6,195
29.673267
78
py
D2Det
D2Det-master/configs/gn+ws/faster_rcnn_r50_fpn_gn_ws_1x.py
# model settings conv_cfg = dict(type='ConvWS') norm_cfg = dict(type='GN', num_groups=32, requires_grad=True) model = dict( type='FasterRCNN', pretrained='open-mmlab://jhu/resnet50_gn_ws', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), ...
5,589
29.546448
78
py
D2Det
D2Det-master/configs/guided_anchoring/ga_rpn_r50_caffe_fpn_1x.py
# model settings model = dict( type='RPN', pretrained='open-mmlab://resnet50_caffe', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=False), norm_eval=True, ...
4,844
29.471698
75
py
D2Det
D2Det-master/configs/guided_anchoring/ga_fast_r50_caffe_fpn_1x.py
# model settings model = dict( type='FastRCNN', pretrained='open-mmlab://resnet50_caffe', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=False), norm_eval=True, ...
4,485
31.507246
78
py
D2Det
D2Det-master/configs/guided_anchoring/ga_rpn_x101_32x4d_fpn_1x.py
# model settings model = dict( type='RPN', pretrained='open-mmlab://resnext101_32x4d', backbone=dict( type='ResNeXt', depth=101, groups=32, base_width=4, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch'), neck=dict( ...
4,815
29.289308
77
py
D2Det
D2Det-master/configs/guided_anchoring/ga_rpn_r101_caffe_rpn_1x.py
# model settings model = dict( type='RPN', pretrained='open-mmlab://resnet101_caffe', backbone=dict( type='ResNet', depth=101, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=False), norm_eval=True, ...
4,847
29.490566
75
py
D2Det
D2Det-master/configs/guided_anchoring/ga_retinanet_r50_caffe_fpn_1x.py
# model settings model = dict( type='RetinaNet', pretrained='open-mmlab://resnet50_caffe', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=False), norm_eval=True, ...
4,679
28.620253
75
py
D2Det
D2Det-master/configs/guided_anchoring/ga_retinanet_x101_32x4d_fpn_1x.py
# model settings model = dict( type='RetinaNet', pretrained='open-mmlab://resnext101_32x4d', backbone=dict( type='ResNeXt', depth=101, groups=32, base_width=4, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch'), neck=...
4,650
28.436709
77
py
D2Det
D2Det-master/configs/guided_anchoring/ga_faster_r50_caffe_fpn_1x.py
# model settings model = dict( type='FasterRCNN', pretrained='open-mmlab://resnet50_caffe', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=False), norm_eval=True, ...
6,178
29.741294
76
py
D2Det
D2Det-master/configs/guided_anchoring/ga_faster_x101_32x4d_fpn_1x.py
# model settings model = dict( type='FasterRCNN', pretrained='open-mmlab://resnext101_32x4d', backbone=dict( type='ResNeXt', depth=101, groups=32, base_width=4, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch'), neck...
6,149
29.597015
77
py
D2Det
D2Det-master/configs/cityscapes/faster_rcnn_r50_fpn_1x_cityscapes.py
# model settings model = dict( type='FasterRCNN', pretrained=None, backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch'), neck=dict( type='FPN', in_channels=[256, 512, 1024, 2048],...
5,883
30.634409
136
py
D2Det
D2Det-master/configs/cityscapes/mask_rcnn_r50_fpn_1x_cityscapes.py
# model settings model = dict( type='MaskRCNN', pretrained=None, backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch'), neck=dict( type='FPN', in_channels=[256, 512, 1024, 2048], ...
6,306
30.535
134
py
D2Det
D2Det-master/configs/gn/mask_rcnn_r101_fpn_gn_2x.py
# model settings norm_cfg = dict(type='GN', num_groups=32, requires_grad=True) model = dict( type='MaskRCNN', pretrained='open-mmlab://detectron/resnet101_gn', backbone=dict( type='ResNet', depth=101, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, s...
6,051
29.565657
78
py
D2Det
D2Det-master/configs/gn/mask_rcnn_r50_fpn_gn_2x.py
# model settings norm_cfg = dict(type='GN', num_groups=32, requires_grad=True) model = dict( type='MaskRCNN', pretrained='open-mmlab://detectron/resnet50_gn', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, sty...
6,048
29.550505
78
py
D2Det
D2Det-master/configs/gn/mask_rcnn_r50_fpn_gn_contrib_2x.py
# model settings norm_cfg = dict(type='GN', num_groups=32, requires_grad=True) model = dict( type='MaskRCNN', pretrained='open-mmlab://contrib/resnet50_gn', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style...
6,056
29.590909
78
py
D2Det
D2Det-master/docs/conf.py
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
2,343
32.014085
79
py
D2Det
D2Det-master/mmdet/apis/inference.py
import warnings import matplotlib.pyplot as plt import mmcv import numpy as np import pycocotools.mask as maskUtils import torch from mmcv.parallel import collate, scatter from mmcv.runner import load_checkpoint from mmdet.core import get_classes from mmdet.datasets.pipelines import Compose from mmdet.models import b...
7,346
33.819905
108
py
D2Det
D2Det-master/mmdet/apis/test.py
import os.path as osp import pickle import shutil import tempfile import mmcv import torch import torch.distributed as dist from mmcv.runner import get_dist_info def single_gpu_test(model, data_loader, show=False): model.eval() results = [] dataset = data_loader.dataset prog_bar = mmcv.ProgressBar(le...
5,100
33.466216
79
py
D2Det
D2Det-master/mmdet/apis/train.py
import random from collections import OrderedDict import numpy as np import torch import torch.distributed as dist from mmcv.parallel import MMDataParallel, MMDistributedDataParallel from mmcv.runner import DistSamplerSeedHook, Runner from mmdet.core import (DistEvalHook, DistOptimizerHook, Fp16OptimizerHook, ...
7,499
31.051282
77
py
D2Det
D2Det-master/mmdet/core/evaluation/eval_hooks.py
import os.path as osp from mmcv.runner import Hook from torch.utils.data import DataLoader class DistEvalHook(Hook): """Distributed evaluation hook. Attributes: dataloader (DataLoader): A PyTorch dataloader. interval (int): Evaluation interval (by epochs). Default: 1. tmpdir (str | N...
1,759
32.846154
77
py
D2Det
D2Det-master/mmdet/core/post_processing/merge_augs.py
import numpy as np import torch from mmdet.ops import nms from ..bbox import bbox_mapping_back def merge_aug_proposals(aug_proposals, img_metas, rpn_test_cfg): """Merge augmented proposals (multiscale, flip, etc.) Args: aug_proposals (list[Tensor]): proposals from different testing schem...
3,573
34.039216
78
py
D2Det
D2Det-master/mmdet/core/post_processing/bbox_nms.py
import torch from mmdet.ops.nms import nms_wrapper def multiclass_nms(multi_bboxes, multi_scores, score_thr, nms_cfg, max_num=-1, score_factors=None): """NMS for multi-class bboxes. Args: multi_bboxes (Ten...
4,693
35.387597
78
py
D2Det
D2Det-master/mmdet/core/mask/mask_target.py
import mmcv import numpy as np import torch from torch.nn.modules.utils import _pair def mask_target(pos_proposals_list, pos_assigned_gt_inds_list, gt_masks_list, cfg): cfg_list = [cfg for _ in range(len(pos_proposals_list))] mask_targets = map(mask_target_single, pos_proposals_list, ...
1,700
39.5
79
py
D2Det
D2Det-master/mmdet/core/fp16/hooks.py
import copy import torch import torch.nn as nn from mmcv.runner import OptimizerHook from ..utils.dist_utils import allreduce_grads from .utils import cast_tensor_type class Fp16OptimizerHook(OptimizerHook): """FP16 optimizer hook. The steps of fp16 optimizer is as follows. 1. Scale the loss value. ...
4,564
34.387597
79
py
D2Det
D2Det-master/mmdet/core/fp16/utils.py
from collections import abc import numpy as np import torch def cast_tensor_type(inputs, src_type, dst_type): if isinstance(inputs, torch.Tensor): return inputs.to(dst_type) elif isinstance(inputs, str): return inputs elif isinstance(inputs, np.ndarray): return inputs elif isi...
664
26.708333
74
py
D2Det
D2Det-master/mmdet/core/fp16/decorators.py
import functools from inspect import getfullargspec import torch from .utils import cast_tensor_type def auto_fp16(apply_to=None, out_fp32=False): """Decorator to enable fp16 training automatically. This decorator is useful when you write custom modules and want to support mixed precision training. If ...
6,211
37.583851
79
py
D2Det
D2Det-master/mmdet/core/bbox/bbox_target.py
import torch from ..utils import multi_apply from .transforms import bbox2delta def bbox_target(pos_bboxes_list, neg_bboxes_list, pos_gt_bboxes_list, pos_gt_labels_list, cfg, reg_classes=1, target_means=[.0, .0, .0, .0], ...
2,717
35.72973
78
py
D2Det
D2Det-master/mmdet/core/bbox/demodata.py
import numpy as np import torch def ensure_rng(rng=None): """ Simple version of the ``kwarray.ensure_rng`` Args: rng (int | numpy.random.RandomState | None): if None, then defaults to the global rng. Otherwise this can be an integer or a RandomState class Returns: ...
1,758
25.651515
101
py
D2Det
D2Det-master/mmdet/core/bbox/geometry.py
import torch def bbox_overlaps(bboxes1, bboxes2, mode='iou', is_aligned=False): """Calculate overlap between two set of bboxes. If ``is_aligned`` is ``False``, then calculate the ious between each bbox of bboxes1 and bboxes2, otherwise the ious between each aligned pair of bboxes1 and bboxes2. A...
3,077
33.58427
79
py
D2Det
D2Det-master/mmdet/core/bbox/transforms.py
import mmcv import numpy as np import torch def bbox2delta(proposals, gt, means=[0, 0, 0, 0], stds=[1, 1, 1, 1]): assert proposals.size() == gt.size() proposals = proposals.float() gt = gt.float() px = (proposals[..., 0] + proposals[..., 2]) * 0.5 py = (proposals[..., 1] + proposals[..., 3]) * 0....
8,734
33.525692
79
py
D2Det
D2Det-master/mmdet/core/bbox/assigners/assign_result.py
import torch from mmdet.utils import util_mixins class AssignResult(util_mixins.NiceRepr): """ Stores assignments between predicted and truth boxes. Attributes: num_gts (int): the number of truth boxes considered when computing this assignment gt_inds (LongTensor): for each ...
7,027
35.414508
79
py
D2Det
D2Det-master/mmdet/core/bbox/assigners/atss_assigner.py
import torch from ..geometry import bbox_overlaps from .assign_result import AssignResult from .base_assigner import BaseAssigner class ATSSAssigner(BaseAssigner): """Assign a corresponding gt bbox or background to each bbox. Each proposals will be assigned with `0` or a positive integer indicating the ...
6,818
41.61875
87
py
D2Det
D2Det-master/mmdet/core/bbox/assigners/point_assigner.py
import torch from .assign_result import AssignResult from .base_assigner import BaseAssigner class PointAssigner(BaseAssigner): """Assign a corresponding gt bbox or background to each point. Each proposals will be assigned with `0`, or a positive integer indicating the ground truth index. - 0: nega...
5,742
42.839695
79
py
D2Det
D2Det-master/mmdet/core/bbox/assigners/approx_max_iou_assigner.py
import torch from ..geometry import bbox_overlaps from .max_iou_assigner import MaxIoUAssigner class ApproxMaxIoUAssigner(MaxIoUAssigner): """Assign a corresponding gt bbox or background to each bbox. Each proposals will be assigned with `-1`, `0`, or a positive integer indicating the ground truth index...
6,111
42.657143
79
py
D2Det
D2Det-master/mmdet/core/bbox/assigners/max_iou_assigner.py
import torch from ..geometry import bbox_overlaps from .assign_result import AssignResult from .base_assigner import BaseAssigner class MaxIoUAssigner(BaseAssigner): """Assign a corresponding gt bbox or background to each bbox. Each proposals will be assigned with `-1`, `0`, or a positive integer indica...
8,572
42.739796
79
py
D2Det
D2Det-master/mmdet/core/bbox/samplers/instance_balanced_pos_sampler.py
import numpy as np import torch from .random_sampler import RandomSampler class InstanceBalancedPosSampler(RandomSampler): def _sample_pos(self, assign_result, num_expected, **kwargs): pos_inds = torch.nonzero(assign_result.gt_inds > 0) if pos_inds.numel() != 0: pos_inds = pos_inds.s...
1,765
41.047619
77
py
D2Det
D2Det-master/mmdet/core/bbox/samplers/base_sampler.py
from abc import ABCMeta, abstractmethod import torch from .sampling_result import SamplingResult class BaseSampler(metaclass=ABCMeta): def __init__(self, num, pos_fraction, neg_pos_ub=-1, add_gt_as_proposals=True, **kwargs): ...
3,760
36.989899
79
py
D2Det
D2Det-master/mmdet/core/bbox/samplers/random_sampler.py
import torch from .base_sampler import BaseSampler class RandomSampler(BaseSampler): def __init__(self, num, pos_fraction, neg_pos_ub=-1, add_gt_as_proposals=True, **kwargs): from mmdet.core.bbox import demodata ...
2,231
33.875
78
py
D2Det
D2Det-master/mmdet/core/bbox/samplers/ohem_sampler.py
import torch from ..transforms import bbox2roi from .base_sampler import BaseSampler class OHEMSampler(BaseSampler): """ Online Hard Example Mining Sampler described in [1]_. References: .. [1] https://arxiv.org/pdf/1604.03540.pdf """ def __init__(self, num, ...
2,912
35.4125
77
py
D2Det
D2Det-master/mmdet/core/bbox/samplers/iou_balanced_neg_sampler.py
import numpy as np import torch from .random_sampler import RandomSampler class IoUBalancedNegSampler(RandomSampler): """IoU Balanced Sampling arXiv: https://arxiv.org/pdf/1904.02701.pdf (CVPR 2019) Sampling proposals according to their IoU. `floor_fraction` of needed RoIs are sampled from proposal...
5,956
42.801471
79
py
D2Det
D2Det-master/mmdet/core/bbox/samplers/sampling_result.py
import torch from mmdet.utils import util_mixins class SamplingResult(util_mixins.NiceRepr): """ Example: >>> # xdoctest: +IGNORE_WANT >>> from mmdet.core.bbox.samplers.sampling_result import * # NOQA >>> self = SamplingResult.random(rng=10) >>> print('self = {}'.format(self)...
5,193
32.509677
81
py
D2Det
D2Det-master/mmdet/core/bbox/samplers/pseudo_sampler.py
import torch from .base_sampler import BaseSampler from .sampling_result import SamplingResult class PseudoSampler(BaseSampler): def __init__(self, **kwargs): pass def _sample_pos(self, **kwargs): raise NotImplementedError def _sample_neg(self, **kwargs): raise NotImplementedEr...
829
29.740741
79
py
D2Det
D2Det-master/mmdet/core/utils/dist_utils.py
from collections import OrderedDict import torch.distributed as dist from mmcv.runner import OptimizerHook from torch._utils import (_flatten_dense_tensors, _take_tensors, _unflatten_dense_tensors) def _allreduce_coalesced(tensors, world_size, bucket_size_mb=-1): if bucket_size_mb > 0: ...
1,856
31.578947
73
py
D2Det
D2Det-master/mmdet/core/optimizer/registry.py
import inspect import torch from mmdet.utils import Registry OPTIMIZERS = Registry('optimizer') def register_torch_optimizers(): torch_optimizers = [] for module_name in dir(torch.optim): if module_name.startswith('__'): continue _optim = getattr(torch.optim, module_name) ...
619
24.833333
73
py
D2Det
D2Det-master/mmdet/core/optimizer/copy_of_sgd.py
from torch.optim import SGD from .registry import OPTIMIZERS @OPTIMIZERS.register_module class CopyOfSGD(SGD): """A clone of torch.optim.SGD. A customized optimizer could be defined like CopyOfSGD. You may derive from built-in optimizers in torch.optim, or directly implement a new optimizer. """...
321
22
59
py
D2Det
D2Det-master/mmdet/core/optimizer/builder.py
import re import torch from mmdet.utils import build_from_cfg from .registry import OPTIMIZERS def build_optimizer(model, optimizer_cfg): """Build optimizer from configs. Args: model (:obj:`nn.Module`): The model with parameters to be optimized. optimizer_cfg (dict): The config dict of the ...
4,565
43.764706
78
py
D2Det
D2Det-master/mmdet/core/anchor/anchor_target.py
import torch from ..bbox import PseudoSampler, assign_and_sample, bbox2delta, build_assigner from ..utils import multi_apply def anchor_target(anchor_list, valid_flag_list, gt_bboxes_list, img_metas, target_means, target_stds, ...
7,369
37.994709
79
py
D2Det
D2Det-master/mmdet/core/anchor/guided_anchor_target.py
import torch from ..bbox import PseudoSampler, build_assigner, build_sampler from ..utils import multi_apply, unmap def calc_region(bbox, ratio, featmap_size=None): """Calculate a proportional bbox region. The bbox center are fixed and the new h' and w' is h * ratio and w * ratio. Args: bbox (T...
11,809
40.006944
79
py
D2Det
D2Det-master/mmdet/core/anchor/point_generator.py
import torch class PointGenerator(object): def _meshgrid(self, x, y, row_major=True): xx = x.repeat(len(y)) yy = y.view(-1, 1).repeat(1, len(x)).view(-1) if row_major: return xx, yy else: return yy, xx def grid_points(self, featmap_size, stride=16, dev...
1,287
35.8
71
py
D2Det
D2Det-master/mmdet/core/anchor/anchor_generator.py
import torch class AnchorGenerator(object): """ Examples: >>> from mmdet.core import AnchorGenerator >>> self = AnchorGenerator(9, [1.], [1.]) >>> all_anchors = self.grid_anchors((2, 2), device='cpu') >>> print(all_anchors) tensor([[ 0., 0., 8., 8.], ...
3,589
35.262626
79
py
D2Det
D2Det-master/mmdet/core/anchor/point_target.py
import torch from ..bbox import PseudoSampler, assign_and_sample, build_assigner from ..utils import multi_apply def point_target(proposals_list, valid_flag_list, gt_bboxes_list, img_metas, cfg, gt_bboxes_ignore_list=None, ...
6,441
37.807229
79
py
D2Det
D2Det-master/mmdet/models/builder.py
from torch import nn from mmdet.utils import build_from_cfg from .registry import (BACKBONES, DETECTORS, HEADS, LOSSES, NECKS, ROI_EXTRACTORS, SHARED_HEADS) def build(cfg, registry, default_args=None): if isinstance(cfg, list): modules = [ build_from_cfg(cfg_, registry,...
959
20.818182
78
py
D2Det
D2Det-master/mmdet/models/detectors/two_stage.py
import torch import torch.nn as nn from mmdet.core import bbox2result, bbox2roi, build_assigner, build_sampler from .. import builder from ..registry import DETECTORS from .base import BaseDetector from .test_mixins import BBoxTestMixin, MaskTestMixin, RPNTestMixin @DETECTORS.register_module class TwoStageDetector(Ba...
13,565
38.208092
79
py
D2Det
D2Det-master/mmdet/models/detectors/base.py
from abc import ABCMeta, abstractmethod import mmcv import numpy as np import pycocotools.mask as maskUtils import torch.nn as nn from mmdet.core import auto_fp16, get_classes, tensor2imgs from mmdet.utils import print_log class BaseDetector(nn.Module, metaclass=ABCMeta): """Base class for detectors""" def...
7,166
35.943299
94
py
D2Det
D2Det-master/mmdet/models/detectors/single_stage.py
import torch.nn as nn from mmdet.core import bbox2result from .. import builder from ..registry import DETECTORS from .base import BaseDetector @DETECTORS.register_module class SingleStageDetector(BaseDetector): """Base class for single-stage detectors. Single-stage detectors directly and densely predict bo...
2,821
31.436782
78
py
D2Det
D2Det-master/mmdet/models/detectors/reppoints_detector.py
import torch from mmdet.core import bbox2result, bbox_mapping_back, multiclass_nms from ..registry import DETECTORS from .single_stage import SingleStageDetector @DETECTORS.register_module class RepPointsDetector(SingleStageDetector): """RepPoints: Point Set Representation for Object Detection. This det...
3,089
36.682927
79
py
D2Det
D2Det-master/mmdet/models/detectors/cascade_rcnn.py
from __future__ import division import torch import torch.nn as nn from mmdet.core import (bbox2result, bbox2roi, bbox_mapping, build_assigner, build_sampler, merge_aug_bboxes, merge_aug_masks, multiclass_nms) from .. import builder from ..registry import DETECTORS from...
21,759
40.846154
79
py
D2Det
D2Det-master/mmdet/models/detectors/grid_rcnn.py
import torch from mmdet.core import bbox2result, bbox2roi, build_assigner, build_sampler from .. import builder from ..registry import DETECTORS from .two_stage import TwoStageDetector @DETECTORS.register_module class GridRCNN(TwoStageDetector): """Grid R-CNN. This detector is the implementation of: - G...
9,225
39.113043
79
py
D2Det
D2Det-master/mmdet/models/detectors/double_head_rcnn.py
import torch from mmdet.core import bbox2roi, build_assigner, build_sampler from ..registry import DETECTORS from .two_stage import TwoStageDetector @DETECTORS.register_module class DoubleHeadRCNN(TwoStageDetector): def __init__(self, reg_roi_scale_factor, **kwargs): super().__init__(**kwargs) s...
7,453
40.642458
77
py
D2Det
D2Det-master/mmdet/models/detectors/D2Det.py
import torch from mmdet.core import bbox2result, bbox2roi, build_assigner, build_sampler, multiclass_nms1, bbox2roi_expand from .. import builder from ..registry import DETECTORS from .two_stage import TwoStageDetector import numpy as np import mmcv import pycocotools.mask as mask_util @DETECTORS.register_module clas...
17,077
45.156757
175
py