repo stringlengths 2 99 | file stringlengths 13 225 | code stringlengths 0 18.3M | file_length int64 0 18.3M | avg_line_length float64 0 1.36M | max_line_length int64 0 4.26M | extension_type stringclasses 1
value |
|---|---|---|---|---|---|---|
s2anet | s2anet-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,531 | 29.905028 | 79 | py |
s2anet | s2anet-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,680 | 30.214286 | 79 | py |
s2anet | s2anet-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,633 | 29.283333 | 78 | py |
s2anet | s2anet-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,630 | 29.258333 | 78 | py |
s2anet | s2anet-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,728 | 28.832 | 78 | py |
s2anet | s2anet-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,725 | 28.808 | 78 | py |
s2anet | s2anet-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,571 | 28.766667 | 78 | py |
s2anet | s2anet-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,419 | 29.449438 | 78 | py |
s2anet | s2anet-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,903 | 27.705882 | 79 | py |
s2anet | s2anet-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,417 | 28.791165 | 78 | py |
s2anet | s2anet-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,585 | 29.032258 | 78 | py |
s2anet | s2anet-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,642 | 29.015957 | 78 | py |
s2anet | s2anet-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,819 | 29.15544 | 78 | py |
s2anet | s2anet-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,822 | 29.170984 | 78 | py |
s2anet | s2anet-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,858 | 30.551948 | 79 | py |
s2anet | s2anet-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,876 | 29.138462 | 78 | py |
s2anet | s2anet-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,184 | 27.469388 | 77 | py |
s2anet | s2anet-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,039 | 28.90099 | 78 | py |
s2anet | s2anet-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,500 | 28.735135 | 78 | py |
s2anet | s2anet-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,061 | 28.434783 | 79 | py |
s2anet | s2anet-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,516 | 30.346591 | 78 | py |
s2anet | s2anet-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,080 | 28.572464 | 79 | py |
s2anet | s2anet-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,852 | 29.326425 | 78 | py |
s2anet | s2anet-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,844 | 29.602094 | 78 | py |
s2anet | s2anet-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... | 5,953 | 29.533333 | 78 | py |
s2anet | s2anet-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,842 | 29.591623 | 78 | py |
s2anet | s2anet-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... | 5,955 | 29.54359 | 78 | py |
s2anet | s2anet-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,
norm_cfg=dict(type='BN', requires_grad=True),
style='pytorch'),
neck=d... | 3,897 | 29.217054 | 77 | py |
s2anet | s2anet-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,191 | 29.502463 | 78 | py |
s2anet | s2anet-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,133 | 29.517413 | 78 | py |
s2anet | s2anet-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,140 | 29.552239 | 78 | py |
s2anet | s2anet-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,544 | 29.467033 | 78 | py |
s2anet | s2anet-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,790 | 29.322785 | 75 | py |
s2anet | s2anet-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,440 | 31.416058 | 78 | py |
s2anet | s2anet-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,761 | 29.139241 | 77 | py |
s2anet | s2anet-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,793 | 29.341772 | 75 | py |
s2anet | s2anet-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,634 | 28.522293 | 75 | py |
s2anet | s2anet-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,605 | 28.33758 | 77 | py |
s2anet | s2anet-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,133 | 29.67 | 76 | py |
s2anet | s2anet-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,104 | 29.525 | 77 | py |
s2anet | s2anet-master/configs/dota/faster_rcnn_hbb_obb_r50_fpn_1x_dota.py | # model settings
model = dict(
type='FasterRCNNHBBOBB',
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_channe... | 5,387 | 29.788571 | 84 | py |
s2anet | s2anet-master/configs/dota/cascade_s2anet_2s_r50_fpn_1x_dota.py | # model settings
model = dict(
type='CascadeS2ANetDetector',
pretrained='torchvision://resnet50',
num_stages=2,
backbone=dict(
type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
style='pytorch'),
neck=dict(
type='... | 5,856 | 31.359116 | 84 | py |
s2anet | s2anet-master/configs/dota/retinanet_obb_r50_fpn_1x_dota.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... | 4,261 | 29.884058 | 80 | py |
s2anet | s2anet-master/configs/dota/s2anet_r50_fpn_1x_dota.py | # model settings
model = dict(
type='S2ANetDetector',
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... | 5,076 | 30.930818 | 83 | py |
s2anet | s2anet-master/configs/dota/cascade_s2anet_1s_r50_fpn_1x_dota.py | # model settings
model = dict(
type='CascadeS2ANetDetector',
pretrained='torchvision://resnet50',
num_stages=1,
backbone=dict(
type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
style='pytorch'),
neck=dict(
type='... | 4,529 | 30.241379 | 83 | py |
s2anet | s2anet-master/configs/cityscapes/faster_rcnn_r50_fpn_1x_cityscapes.py | # model settings
model = dict(
type='FasterRCNN',
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=[256, ... | 5,593 | 29.568306 | 79 | py |
s2anet | s2anet-master/configs/cityscapes/mask_rcnn_r50_fpn_1x_cityscapes.py | # model settings
model = dict(
type='MaskRCNN',
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=[256, 51... | 6,008 | 29.502538 | 79 | py |
s2anet | s2anet-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... | 5,996 | 29.441624 | 78 | py |
s2anet | s2anet-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... | 5,993 | 29.426396 | 78 | py |
s2anet | s2anet-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,001 | 29.467005 | 78 | py |
s2anet | s2anet-master/mmdet/__init__.py | from .version import __version__, short_version
__all__ = ['__version__', 'short_version']
| 92 | 22.25 | 47 | py |
s2anet | s2anet-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... | 5,973 | 33.732558 | 79 | py |
s2anet | s2anet-master/mmdet/apis/__init__.py | from .env import get_root_logger, init_dist, set_random_seed
from .inference import (inference_detector, init_detector, show_result,
show_result_pyplot)
from .train import train_detector
__all__ = [
'init_dist', 'get_root_logger', 'set_random_seed', 'train_detector',
'init_detector', 'i... | 379 | 37 | 79 | py |
s2anet | s2anet-master/mmdet/apis/train.py | from __future__ import division
import re
from collections import OrderedDict
import torch
from mmcv.parallel import MMDataParallel, MMDistributedDataParallel
from mmcv.runner import DistSamplerSeedHook, Runner, obj_from_dict
from mmdet import datasets
from mmdet.core import (CocoDistEvalmAPHook, CocoDistEvalRecallHo... | 9,069 | 37.927039 | 78 | py |
s2anet | s2anet-master/mmdet/apis/env.py | import logging
import os
import random
import subprocess
import numpy as np
import torch
import torch.distributed as dist
import torch.multiprocessing as mp
from mmcv.runner import get_dist_info
def init_dist(launcher, backend='nccl', **kwargs):
if mp.get_start_method(allow_none=True) is None:
mp.set_sta... | 2,041 | 28.171429 | 70 | py |
s2anet | s2anet-master/mmdet/core/__init__.py | from .anchor import * # noqa: F401, F403
from .bbox import * # noqa: F401, F403
from .evaluation import * # noqa: F401, F403
from .fp16 import * # noqa: F401, F403
from .mask import * # noqa: F401, F403
from .post_processing import * # noqa: F401, F403
from .utils import * # noqa: F401, F403
| 300 | 36.625 | 50 | py |
s2anet | s2anet-master/mmdet/core/evaluation/class_names.py | import mmcv
def wider_face_classes():
return ['face']
def voc_classes():
return [
'aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus', 'car', 'cat',
'chair', 'cow', 'diningtable', 'dog', 'horse', 'motorbike', 'person',
'pottedplant', 'sheep', 'sofa', 'train', 'tvmonitor'
]
... | 5,442 | 45.521368 | 79 | py |
s2anet | s2anet-master/mmdet/core/evaluation/recall.py | import numpy as np
from terminaltables import AsciiTable
from .bbox_overlaps import bbox_overlaps
def _recalls(all_ious, proposal_nums, thrs):
img_num = all_ious.shape[0]
total_gt_num = sum([ious.shape[0] for ious in all_ious])
_ious = np.zeros((proposal_nums.size, total_gt_num), dtype=np.float32)
... | 5,961 | 31.053763 | 78 | py |
s2anet | s2anet-master/mmdet/core/evaluation/eval_hooks.py | import os
import os.path as osp
import mmcv
import numpy as np
import torch
import torch.distributed as dist
from mmcv.parallel import collate, scatter
from mmcv.runner import Hook
from pycocotools.cocoeval import COCOeval
from torch.utils.data import Dataset
from mmdet import datasets
from .coco_utils import fast_ev... | 6,301 | 35.853801 | 79 | py |
s2anet | s2anet-master/mmdet/core/evaluation/dota_utils.py | import os
import os.path as osp
from ..bbox import rotated_box_to_poly_single
def result2dota_task1(results, dst_path, dataset):
CLASSES = dataset.CLASSES
img_names = dataset.img_names
assert len(results) == len(
img_names), 'length of results must equal with length of img_names'
if not osp.e... | 2,311 | 39.561404 | 142 | py |
s2anet | s2anet-master/mmdet/core/evaluation/__init__.py | from .class_names import (coco_classes, dataset_aliases, get_classes,
imagenet_det_classes, imagenet_vid_classes,
voc_classes)
from .coco_utils import coco_eval, fast_eval_recall, results2json
from .eval_hooks import (CocoDistEvalmAPHook, CocoDistEvalRecallHook,
... | 1,073 | 47.818182 | 76 | py |
s2anet | s2anet-master/mmdet/core/evaluation/coco_utils.py | import itertools
import mmcv
import numpy as np
from pycocotools.coco import COCO
from pycocotools.cocoeval import COCOeval
from terminaltables import AsciiTable
from .recall import eval_recalls
def coco_eval(result_files,
result_types,
coco,
max_dets=(100, 300, 1000),
... | 8,107 | 35.687783 | 169 | py |
s2anet | s2anet-master/mmdet/core/evaluation/bbox_overlaps.py | import numpy as np
def bbox_overlaps(bboxes1, bboxes2, mode='iou'):
"""Calculate the ious between each bbox of bboxes1 and bboxes2.
Args:
bboxes1(ndarray): shape (n, 4)
bboxes2(ndarray): shape (k, 4)
mode(str): iou (intersection over union) or iof (intersection
over foregr... | 1,642 | 31.86 | 69 | py |
s2anet | s2anet-master/mmdet/core/evaluation/mean_ap.py | import mmcv
import numpy as np
from terminaltables import AsciiTable
from .bbox_overlaps import bbox_overlaps
from .class_names import get_classes
def average_precision(recalls, precisions, mode='area'):
"""Calculate average precision (for single or multiple scales).
Args:
recalls (ndarray): shape (... | 15,802 | 40.586842 | 79 | py |
s2anet | s2anet-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 |
s2anet | s2anet-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 (Tens... | 2,808 | 36.959459 | 78 | py |
s2anet | s2anet-master/mmdet/core/post_processing/bbox_nms_rotated.py | import torch
from mmdet.ops import ml_nms_rotated
def multiclass_nms_rotated(multi_bboxes,
multi_scores,
score_thr,
nms_cfg,
max_num=-1,
score_factors=None):
"""NMS for multi-cla... | 2,309 | 34.538462 | 78 | py |
s2anet | s2anet-master/mmdet/core/post_processing/__init__.py | from .bbox_nms import multiclass_nms
from .bbox_nms_rotated import multiclass_nms_rotated
from .merge_augs import (merge_aug_bboxes, merge_aug_masks,
merge_aug_proposals, merge_aug_scores)
from .merge_augs_rotated import merge_aug_bboxes_rotated, merge_aug_proposals_rotated
__all__ = [
'mu... | 511 | 41.666667 | 87 | py |
s2anet | s2anet-master/mmdet/core/post_processing/merge_augs_rotated.py | import torch
from mmdet.ops import nms_rotated
from ..bbox import bbox_mapping_back_rotated
def merge_aug_proposals_rotated(aug_proposals, img_metas, rpn_test_cfg):
"""Merge augmented proposals (multiscale, flip, etc.)
Args:
aug_proposals (list[Tensor]): proposals from different testing
... | 2,679 | 37.285714 | 83 | py |
s2anet | s2anet-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,501 | 37.512821 | 77 | py |
s2anet | s2anet-master/mmdet/core/mask/utils.py | import mmcv
def split_combined_polys(polys, poly_lens, polys_per_mask):
"""Split the combined 1-D polys into masks.
A mask is represented as a list of polys, and a poly is represented as
a 1-D array. In dataset, all masks are concatenated into a single 1-D
tensor. Here we need to split the tensor int... | 1,172 | 36.83871 | 75 | py |
s2anet | s2anet-master/mmdet/core/mask/__init__.py | from .mask_target import mask_target
from .utils import split_combined_polys
__all__ = ['split_combined_polys', 'mask_target']
| 128 | 24.8 | 49 | py |
s2anet | s2anet-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,482 | 34.023438 | 79 | py |
s2anet | s2anet-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 |
s2anet | s2anet-master/mmdet/core/fp16/__init__.py | from .decorators import auto_fp16, force_fp32
from .hooks import Fp16OptimizerHook, wrap_fp16_model
__all__ = ['auto_fp16', 'force_fp32', 'Fp16OptimizerHook', 'wrap_fp16_model']
| 179 | 35 | 77 | py |
s2anet | s2anet-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 |
s2anet | s2anet-master/mmdet/core/bbox/bbox_target.py | import torch
from .transforms import bbox2delta
from ..utils import multi_apply
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,716 | 36.219178 | 78 | py |
s2anet | s2anet-master/mmdet/core/bbox/assign_sampling.py | from .builder import build_assigner, build_sampler
def assign_and_sample(bboxes, gt_bboxes, gt_bboxes_ignore, gt_labels, cfg):
bbox_assigner = build_assigner(cfg.assigner)
bbox_sampler = build_sampler(cfg.sampler)
assign_result = bbox_assigner.assign(bboxes, gt_bboxes, gt_bboxes_ignore,
... | 525 | 42.833333 | 77 | py |
s2anet | s2anet-master/mmdet/core/bbox/bbox_target_rotated.py | import torch
from .transforms_rotated import bbox2delta_rotated
from ..utils import multi_apply
def bbox_target_rotated(pos_bboxes_list,
neg_bboxes_list,
pos_gt_bboxes_list,
pos_gt_labels_list,
cfg,
... | 2,284 | 36.459016 | 86 | py |
s2anet | s2anet-master/mmdet/core/bbox/__init__.py | from .assign_sampling import assign_and_sample
from .assigners import AssignResult, BaseAssigner, MaxIoUAssigner
from .bbox_target import bbox_target
from .bbox_target_rotated import bbox_target_rotated
from .builder import build_assigner, build_sampler, build_bbox_coder
from .coder import DeltaXYWHBBoxCoder, DeltaXYWH... | 2,465 | 65.648649 | 120 | py |
s2anet | s2anet-master/mmdet/core/bbox/transforms_rotated.py | import math
import numpy as np
import torch
def norm_angle(angle, range=[-np.pi / 4, np.pi]):
return (angle - range[0]) % range[1] + range[0]
def bbox2delta_rotated(proposals, gt, means=(0., 0., 0., 0., 0.), stds=(1., 1., 1., 1., 1.)):
"""Compute deltas of proposals w.r.t. gt.
We usually compute the d... | 16,728 | 32.65996 | 107 | py |
s2anet | s2anet-master/mmdet/core/bbox/builder.py | from mmdet.utils import Registry, build_from_cfg
BBOX_ASSIGNERS = Registry('bbox_assigner')
BBOX_SAMPLERS = Registry('bbox_sampler')
BBOX_CODERS = Registry('bbox_coder')
def build_assigner(cfg, **default_args):
"""Builder of box assigner."""
return build_from_cfg(cfg, BBOX_ASSIGNERS, default_args)
def buil... | 581 | 26.714286 | 60 | py |
s2anet | s2anet-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.... | 7,766 | 33.986486 | 79 | py |
s2anet | s2anet-master/mmdet/core/bbox/assigners/assign_result.py | import torch
class AssignResult(object):
def __init__(self, num_gts, gt_inds, max_overlaps, labels=None):
self.num_gts = num_gts
self.gt_inds = gt_inds
self.max_overlaps = max_overlaps
self.labels = labels
def add_gt_(self, gt_labels):
self_inds = torch.arange(
... | 664 | 32.25 | 77 | py |
s2anet | s2anet-master/mmdet/core/bbox/assigners/base_assigner.py | from abc import ABCMeta, abstractmethod
class BaseAssigner(metaclass=ABCMeta):
@abstractmethod
def assign(self, bboxes, gt_bboxes, gt_bboxes_ignore=None, gt_labels=None):
pass
| 195 | 20.777778 | 79 | py |
s2anet | s2anet-master/mmdet/core/bbox/assigners/point_assigner.py | import torch
from .assign_result import AssignResult
from .base_assigner import BaseAssigner
from ..builder import BBOX_ASSIGNERS
@BBOX_ASSIGNERS.register_module
class PointAssigner(BaseAssigner):
"""Assign a corresponding gt bbox or background to each point.
Each proposals will be assigned with `0`, or a p... | 5,249 | 43.117647 | 79 | py |
s2anet | s2anet-master/mmdet/core/bbox/assigners/__init__.py | from .approx_max_iou_assigner import ApproxMaxIoUAssigner
from .assign_result import AssignResult
from .base_assigner import BaseAssigner
from .max_iou_assigner import MaxIoUAssigner
from .point_assigner import PointAssigner
__all__ = [
'BaseAssigner', 'MaxIoUAssigner', 'ApproxMaxIoUAssigner', 'AssignResult',
... | 338 | 29.818182 | 77 | py |
s2anet | s2anet-master/mmdet/core/bbox/assigners/approx_max_iou_assigner.py | import torch
from .max_iou_assigner import MaxIoUAssigner
from ..builder import BBOX_ASSIGNERS
from ..iou_calculators import build_iou_calculator
@BBOX_ASSIGNERS.register_module
class ApproxMaxIoUAssigner(MaxIoUAssigner):
"""Assign a corresponding gt bbox or background to each bbox.
Each proposals will be a... | 5,088 | 41.408333 | 79 | py |
s2anet | s2anet-master/mmdet/core/bbox/assigners/max_iou_assigner.py | import torch
from .assign_result import AssignResult
from .base_assigner import BaseAssigner
from ..builder import BBOX_ASSIGNERS
from ..iou_calculators import build_iou_calculator
@BBOX_ASSIGNERS.register_module
class MaxIoUAssigner(BaseAssigner):
"""Assign a corresponding gt bbox or background to each bbox.
... | 6,735 | 41.904459 | 79 | py |
s2anet | s2anet-master/mmdet/core/bbox/coder/pseudo_bbox_coder.py | from ..builder import BBOX_CODERS
from .base_bbox_coder import BaseBBoxCoder
@BBOX_CODERS.register_module
class PseudoBBoxCoder(BaseBBoxCoder):
"""Pseudo bounding box coder."""
def __init__(self, **kwargs):
super(BaseBBoxCoder, self).__init__(**kwargs)
def encode(self, bboxes, gt_bboxes):
... | 527 | 26.789474 | 60 | py |
s2anet | s2anet-master/mmdet/core/bbox/coder/base_bbox_coder.py | from abc import ABCMeta, abstractmethod
class BaseBBoxCoder(metaclass=ABCMeta):
"""Base bounding box coder."""
def __init__(self, **kwargs):
pass
@abstractmethod
def encode(self, bboxes, gt_bboxes):
"""Encode deltas between bboxes and ground truth boxes."""
pass
@abstrac... | 474 | 22.75 | 71 | py |
s2anet | s2anet-master/mmdet/core/bbox/coder/delta_xywha_bbox_coder.py | import torch
from .base_bbox_coder import BaseBBoxCoder
from ..builder import BBOX_CODERS
from ..transforms_rotated import delta2bbox_rotated, bbox2delta_rotated
@BBOX_CODERS.register_module
class DeltaXYWHABBoxCoder(BaseBBoxCoder):
"""Delta XYWHA BBox coder.
Following the practice in `R-CNN <https://arxiv.... | 2,720 | 35.28 | 87 | py |
s2anet | s2anet-master/mmdet/core/bbox/coder/delta_xywh_bbox_coder.py | import numpy as np
import torch
from .base_bbox_coder import BaseBBoxCoder
from ..builder import BBOX_CODERS
@BBOX_CODERS.register_module
class DeltaXYWHBBoxCoder(BaseBBoxCoder):
"""Delta XYWH BBox coder used in MMDet V1.x.
Following the practice in R-CNN [1]_, this coder encodes bbox (x1, y1, x2,
y2) i... | 7,763 | 36.507246 | 79 | py |
s2anet | s2anet-master/mmdet/core/bbox/coder/__init__.py | from .base_bbox_coder import BaseBBoxCoder
from .delta_xywh_bbox_coder import DeltaXYWHBBoxCoder
from .pseudo_bbox_coder import PseudoBBoxCoder
from .delta_xywha_bbox_coder import DeltaXYWHABBoxCoder
__all__ = [
'BaseBBoxCoder', 'PseudoBBoxCoder', 'DeltaXYWHBBoxCoder', 'DeltaXYWHABBoxCoder'
]
| 302 | 24.25 | 83 | py |
s2anet | s2anet-master/mmdet/core/bbox/iou_calculators/iou2d_calculator_rotated.py | from mmdet.ops.box_iou_rotated import box_iou_rotated
from .builder import IOU_CALCULATORS
@IOU_CALCULATORS.register_module
class BboxOverlaps2D_rotated(object):
"""2D Overlaps (e.g. IoUs, GIoUs) Calculator."""
def __call__(self, bboxes1, bboxes2, mode='iou', is_aligned=False):
"""Calculate IoU betwe... | 1,706 | 36.933333 | 79 | py |
s2anet | s2anet-master/mmdet/core/bbox/iou_calculators/__init__.py | from .builder import build_iou_calculator
from .iou2d_calculator import BboxOverlaps2D, bbox_overlaps
from .iou2d_calculator_rotated import BboxOverlaps2D_rotated, bbox_overlaps_rotated
__all__ = ['build_iou_calculator', 'BboxOverlaps2D', 'bbox_overlaps', 'BboxOverlaps2D_rotated', 'bbox_overlaps_rotated']
| 308 | 50.5 | 120 | py |
s2anet | s2anet-master/mmdet/core/bbox/iou_calculators/builder.py | from mmdet.utils import Registry, build_from_cfg
IOU_CALCULATORS = Registry('IoU calculator')
def build_iou_calculator(cfg, default_args=None):
"""Builder of IoU calculator."""
return build_from_cfg(cfg, IOU_CALCULATORS, default_args)
| 246 | 26.444444 | 61 | py |
s2anet | s2anet-master/mmdet/core/bbox/iou_calculators/iou2d_calculator.py | import torch
from .builder import IOU_CALCULATORS
@IOU_CALCULATORS.register_module
class BboxOverlaps2D(object):
"""2D Overlaps (e.g. IoUs, GIoUs) Calculator."""
def __call__(self, bboxes1, bboxes2, mode='iou', is_aligned=False):
"""Calculate IoU between 2D bboxes.
Args:
bboxes1... | 6,267 | 37.453988 | 78 | py |
s2anet | s2anet-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 |
s2anet | s2anet-master/mmdet/core/bbox/samplers/combined_sampler.py | from ..builder import build_sampler
from .base_sampler import BaseSampler
class CombinedSampler(BaseSampler):
def __init__(self, pos_sampler, neg_sampler, **kwargs):
super(CombinedSampler, self).__init__(**kwargs)
self.pos_sampler = build_sampler(pos_sampler, **kwargs)
self.neg_sampler = ... | 501 | 28.529412 | 63 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.