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
LineFormer
LineFormer-main/mmdetection/configs/detr/detr_r50_8x2_150e_coco.py
_base_ = [ '../_base_/datasets/coco_detection.py', '../_base_/default_runtime.py' ] model = dict( type='DETR', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(3, ), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=False), norm...
5,858
37.801325
79
py
LineFormer
LineFormer-main/mmdetection/configs/atss/atss_r101_fpn_1x_coco.py
_base_ = './atss_r50_fpn_1x_coco.py' model = dict( backbone=dict( depth=101, init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet101')))
192
26.571429
61
py
LineFormer
LineFormer-main/mmdetection/configs/atss/atss_r50_fpn_1x_coco.py
_base_ = [ '../_base_/datasets/coco_detection.py', '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py' ] model = dict( type='ATSS', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=d...
1,925
29.571429
79
py
LineFormer
LineFormer-main/mmdetection/configs/ld/ld_r101_gflv1_r101dcn_fpn_coco_2x.py
_base_ = ['./ld_r18_gflv1_r101_fpn_coco_1x.py'] teacher_ckpt = 'https://download.openmmlab.com/mmdetection/v2.0/gfl/gfl_r101_fpn_dconv_c3-c5_mstrain_2x_coco/gfl_r101_fpn_dconv_c3-c5_mstrain_2x_coco_20200630_102002-134b07df.pth' # noqa model = dict( teacher_config='configs/gfl/gfl_r101_fpn_dconv_c3-c5_mstrain_2x_co...
1,628
35.2
187
py
LineFormer
LineFormer-main/mmdetection/configs/ld/ld_r34_gflv1_r101_fpn_coco_1x.py
_base_ = ['./ld_r18_gflv1_r101_fpn_coco_1x.py'] model = dict( backbone=dict( type='ResNet', depth=34, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=True), norm_eval=True, style='pytorch', init_c...
569
27.5
79
py
LineFormer
LineFormer-main/mmdetection/configs/ld/ld_r18_gflv1_r101_fpn_coco_1x.py
_base_ = [ '../_base_/datasets/coco_detection.py', '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py' ] teacher_ckpt = 'https://download.openmmlab.com/mmdetection/v2.0/gfl/gfl_r101_fpn_mstrain_2x_coco/gfl_r101_fpn_mstrain_2x_coco_20200629_200126-dd12f847.pth' # noqa model = dict( type='Kn...
2,120
32.666667
163
py
LineFormer
LineFormer-main/mmdetection/configs/ld/ld_r50_gflv1_r101_fpn_coco_1x.py
_base_ = ['./ld_r18_gflv1_r101_fpn_coco_1x.py'] model = dict( 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), norm_eval=True, style='pytorch', init_c...
572
27.65
79
py
LineFormer
LineFormer-main/mmdetection/configs/seesaw_loss/cascade_mask_rcnn_r101_fpn_sample1e-3_seesaw_loss_mstrain_2x_lvis_v1.py
_base_ = [ '../_base_/models/cascade_mask_rcnn_r50_fpn.py', '../_base_/datasets/lvis_v1_instance.py', '../_base_/schedules/schedule_2x.py', '../_base_/default_runtime.py' ] model = dict( backbone=dict( depth=101, init_cfg=dict(type='Pretrained', checkpoint='torchvi...
3,783
37.222222
79
py
LineFormer
LineFormer-main/mmdetection/configs/seesaw_loss/mask_rcnn_r101_fpn_sample1e-3_seesaw_loss_mstrain_2x_lvis_v1.py
_base_ = './mask_rcnn_r50_fpn_sample1e-3_seesaw_loss_mstrain_2x_lvis_v1.py' model = dict( backbone=dict( depth=101, init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet101')))
231
32.142857
75
py
LineFormer
LineFormer-main/mmdetection/configs/seesaw_loss/mask_rcnn_r101_fpn_random_seesaw_loss_mstrain_2x_lvis_v1.py
_base_ = './mask_rcnn_r50_fpn_random_seesaw_loss_mstrain_2x_lvis_v1.py' model = dict( backbone=dict( depth=101, init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet101')))
227
31.571429
71
py
LineFormer
LineFormer-main/mmdetection/configs/seesaw_loss/mask_rcnn_r101_fpn_sample1e-3_seesaw_loss_normed_mask_mstrain_2x_lvis_v1.py
_base_ = './mask_rcnn_r50_fpn_sample1e-3_seesaw_loss_normed_mask_mstrain_2x_lvis_v1.py' # noqa: E501 model = dict( backbone=dict( depth=101, init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet101')))
257
35.857143
101
py
LineFormer
LineFormer-main/mmdetection/configs/seesaw_loss/mask_rcnn_r101_fpn_random_seesaw_loss_normed_mask_mstrain_2x_lvis_v1.py
_base_ = './mask_rcnn_r50_fpn_random_seesaw_loss_normed_mask_mstrain_2x_lvis_v1.py' # noqa: E501 model = dict( backbone=dict( depth=101, init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet101')))
253
35.285714
97
py
LineFormer
LineFormer-main/mmdetection/configs/seesaw_loss/cascade_mask_rcnn_r101_fpn_random_seesaw_loss_mstrain_2x_lvis_v1.py
_base_ = [ '../_base_/models/cascade_mask_rcnn_r50_fpn.py', '../_base_/datasets/coco_instance.py', '../_base_/schedules/schedule_2x.py', '../_base_/default_runtime.py' ] model = dict( backbone=dict( depth=101, init_cfg=dict(type='Pretrained', checkpoint='torchvisio...
4,807
35.150376
79
py
LineFormer
LineFormer-main/mmdetection/configs/tood/tood_x101_64x4d_fpn_mstrain_2x_coco.py
_base_ = './tood_r50_fpn_mstrain_2x_coco.py' model = dict( backbone=dict( type='ResNeXt', depth=101, groups=64, base_width=4, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=True), norm_eval=True...
447
25.352941
76
py
LineFormer
LineFormer-main/mmdetection/configs/tood/tood_r50_fpn_1x_coco.py
_base_ = [ '../_base_/datasets/coco_detection.py', '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py' ] model = dict( type='TOOD', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=d...
2,306
29.76
79
py
LineFormer
LineFormer-main/mmdetection/configs/tood/tood_r101_fpn_mstrain_2x_coco.py
_base_ = './tood_r50_fpn_mstrain_2x_coco.py' model = dict( backbone=dict( depth=101, init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet101')))
201
24.25
61
py
LineFormer
LineFormer-main/mmdetection/configs/dyhead/atss_r50_fpn_dyhead_1x_coco.py
_base_ = [ '../_base_/datasets/coco_detection.py', '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py' ] model = dict( type='ATSS', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=d...
2,043
29.969697
79
py
LineFormer
LineFormer-main/mmdetection/configs/dyhead/atss_r50_caffe_fpn_dyhead_1x_coco.py
_base_ = [ '../_base_/datasets/coco_detection.py', '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py' ] model = dict( type='ATSS', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=d...
3,608
30.938053
73
py
LineFormer
LineFormer-main/mmdetection/configs/gn+ws/faster_rcnn_x50_32x4d_fpn_gn_ws-all_1x_coco.py
_base_ = './faster_rcnn_r50_fpn_gn_ws-all_1x_coco.py' conv_cfg = dict(type='ConvWS') norm_cfg = dict(type='GN', num_groups=32, requires_grad=True) model = dict( backbone=dict( type='ResNeXt', depth=50, groups=32, base_width=4, num_stages=4, out_indices=(0, 1, 2, 3), ...
544
27.684211
66
py
LineFormer
LineFormer-main/mmdetection/configs/gn+ws/mask_rcnn_x101_32x4d_fpn_gn_ws-all_2x_coco.py
_base_ = './mask_rcnn_r50_fpn_gn_ws-all_2x_coco.py' # model settings conv_cfg = dict(type='ConvWS') norm_cfg = dict(type='GN', num_groups=32, requires_grad=True) model = dict( backbone=dict( type='ResNeXt', depth=101, groups=32, base_width=4, num_stages=4, out_indices...
561
27.1
67
py
LineFormer
LineFormer-main/mmdetection/configs/gn+ws/faster_rcnn_x101_32x4d_fpn_gn_ws-all_1x_coco.py
_base_ = './faster_rcnn_r50_fpn_gn_ws-all_1x_coco.py' conv_cfg = dict(type='ConvWS') norm_cfg = dict(type='GN', num_groups=32, requires_grad=True) model = dict( backbone=dict( type='ResNeXt', depth=101, groups=32, base_width=4, num_stages=4, out_indices=(0, 1, 2, 3), ...
546
27.789474
67
py
LineFormer
LineFormer-main/mmdetection/configs/gn+ws/mask_rcnn_x50_32x4d_fpn_gn_ws-all_2x_coco.py
_base_ = './mask_rcnn_r50_fpn_gn_ws-all_2x_coco.py' # model settings conv_cfg = dict(type='ConvWS') norm_cfg = dict(type='GN', num_groups=32, requires_grad=True) model = dict( backbone=dict( type='ResNeXt', depth=50, groups=32, base_width=4, num_stages=4, out_indices=...
559
27
66
py
LineFormer
LineFormer-main/mmdetection/configs/guided_anchoring/ga_faster_x101_64x4d_fpn_1x_coco.py
_base_ = './ga_faster_r50_fpn_1x_coco.py' model = dict( backbone=dict( type='ResNeXt', depth=101, groups=64, base_width=4, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=True), style='pytorch', ...
419
27
76
py
LineFormer
LineFormer-main/mmdetection/configs/guided_anchoring/ga_faster_x101_32x4d_fpn_1x_coco.py
_base_ = './ga_faster_r50_fpn_1x_coco.py' model = dict( backbone=dict( type='ResNeXt', depth=101, groups=32, base_width=4, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=True), style='pytorch', ...
419
27
76
py
LineFormer
LineFormer-main/mmdetection/configs/guided_anchoring/ga_retinanet_x101_32x4d_fpn_1x_coco.py
_base_ = './ga_retinanet_r50_fpn_1x_coco.py' model = dict( backbone=dict( type='ResNeXt', depth=101, groups=32, base_width=4, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=True), style='pytorch'...
422
27.2
76
py
LineFormer
LineFormer-main/mmdetection/configs/guided_anchoring/ga_rpn_x101_32x4d_fpn_1x_coco.py
_base_ = './ga_rpn_r50_fpn_1x_coco.py' model = dict( backbone=dict( type='ResNeXt', depth=101, groups=32, base_width=4, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=True), style='pytorch', ...
416
26.8
76
py
LineFormer
LineFormer-main/mmdetection/configs/guided_anchoring/ga_rpn_r101_caffe_fpn_1x_coco.py
_base_ = './ga_rpn_r50_caffe_fpn_1x_coco.py' # model settings model = dict( backbone=dict( depth=101, init_cfg=dict( type='Pretrained', checkpoint='open-mmlab://detectron2/resnet101_caffe')))
236
25.333333
67
py
LineFormer
LineFormer-main/mmdetection/configs/guided_anchoring/ga_retinanet_x101_64x4d_fpn_1x_coco.py
_base_ = './ga_retinanet_r50_fpn_1x_coco.py' model = dict( backbone=dict( type='ResNeXt', depth=101, groups=64, base_width=4, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=True), style='pytorch'...
422
27.2
76
py
LineFormer
LineFormer-main/mmdetection/configs/guided_anchoring/ga_faster_r101_caffe_fpn_1x_coco.py
_base_ = './ga_faster_r50_caffe_fpn_1x_coco.py' model = dict( backbone=dict( depth=101, init_cfg=dict( type='Pretrained', checkpoint='open-mmlab://detectron2/resnet101_caffe')))
222
26.875
67
py
LineFormer
LineFormer-main/mmdetection/configs/guided_anchoring/ga_rpn_x101_64x4d_fpn_1x_coco.py
_base_ = './ga_rpn_r50_fpn_1x_coco.py' model = dict( backbone=dict( type='ResNeXt', depth=101, groups=64, base_width=4, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=True), style='pytorch', ...
416
26.8
76
py
LineFormer
LineFormer-main/mmdetection/configs/guided_anchoring/ga_fast_r50_caffe_fpn_1x_coco.py
_base_ = '../fast_rcnn/fast_rcnn_r50_fpn_1x_coco.py' model = dict( 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, style='caffe', in...
2,407
35.484848
78
py
LineFormer
LineFormer-main/mmdetection/configs/guided_anchoring/ga_faster_r50_caffe_fpn_1x_coco.py
_base_ = '../faster_rcnn/faster_rcnn_r50_caffe_fpn_1x_coco.py' model = dict( rpn_head=dict( _delete_=True, type='GARPNHead', in_channels=256, feat_channels=256, approx_anchor_generator=dict( type='AnchorGenerator', octave_base_scale=8, scal...
2,408
35.5
77
py
LineFormer
LineFormer-main/mmdetection/configs/guided_anchoring/ga_retinanet_r101_caffe_fpn_1x_coco.py
_base_ = './ga_retinanet_r50_caffe_fpn_1x_coco.py' model = dict( backbone=dict( depth=101, init_cfg=dict( type='Pretrained', checkpoint='open-mmlab://detectron2/resnet101_caffe')))
225
27.25
67
py
LineFormer
LineFormer-main/mmdetection/configs/guided_anchoring/ga_retinanet_r50_caffe_fpn_1x_coco.py
_base_ = '../retinanet/retinanet_r50_caffe_fpn_1x_coco.py' model = dict( bbox_head=dict( _delete_=True, type='GARetinaHead', num_classes=80, in_channels=256, stacked_convs=4, feat_channels=256, approx_anchor_generator=dict( type='AnchorGenerator', ...
2,055
31.634921
74
py
LineFormer
LineFormer-main/mmdetection/configs/guided_anchoring/ga_retinanet_r101_caffe_fpn_mstrain_2x.py
_base_ = '../_base_/default_runtime.py' # model settings model = dict( type='RetinaNet', 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, ...
5,095
28.976471
74
py
LineFormer
LineFormer-main/mmdetection/configs/guided_anchoring/ga_rpn_r50_caffe_fpn_1x_coco.py
_base_ = '../rpn/rpn_r50_caffe_fpn_1x_coco.py' model = dict( rpn_head=dict( _delete_=True, type='GARPNHead', in_channels=256, feat_channels=256, approx_anchor_generator=dict( type='AnchorGenerator', octave_base_scale=8, scales_per_octave=3,...
2,028
33.389831
74
py
LineFormer
LineFormer-main/mmdetection/configs/solov2/solov2_light_r34_fpn_3x_coco.py
_base_ = 'solov2_light_r50_fpn_3x_coco.py' # model settings model = dict( backbone=dict( depth=34, init_cfg=dict(checkpoint='torchvision://resnet34')), neck=dict(in_channels=[64, 128, 256, 512]))
213
25.75
70
py
LineFormer
LineFormer-main/mmdetection/configs/solov2/solov2_r50_fpn_1x_coco.py
_base_ = [ '../_base_/datasets/coco_instance.py', '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py' ] # model settings model = dict( type='SOLOv2', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1,...
1,825
28.451613
78
py
LineFormer
LineFormer-main/mmdetection/configs/solov2/solov2_r101_dcn_fpn_3x_coco.py
_base_ = 'solov2_r50_fpn_3x_coco.py' # model settings model = dict( backbone=dict( depth=101, init_cfg=dict(checkpoint='torchvision://resnet101'), dcn=dict(type='DCNv2', deformable_groups=1, fallback_on_stride=False), stage_with_dcn=(False, True, True, True)), mask_head=dict( ...
452
31.357143
78
py
LineFormer
LineFormer-main/mmdetection/configs/solov2/solov2_light_r18_fpn_3x_coco.py
_base_ = 'solov2_light_r50_fpn_3x_coco.py' # model settings model = dict( backbone=dict( depth=18, init_cfg=dict(checkpoint='torchvision://resnet18')), neck=dict(in_channels=[64, 128, 256, 512]))
213
25.75
70
py
LineFormer
LineFormer-main/mmdetection/configs/solov2/solov2_r101_fpn_3x_coco.py
_base_ = 'solov2_r50_fpn_3x_coco.py' # model settings model = dict( backbone=dict( depth=101, init_cfg=dict(checkpoint='torchvision://resnet101')))
161
22.142857
72
py
LineFormer
LineFormer-main/mmdetection/configs/convnext/cascade_mask_rcnn_convnext-t_p4_w7_fpn_giou_4conv1f_fp16_ms-crop_3x_coco.py
_base_ = [ '../_base_/models/cascade_mask_rcnn_r50_fpn.py', '../_base_/datasets/coco_instance.py', '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py' ] # please install mmcls>=0.22.0 # import mmcls.models to trigger register_module in mmcls custom_imports = dict(imports=['mmcls.models'], ...
5,693
36.96
162
py
LineFormer
LineFormer-main/mmdetection/configs/convnext/mask_rcnn_convnext-t_p4_w7_fpn_fp16_ms-crop_3x_coco.py
_base_ = [ '../_base_/models/mask_rcnn_r50_fpn.py', '../_base_/datasets/coco_instance.py', '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py' ] # please install mmcls>=0.22.0 # import mmcls.models to trigger register_module in mmcls custom_imports = dict(imports=['mmcls.models'], allow_fa...
3,419
36.582418
162
py
LineFormer
LineFormer-main/mmdetection/configs/lad/lad_r50_paa_r101_fpn_coco_1x.py
_base_ = [ '../_base_/datasets/coco_detection.py', '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py' ] teacher_ckpt = 'http://download.openmmlab.com/mmdetection/v2.0/paa/paa_r101_fpn_1x_coco/paa_r101_fpn_1x_coco_20200821-0a1825a4.pth' # noqa model = dict( type='LAD', # student ba...
3,906
30.007937
139
py
LineFormer
LineFormer-main/mmdetection/configs/lad/lad_r101_paa_r50_fpn_coco_1x.py
_base_ = [ '../_base_/datasets/coco_detection.py', '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py' ] teacher_ckpt = 'https://download.openmmlab.com/mmdetection/v2.0/paa/paa_r50_fpn_1x_coco/paa_r50_fpn_1x_coco_20200821-936edec3.pth' # noqa model = dict( type='LAD', # student bac...
3,928
29.937008
138
py
LineFormer
LineFormer-main/mmdetection/configs/sparse_rcnn/sparse_rcnn_r101_fpn_mstrain_480-800_3x_coco.py
_base_ = './sparse_rcnn_r50_fpn_mstrain_480-800_3x_coco.py' model = dict( backbone=dict( depth=101, init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet101')))
216
26.125
61
py
LineFormer
LineFormer-main/mmdetection/configs/sparse_rcnn/sparse_rcnn_r101_fpn_300_proposals_crop_mstrain_480-800_3x_coco.py
_base_ = './sparse_rcnn_r50_fpn_300_proposals_crop_mstrain_480-800_3x_coco.py' model = dict( backbone=dict( depth=101, init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet101')))
235
28.5
78
py
LineFormer
LineFormer-main/mmdetection/configs/sparse_rcnn/sparse_rcnn_r50_fpn_1x_coco.py
_base_ = [ '../_base_/datasets/coco_detection.py', '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py' ] num_stages = 6 num_proposals = 100 model = dict( type='SparseRCNN', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), ...
3,469
35.145833
79
py
LineFormer
LineFormer-main/mmdetection/docs/en/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...
3,439
28.401709
79
py
LineFormer
LineFormer-main/mmdetection/docs/zh_cn/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...
3,461
28.092437
79
py
LineFormer
LineFormer-main/mmdetection/mmdet/apis/inference.py
# Copyright (c) OpenMMLab. All rights reserved. import warnings from pathlib import Path import mmcv import numpy as np import torch from mmcv.ops import RoIPool from mmcv.parallel import collate, scatter from mmcv.runner import load_checkpoint from mmdet.core import get_classes from mmdet.datasets import replace_Ima...
8,629
32.449612
79
py
LineFormer
LineFormer-main/mmdetection/mmdet/apis/test.py
# Copyright (c) OpenMMLab. All rights reserved. import os.path as osp import pickle import shutil import tempfile import time import mmcv import torch import torch.distributed as dist from mmcv.image import tensor2imgs from mmcv.runner import get_dist_info from mmdet.core import encode_mask_results def single_gpu_t...
7,817
36.228571
79
py
LineFormer
LineFormer-main/mmdetection/mmdet/apis/train.py
# Copyright (c) OpenMMLab. All rights reserved. import os import random import numpy as np import torch import torch.distributed as dist from mmcv.runner import (DistSamplerSeedHook, EpochBasedRunner, Fp16OptimizerHook, OptimizerHook, build_runner, get_dist_info) from...
8,379
32.927126
79
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/evaluation/eval_hooks.py
# Copyright (c) OpenMMLab. All rights reserved. import bisect import os.path as osp import mmcv import torch.distributed as dist from mmcv.runner import DistEvalHook as BaseDistEvalHook from mmcv.runner import EvalHook as BaseEvalHook from torch.nn.modules.batchnorm import _BatchNorm def _calc_dynamic_intervals(star...
5,604
38.751773
76
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/post_processing/merge_augs.py
# Copyright (c) OpenMMLab. All rights reserved. import copy import warnings import numpy as np import torch from mmcv import ConfigDict from mmcv.ops import nms from ..bbox import bbox_mapping_back def merge_aug_proposals(aug_proposals, img_metas, cfg): """Merge augmented proposals (multiscale, flip, etc.) ...
5,790
36.36129
78
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/post_processing/bbox_nms.py
# Copyright (c) OpenMMLab. All rights reserved. import torch from mmcv.ops.nms import batched_nms from mmdet.core.bbox.iou_calculators import bbox_overlaps def multiclass_nms(multi_bboxes, multi_scores, score_thr, nms_cfg, max_num=-1, ...
6,495
36.767442
78
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/post_processing/matrix_nms.py
# Copyright (c) OpenMMLab. All rights reserved. import torch def mask_matrix_nms(masks, labels, scores, filter_thr=-1, nms_pre=-1, max_num=-1, kernel='gaussian', sigma=2.0, ...
4,622
36.893443
77
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/mask/structures.py
# Copyright (c) OpenMMLab. All rights reserved. from abc import ABCMeta, abstractmethod import cv2 import mmcv import numpy as np import pycocotools.mask as maskUtils import torch from mmcv.ops.roi_align import roi_align class BaseInstanceMasks(metaclass=ABCMeta): """Base class for instance masks.""" @abstr...
41,496
36.62194
141
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/mask/mask_target.py
# Copyright (c) OpenMMLab. All rights reserved. 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): """Compute mask target for positive proposals in multiple images. Args: pos_prop...
5,115
38.96875
78
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/mask/utils.py
# Copyright (c) OpenMMLab. All rights reserved. import mmcv import numpy as np import pycocotools.mask as mask_util import torch 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...
3,017
32.533333
75
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/hook/sync_random_size_hook.py
# Copyright (c) OpenMMLab. All rights reserved. import random import warnings import torch from mmcv.runner import get_dist_info from mmcv.runner.hooks import HOOKS, Hook from torch import distributed as dist @HOOKS.register_module() class SyncRandomSizeHook(Hook): """Change and synchronize the random image size...
3,061
40.945205
78
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/hook/checkloss_hook.py
# Copyright (c) OpenMMLab. All rights reserved. import torch from mmcv.runner.hooks import HOOKS, Hook @HOOKS.register_module() class CheckInvalidLossHook(Hook): """Check invalid loss hook. This hook will regularly check whether the loss is valid during training. Args: interval (int): Checki...
681
26.28
66
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/hook/sync_norm_hook.py
# Copyright (c) OpenMMLab. All rights reserved. from collections import OrderedDict from mmcv.runner import get_dist_info from mmcv.runner.hooks import HOOKS, Hook from torch import nn from ..utils.dist_utils import all_reduce_dict def get_norm_states(module): async_norm_states = OrderedDict() for name, chi...
1,789
32.773585
77
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/export/model_wrappers.py
# Copyright (c) OpenMMLab. All rights reserved. import os.path as osp import warnings import numpy as np import torch from mmdet.core import bbox2result from mmdet.models import BaseDetector class DeployBaseDetector(BaseDetector): """DeployBaseDetector.""" def __init__(self, class_names, device_id): ...
7,469
39.597826
79
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/export/pytorch2onnx.py
# Copyright (c) OpenMMLab. All rights reserved. from functools import partial import mmcv import numpy as np import torch from mmcv.runner import load_checkpoint def generate_inputs_and_wrap_model(config_path, checkpoint_path, input_config, ...
5,995
36.475
78
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/export/__init__.py
# Copyright (c) OpenMMLab. All rights reserved. from .onnx_helper import (add_dummy_nms_for_onnx, dynamic_clip_for_onnx, get_k_for_topk) from .pytorch2onnx import (build_model_from_cfg, generate_inputs_and_wrap_model, preprocess_example_inp...
505
37.923077
75
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/export/onnx_helper.py
# Copyright (c) OpenMMLab. All rights reserved. import os import torch def dynamic_clip_for_onnx(x1, y1, x2, y2, max_shape): """Clip boxes dynamically for onnx. Since torch.clamp cannot have dynamic `min` and `max`, we scale the boxes by 1/max_shape and clamp in the range [0, 1]. Args: x1...
8,367
36.357143
98
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/bbox/demodata.py
# Copyright (c) OpenMMLab. All rights reserved. import numpy as np import torch from mmdet.utils.util_random import ensure_rng def random_boxes(num=1, scale=1, rng=None): """Simple version of ``kwimage.Boxes.random`` Returns: Tensor: shape (n, 4) in x1, y1, x2, y2 format. References: ht...
1,181
26.488372
101
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/bbox/transforms.py
# Copyright (c) OpenMMLab. All rights reserved. import numpy as np import torch def find_inside_bboxes(bboxes, img_h, img_w): """Find bboxes as long as a part of bboxes is inside the image. Args: bboxes (Tensor): Shape (N, 4). img_h (int): Image height. img_w (int): Image width. ...
8,962
32.073801
79
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/bbox/assigners/assign_result.py
# Copyright (c) OpenMMLab. All rights reserved. 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 assignme...
7,761
36.497585
79
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/bbox/assigners/sim_ota_assigner.py
# Copyright (c) OpenMMLab. All rights reserved. import warnings import torch import torch.nn.functional as F from ..builder import BBOX_ASSIGNERS from ..iou_calculators import bbox_overlaps from .assign_result import AssignResult from .base_assigner import BaseAssigner @BBOX_ASSIGNERS.register_module() class SimOTA...
11,495
43.55814
79
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/bbox/assigners/atss_assigner.py
# Copyright (c) OpenMMLab. All rights reserved. import warnings import torch from ..builder import BBOX_ASSIGNERS from ..iou_calculators import build_iou_calculator from .assign_result import AssignResult from .base_assigner import BaseAssigner @BBOX_ASSIGNERS.register_module() class ATSSAssigner(BaseAssigner): ...
10,174
42.297872
87
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/bbox/assigners/center_region_assigner.py
# Copyright (c) OpenMMLab. All rights reserved. import torch from ..builder import BBOX_ASSIGNERS from ..iou_calculators import build_iou_calculator from .assign_result import AssignResult from .base_assigner import BaseAssigner def scale_boxes(bboxes, scale): """Expand an array of boxes by a given scale. A...
15,477
44.928783
79
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/bbox/assigners/region_assigner.py
# Copyright (c) OpenMMLab. All rights reserved. import torch from mmdet.core import anchor_inside_flags from ..builder import BBOX_ASSIGNERS from .assign_result import AssignResult from .base_assigner import BaseAssigner def calc_region(bbox, ratio, stride, featmap_size=None): """Calculate region of the box defi...
9,473
41.484305
79
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/bbox/assigners/grid_assigner.py
# Copyright (c) OpenMMLab. All rights reserved. import torch from ..builder import BBOX_ASSIGNERS from ..iou_calculators import build_iou_calculator from .assign_result import AssignResult from .base_assigner import BaseAssigner @BBOX_ASSIGNERS.register_module() class GridAssigner(BaseAssigner): """Assign a corr...
6,863
42.719745
79
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/bbox/assigners/mask_hungarian_assigner.py
# Copyright (c) OpenMMLab. All rights reserved. import torch from scipy.optimize import linear_sum_assignment from mmdet.core.bbox.builder import BBOX_ASSIGNERS from mmdet.core.bbox.match_costs.builder import build_match_cost from .assign_result import AssignResult from .base_assigner import BaseAssigner @BBOX_ASSIG...
5,312
41.166667
77
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/bbox/assigners/hungarian_assigner.py
# Copyright (c) OpenMMLab. All rights reserved. import torch from scipy.optimize import linear_sum_assignment from ..builder import BBOX_ASSIGNERS from ..match_costs import build_match_cost from ..transforms import bbox_cxcywh_to_xyxy from .assign_result import AssignResult from .base_assigner import BaseAssigner @B...
6,439
45
79
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/bbox/assigners/task_aligned_assigner.py
# Copyright (c) OpenMMLab. All rights reserved. import torch from ..builder import BBOX_ASSIGNERS from ..iou_calculators import build_iou_calculator from .assign_result import AssignResult from .base_assigner import BaseAssigner INF = 100000000 @BBOX_ASSIGNERS.register_module() class TaskAlignedAssigner(BaseAssigne...
6,554
42.125
79
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/bbox/assigners/uniform_assigner.py
# Copyright (c) OpenMMLab. All rights reserved. import torch from ..builder import BBOX_ASSIGNERS from ..iou_calculators import build_iou_calculator from ..transforms import bbox_xyxy_to_cxcywh from .assign_result import AssignResult from .base_assigner import BaseAssigner @BBOX_ASSIGNERS.register_module() class Uni...
5,556
39.860294
77
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/bbox/assigners/point_assigner.py
# Copyright (c) OpenMMLab. All rights reserved. import torch from ..builder import BBOX_ASSIGNERS from .assign_result import AssignResult from .base_assigner import BaseAssigner @BBOX_ASSIGNERS.register_module() class PointAssigner(BaseAssigner): """Assign a corresponding gt bbox or background to each point. ...
5,995
43.414815
79
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/bbox/assigners/approx_max_iou_assigner.py
# Copyright (c) OpenMMLab. All rights reserved. import torch from ..builder import BBOX_ASSIGNERS from ..iou_calculators import build_iou_calculator from .max_iou_assigner import MaxIoUAssigner @BBOX_ASSIGNERS.register_module() class ApproxMaxIoUAssigner(MaxIoUAssigner): """Assign a corresponding gt bbox or back...
6,697
44.564626
79
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/bbox/assigners/max_iou_assigner.py
# Copyright (c) OpenMMLab. All rights reserved. import torch from ..builder import BBOX_ASSIGNERS from ..iou_calculators import build_iou_calculator from .assign_result import AssignResult from .base_assigner import BaseAssigner @BBOX_ASSIGNERS.register_module() class MaxIoUAssigner(BaseAssigner): """Assign a co...
10,168
45.43379
79
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/bbox/assigners/ascend_max_iou_assigner.py
# Copyright (c) OpenMMLab. All rights reserved. import torch from ....utils import masked_fill from ..builder import BBOX_ASSIGNERS from ..iou_calculators import build_iou_calculator from .ascend_assign_result import AscendAssignResult from .base_assigner import BaseAssigner @BBOX_ASSIGNERS.register_module() class A...
8,841
48.396648
79
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/bbox/match_costs/match_cost.py
# Copyright (c) OpenMMLab. All rights reserved. import torch import torch.nn.functional as F from mmdet.core.bbox.iou_calculators import bbox_overlaps from mmdet.core.bbox.transforms import bbox_cxcywh_to_xyxy, bbox_xyxy_to_cxcywh from .builder import MATCH_COST @MATCH_COST.register_module() class BBoxL1Cost: ""...
12,651
34.144444
79
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/bbox/coder/yolo_bbox_coder.py
# Copyright (c) OpenMMLab. All rights reserved. import mmcv import torch from ..builder import BBOX_CODERS from .base_bbox_coder import BaseBBoxCoder @BBOX_CODERS.register_module() class YOLOBBoxCoder(BaseBBoxCoder): """YOLO BBox coder. Following `YOLO <https://arxiv.org/abs/1506.02640>`_, this coder divide...
3,252
37.72619
77
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/bbox/coder/distance_point_bbox_coder.py
# Copyright (c) OpenMMLab. All rights reserved. from ..builder import BBOX_CODERS from ..transforms import bbox2distance, distance2bbox from .base_bbox_coder import BaseBBoxCoder @BBOX_CODERS.register_module() class DistancePointBBoxCoder(BaseBBoxCoder): """Distance Point BBox coder. This coder encodes gt bb...
2,481
37.78125
78
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/bbox/coder/bucketing_bbox_coder.py
# Copyright (c) OpenMMLab. All rights reserved. import mmcv import numpy as np import torch import torch.nn.functional as F from ..builder import BBOX_CODERS from ..transforms import bbox_rescale from .base_bbox_coder import BaseBBoxCoder @BBOX_CODERS.register_module() class BucketingBBoxCoder(BaseBBoxCoder): ""...
14,119
39.113636
79
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/bbox/coder/pseudo_bbox_coder.py
# Copyright (c) OpenMMLab. All rights reserved. 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...
577
27.9
60
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/bbox/coder/tblr_bbox_coder.py
# Copyright (c) OpenMMLab. All rights reserved. import mmcv import torch from ..builder import BBOX_CODERS from .base_bbox_coder import BaseBBoxCoder @BBOX_CODERS.register_module() class TBLRBBoxCoder(BaseBBoxCoder): """TBLR BBox coder. Following the practice in `FSAF <https://arxiv.org/abs/1903.00621>`_, ...
8,625
40.671498
78
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/bbox/coder/legacy_delta_xywh_bbox_coder.py
# Copyright (c) OpenMMLab. All rights reserved. import mmcv import numpy as np import torch from ..builder import BBOX_CODERS from .base_bbox_coder import BaseBBoxCoder @BBOX_CODERS.register_module() class LegacyDeltaXYWHBBoxCoder(BaseBBoxCoder): """Legacy Delta XYWH BBox coder used in MMDet V1.x. Following...
8,257
37.0553
79
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/bbox/coder/delta_xywh_bbox_coder.py
# Copyright (c) OpenMMLab. All rights reserved. import warnings import mmcv import numpy as np import torch from ..builder import BBOX_CODERS from .base_bbox_coder import BaseBBoxCoder @BBOX_CODERS.register_module() class DeltaXYWHBBoxCoder(BaseBBoxCoder): """Delta XYWH BBox coder. Following the practice i...
15,978
39.659033
79
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/bbox/iou_calculators/iou2d_calculator.py
# Copyright (c) OpenMMLab. All rights reserved. import torch from .builder import IOU_CALCULATORS def cast_tensor_type(x, scale=1., dtype=None): if dtype == 'fp16': # scale is for preventing overflows x = (x / scale).half() return x def fp16_clamp(x, min=None, max=None): if not x.is_cud...
9,602
35.793103
78
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/bbox/samplers/instance_balanced_pos_sampler.py
# Copyright (c) OpenMMLab. All rights reserved. import numpy as np import torch from ..builder import BBOX_SAMPLERS from .random_sampler import RandomSampler @BBOX_SAMPLERS.register_module() class InstanceBalancedPosSampler(RandomSampler): """Instance balanced sampler that samples equal number of positive sample...
2,319
39.701754
79
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/bbox/samplers/mask_sampling_result.py
# Copyright (c) OpenMMLab. All rights reserved. """copy from https://github.com/ZwwWayne/K-Net/blob/main/knet/det/mask_pseudo_sampler.py.""" import torch from .sampling_result import SamplingResult class MaskSamplingResult(SamplingResult): """Mask sampling result.""" def __init__(self, pos_inds, neg_inds, ...
2,031
32.311475
79
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/bbox/samplers/base_sampler.py
# Copyright (c) OpenMMLab. All rights reserved. from abc import ABCMeta, abstractmethod import torch from .sampling_result import SamplingResult class BaseSampler(metaclass=ABCMeta): """Base class of samplers.""" def __init__(self, num, pos_fraction, neg_p...
3,920
37.067961
79
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/bbox/samplers/random_sampler.py
# Copyright (c) OpenMMLab. All rights reserved. import torch from ..builder import BBOX_SAMPLERS from .base_sampler import BaseSampler @BBOX_SAMPLERS.register_module() class RandomSampler(BaseSampler): """Random sampler. Args: num (int): Number of samples pos_fraction (float): Fraction of po...
3,071
36.012048
78
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/bbox/samplers/ohem_sampler.py
# Copyright (c) OpenMMLab. All rights reserved. import torch from ..builder import BBOX_SAMPLERS from ..transforms import bbox2roi from .base_sampler import BaseSampler @BBOX_SAMPLERS.register_module() class OHEMSampler(BaseSampler): r"""Online Hard Example Mining Sampler described in `Training Region-based ...
4,221
36.696429
79
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/bbox/samplers/iou_balanced_neg_sampler.py
# Copyright (c) OpenMMLab. All rights reserved. import numpy as np import torch from ..builder import BBOX_SAMPLERS from .random_sampler import RandomSampler @BBOX_SAMPLERS.register_module() class IoUBalancedNegSampler(RandomSampler): """IoU Balanced Sampling. arXiv: https://arxiv.org/pdf/1904.02701.pdf (CV...
6,740
41.396226
79
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/bbox/samplers/mask_pseudo_sampler.py
# Copyright (c) OpenMMLab. All rights reserved. """copy from https://github.com/ZwwWayne/K-Net/blob/main/knet/det/mask_pseudo_sampler.py.""" import torch from mmdet.core.bbox.builder import BBOX_SAMPLERS from .base_sampler import BaseSampler from .mask_sampling_result import MaskSamplingResult @BBOX_SAMPLERS.regist...
1,583
34.2
79
py
LineFormer
LineFormer-main/mmdetection/mmdet/core/bbox/samplers/score_hlr_sampler.py
# Copyright (c) OpenMMLab. All rights reserved. import torch from mmcv.ops import nms_match from ..builder import BBOX_SAMPLERS from ..transforms import bbox2roi from .base_sampler import BaseSampler from .sampling_result import SamplingResult @BBOX_SAMPLERS.register_module() class ScoreHLRSampler(BaseSampler): ...
11,235
41.240602
79
py