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
PseCo
PseCo-master/thirdparty/mmdetection/configs/rpn/rpn_r101_fpn_2x_coco.py
_base_ = './rpn_r50_fpn_2x_coco.py' model = dict( backbone=dict( depth=101, init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet101')))
191
26.428571
61
py
PseCo
PseCo-master/thirdparty/mmdetection/configs/deformable_detr/deformable_detr_r50_16x2_50e_coco.py
_base_ = [ '../_base_/datasets/coco_detection.py', '../_base_/default_runtime.py' ] model = dict( type='DeformableDETR', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=False)...
6,478
36.450867
79
py
PseCo
PseCo-master/thirdparty/mmdetection/configs/lvis/mask_rcnn_x101_64x4d_fpn_sample1e-3_mstrain_1x_lvis_v1.py
_base_ = './mask_rcnn_r50_fpn_sample1e-3_mstrain_1x_lvis_v1.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), ...
441
28.466667
76
py
PseCo
PseCo-master/thirdparty/mmdetection/configs/lvis/mask_rcnn_r101_fpn_sample1e-3_mstrain_2x_lvis_v0.5.py
_base_ = './mask_rcnn_r50_fpn_sample1e-3_mstrain_2x_lvis_v0.5.py' model = dict( backbone=dict( depth=101, init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet101')))
221
30.714286
65
py
PseCo
PseCo-master/thirdparty/mmdetection/configs/lvis/mask_rcnn_x101_64x4d_fpn_sample1e-3_mstrain_2x_lvis_v0.5.py
_base_ = './mask_rcnn_r50_fpn_sample1e-3_mstrain_2x_lvis_v0.5.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), ...
443
28.6
76
py
PseCo
PseCo-master/thirdparty/mmdetection/configs/lvis/mask_rcnn_x101_32x4d_fpn_sample1e-3_mstrain_2x_lvis_v0.5.py
_base_ = './mask_rcnn_r50_fpn_sample1e-3_mstrain_2x_lvis_v0.5.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), ...
443
28.6
76
py
PseCo
PseCo-master/thirdparty/mmdetection/configs/lvis/mask_rcnn_x101_32x4d_fpn_sample1e-3_mstrain_1x_lvis_v1.py
_base_ = './mask_rcnn_r50_fpn_sample1e-3_mstrain_1x_lvis_v1.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), ...
441
28.466667
76
py
PseCo
PseCo-master/thirdparty/mmdetection/configs/lvis/mask_rcnn_r101_fpn_sample1e-3_mstrain_1x_lvis_v1.py
_base_ = './mask_rcnn_r50_fpn_sample1e-3_mstrain_1x_lvis_v1.py' model = dict( backbone=dict( depth=101, init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet101')))
219
30.428571
63
py
PseCo
PseCo-master/thirdparty/mmdetection/configs/yolof/yolof_r50_c5_8x8_1x_coco.py
_base_ = [ '../_base_/datasets/coco_detection.py', '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py' ] model = dict( type='YOLOF', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(3, ), frozen_stages=1, norm_cfg=dict(ty...
3,279
29.943396
77
py
PseCo
PseCo-master/thirdparty/mmdetection/configs/instaboost/mask_rcnn_x101_64x4d_fpn_instaboost_4x_coco.py
_base_ = './mask_rcnn_r50_fpn_instaboost_4x_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='...
430
27.733333
76
py
PseCo
PseCo-master/thirdparty/mmdetection/configs/instaboost/mask_rcnn_r101_fpn_instaboost_4x_coco.py
_base_ = './mask_rcnn_r50_fpn_instaboost_4x_coco.py' model = dict( backbone=dict( depth=101, init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet101')))
208
28.857143
61
py
PseCo
PseCo-master/thirdparty/mmdetection/configs/instaboost/cascade_mask_rcnn_r101_fpn_instaboost_4x_coco.py
_base_ = './cascade_mask_rcnn_r50_fpn_instaboost_4x_coco.py' model = dict( backbone=dict( depth=101, init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet101')))
217
26.25
61
py
PseCo
PseCo-master/thirdparty/mmdetection/configs/instaboost/cascade_mask_rcnn_x101_64x4d_fpn_instaboost_4x_coco.py
_base_ = './cascade_mask_rcnn_r50_fpn_instaboost_4x_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), ...
438
28.266667
76
py
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/mmdetection/mmdet/apis/inference.py
# Copyright (c) OpenMMLab. All rights reserved. import warnings 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_ImageToTensor from mmdet.dat...
8,035
32.206612
79
py
PseCo
PseCo-master/thirdparty/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...
6,874
34.807292
79
py
PseCo
PseCo-master/thirdparty/mmdetection/mmdet/apis/train.py
# Copyright (c) OpenMMLab. All rights reserved. import random import warnings import numpy as np import torch from mmcv.parallel import MMDataParallel, MMDistributedDataParallel from mmcv.runner import (HOOKS, DistSamplerSeedHook, EpochBasedRunner, Fp16OptimizerHook, OptimizerHook, build_optim...
6,574
36.571429
79
py
PseCo
PseCo-master/thirdparty/mmdetection/mmdet/core/evaluation/eval_hooks.py
# Copyright (c) OpenMMLab. All rights reserved. import os.path as osp 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 class EvalHook(BaseEvalHook): def _do_evaluate(self, ...
2,211
34.677419
76
py
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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,461
36.569767
78
py
PseCo
PseCo-master/thirdparty/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...
38,817
36.360924
141
py
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/mmdetection/mmdet/core/hook/sync_random_size_hook.py
# Copyright (c) OpenMMLab. All rights reserved. import random 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 across ranks, c...
2,116
35.5
75
py
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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,728
32.901961
77
py
PseCo
PseCo-master/thirdparty/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,472
39.61413
79
py
PseCo
PseCo-master/thirdparty/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, ...
6,194
36.77439
78
py
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/mmdetection/mmdet/core/bbox/transforms.py
# Copyright (c) OpenMMLab. All rights reserved. import numpy as np import torch def bbox_flip(bboxes, img_shape, direction='horizontal'): """Flip bboxes horizontally or vertically. Args: bboxes (Tensor): Shape (..., 4*k) img_shape (tuple): Image shape. direction (str): Flip direction,...
8,277
32.379032
79
py
PseCo
PseCo-master/thirdparty/mmdetection/mmdet/core/bbox/assigners/assign_result.py
# Copyright (c) OpenMMLab. All rights reserved. import torch from mmdet.utils import util_mixins import ipdb 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 ...
7,764
36.694175
79
py
PseCo
PseCo-master/thirdparty/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,296
43.301961
79
py
PseCo
PseCo-master/thirdparty/mmdetection/mmdet/core/bbox/assigners/atss_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 ATSSAssigner(BaseAssigner): """Assign a corr...
7,809
42.388889
87
py
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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,864
42.726115
79
py
PseCo
PseCo-master/thirdparty/mmdetection/mmdet/core/bbox/assigners/hungarian_assigner.py
# Copyright (c) OpenMMLab. All rights reserved. import torch 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 try: from scipy.optimize import linear_sum_assig...
6,665
44.346939
79
py
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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 import ipdb @BBOX_ASSIGNERS.register_module() class MaxIoUAssigner(BaseAssigner): ""...
9,810
44.845794
79
py
PseCo
PseCo-master/thirdparty/mmdetection/mmdet/core/bbox/match_costs/match_cost.py
# Copyright (c) OpenMMLab. All rights reserved. import torch 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: """BBoxL1Cost. Args: ...
6,342
33.102151
79
py
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/mmdetection/mmdet/core/bbox/coder/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 DeltaXYWHBBoxCoder(BaseBBoxCoder): """Delta XYWH BBox coder. Following the practice in `R-CNN <https:/...
10,945
39.095238
79
py
PseCo
PseCo-master/thirdparty/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,678
35.942748
78
py
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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 import ipdb class BaseSampler(metaclass=ABCMeta): """Base class of samplers.""" def __init__(self, num, pos_fraction, ...
3,931
37.174757
79
py
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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,146
37.045872
79
py
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/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
PseCo
PseCo-master/thirdparty/mmdetection/mmdet/core/bbox/samplers/sampling_result.py
# Copyright (c) OpenMMLab. All rights reserved. import torch from mmdet.utils import util_mixins class SamplingResult(util_mixins.NiceRepr): """Bbox sampling result. Example: >>> # xdoctest: +IGNORE_WANT >>> from mmdet.core.bbox.samplers.sampling_result import * # NOQA >>> self = Sa...
5,382
33.954545
81
py
PseCo
PseCo-master/thirdparty/mmdetection/mmdet/core/bbox/samplers/pseudo_sampler.py
# Copyright (c) OpenMMLab. All rights reserved. import torch from ..builder import BBOX_SAMPLERS from .base_sampler import BaseSampler from .sampling_result import SamplingResult @BBOX_SAMPLERS.register_module() class PseudoSampler(BaseSampler): """A pseudo sampler that does not do sampling actually.""" def...
1,463
33.046512
79
py
PseCo
PseCo-master/thirdparty/mmdetection/mmdet/core/utils/dist_utils.py
# Copyright (c) OpenMMLab. All rights reserved. import functools import pickle import warnings from collections import OrderedDict import torch import torch.distributed as dist from mmcv.runner import OptimizerHook, get_dist_info from torch._utils import (_flatten_dense_tensors, _take_tensors, ...
4,967
32.12
77
py
PseCo
PseCo-master/thirdparty/mmdetection/mmdet/core/utils/misc.py
# Copyright (c) OpenMMLab. All rights reserved. from functools import partial import numpy as np import torch from six.moves import map, zip from ..mask.structures import BitmapMasks, PolygonMasks def multi_apply(func, *args, **kwargs): """Apply function to a list of arguments. Note: This function ...
2,663
29.976744
79
py
PseCo
PseCo-master/thirdparty/mmdetection/mmdet/core/anchor/point_generator.py
# Copyright (c) OpenMMLab. All rights reserved. import numpy as np import torch from torch.nn.modules.utils import _pair from .builder import PRIOR_GENERATORS @PRIOR_GENERATORS.register_module() class PointGenerator: def _meshgrid(self, x, y, row_major=True): xx = x.repeat(len(y)) yy = y.view(-1...
9,830
39.45679
79
py
PseCo
PseCo-master/thirdparty/mmdetection/mmdet/core/anchor/anchor_generator.py
# Copyright (c) OpenMMLab. All rights reserved. import warnings import mmcv import numpy as np import torch from torch.nn.modules.utils import _pair from .builder import PRIOR_GENERATORS @PRIOR_GENERATORS.register_module() class AnchorGenerator: """Standard anchor generator for 2D anchor-based detectors. A...
36,717
41.794872
79
py
PseCo
PseCo-master/thirdparty/mmdetection/mmdet/core/anchor/utils.py
# Copyright (c) OpenMMLab. All rights reserved. import torch import ipdb def images_to_levels(target, num_levels): """Convert targets by image to targets by feature level. [target_img0, target_img1] -> [target_level0, target_level1, ...] """ target = torch.stack(target, 0) level_targets = [] s...
3,029
33.431818
79
py
PseCo
PseCo-master/thirdparty/mmdetection/mmdet/models/detectors/two_stage.py
# Copyright (c) OpenMMLab. All rights reserved. import warnings import torch import mmcv import cv2 import os from ..builder import DETECTORS, build_backbone, build_head, build_neck from .base import BaseDetector import ipdb @DETECTORS.register_module() class TwoStageDetector(BaseDetector): """Base class for two...
8,381
36.756757
148
py
PseCo
PseCo-master/thirdparty/mmdetection/mmdet/models/detectors/base.py
# Copyright (c) OpenMMLab. All rights reserved. from abc import ABCMeta, abstractmethod from collections import OrderedDict import mmcv import numpy as np import torch import torch.distributed as dist from mmcv.runner import BaseModule, auto_fp16 from mmdet.core.visualization import imshow_det_bboxes import os import...
15,043
39.659459
82
py
PseCo
PseCo-master/thirdparty/mmdetection/mmdet/models/detectors/single_stage.py
# Copyright (c) OpenMMLab. All rights reserved. import warnings import torch from mmdet.core import bbox2result from ..builder import DETECTORS, build_backbone, build_head, build_neck from .base import BaseDetector @DETECTORS.register_module() class SingleStageDetector(BaseDetector): """Base class for single-st...
6,509
37.982036
78
py
PseCo
PseCo-master/thirdparty/mmdetection/mmdet/models/detectors/detr.py
# Copyright (c) OpenMMLab. All rights reserved. import warnings import torch from ..builder import DETECTORS from .single_stage import SingleStageDetector @DETECTORS.register_module() class DETR(SingleStageDetector): r"""Implementation of `DETR: End-to-End Object Detection with Transformers <https://arxiv.o...
2,483
33.985915
79
py