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 |
|---|---|---|---|---|---|---|
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/configs/gn+ws/mask_rcnn_r101_fpn_gn_ws-all_2x_coco.py | _base_ = './mask_rcnn_r50_fpn_gn_ws-all_2x_coco.py'
model = dict(
backbone=dict(
depth=101,
init_cfg=dict(
type='Pretrained', checkpoint='open-mmlab://jhu/resnet101_gn_ws')))
| 207 | 28.714286 | 79 | py |
DSLA-DSLA | DSLA-DSLA/configs/gn+ws/mask_rcnn_r101_fpn_gn_ws-all_20_23_24e_coco.py | _base_ = './mask_rcnn_r101_fpn_gn_ws-all_2x_coco.py'
# learning policy
lr_config = dict(step=[20, 23])
runner = dict(type='EpochBasedRunner', max_epochs=24)
| 157 | 30.6 | 53 | py |
DSLA-DSLA | DSLA-DSLA/configs/gn+ws/faster_rcnn_r101_fpn_gn_ws-all_1x_coco.py | _base_ = './faster_rcnn_r50_fpn_gn_ws-all_1x_coco.py'
model = dict(
backbone=dict(
depth=101,
init_cfg=dict(
type='Pretrained', checkpoint='open-mmlab://jhu/resnet101_gn_ws')))
| 209 | 29 | 79 | py |
DSLA-DSLA | DSLA-DSLA/configs/gn+ws/faster_rcnn_r50_fpn_gn_ws-all_1x_coco.py | _base_ = '../faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py'
conv_cfg = dict(type='ConvWS')
norm_cfg = dict(type='GN', num_groups=32, requires_grad=True)
model = dict(
backbone=dict(
conv_cfg=conv_cfg,
norm_cfg=norm_cfg,
init_cfg=dict(
type='Pretrained', checkpoint='open-mmlab://jhu/... | 577 | 33 | 78 | py |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/configs/gn+ws/mask_rcnn_x101_32x4d_fpn_gn_ws-all_20_23_24e_coco.py | _base_ = './mask_rcnn_x101_32x4d_fpn_gn_ws-all_2x_coco.py'
# learning policy
lr_config = dict(step=[20, 23])
runner = dict(type='EpochBasedRunner', max_epochs=24)
| 163 | 31.8 | 58 | py |
DSLA-DSLA | DSLA-DSLA/configs/gn+ws/mask_rcnn_r50_fpn_gn_ws-all_2x_coco.py | _base_ = '../mask_rcnn/mask_rcnn_r50_fpn_1x_coco.py'
conv_cfg = dict(type='ConvWS')
norm_cfg = dict(type='GN', num_groups=32, requires_grad=True)
model = dict(
backbone=dict(
conv_cfg=conv_cfg,
norm_cfg=norm_cfg,
init_cfg=dict(
type='Pretrained', checkpoint='open-mmlab://jhu/resn... | 739 | 34.238095 | 78 | py |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/configs/guided_anchoring/ga_faster_r50_fpn_1x_coco.py | _base_ = '../faster_rcnn/faster_rcnn_r50_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... | 2,402 | 35.409091 | 77 | py |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/configs/guided_anchoring/ga_rpn_r50_fpn_1x_coco.py | _base_ = '../rpn/rpn_r50_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,022 | 33.288136 | 74 | py |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/configs/guided_anchoring/ga_retinanet_r50_fpn_1x_coco.py | _base_ = '../retinanet/retinanet_r50_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,049 | 31.539683 | 74 | py |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/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,719 | 29.743802 | 139 | py |
DSLA-DSLA | DSLA-DSLA/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,741 | 29.672131 | 138 | py |
DSLA-DSLA | DSLA-DSLA/configs/sparse_rcnn/sparse_rcnn_r50_fpn_300_proposals_crop_mstrain_480-800_3x_coco.py | _base_ = './sparse_rcnn_r50_fpn_mstrain_480-800_3x_coco.py'
num_proposals = 300
model = dict(
rpn_head=dict(num_proposals=num_proposals),
test_cfg=dict(
_delete_=True, rpn=None, rcnn=dict(max_per_img=num_proposals)))
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], t... | 2,191 | 40.358491 | 78 | py |
DSLA-DSLA | DSLA-DSLA/configs/sparse_rcnn/sparse_rcnn_r50_fpn_mstrain_480-800_3x_coco.py | _base_ = './sparse_rcnn_r50_fpn_1x_coco.py'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
min_values = (480, 512, 544, 576, 608, 640, 672, 704, 736, 768, 800)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations', with_bbox=True),
... | 853 | 34.583333 | 77 | py |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/configs/cityscapes/faster_rcnn_r50_fpn_1x_cityscapes.py | _base_ = [
'../_base_/models/faster_rcnn_r50_fpn.py',
'../_base_/datasets/cityscapes_detection.py',
'../_base_/default_runtime.py'
]
model = dict(
backbone=dict(init_cfg=None),
roi_head=dict(
bbox_head=dict(
type='Shared2FCBBoxHead',
in_channels=256,
fc_ou... | 1,462 | 35.575 | 159 | py |
DSLA-DSLA | DSLA-DSLA/configs/cityscapes/mask_rcnn_r50_fpn_1x_cityscapes.py | _base_ = [
'../_base_/models/mask_rcnn_r50_fpn.py',
'../_base_/datasets/cityscapes_instance.py', '../_base_/default_runtime.py'
]
model = dict(
backbone=dict(init_cfg=None),
roi_head=dict(
bbox_head=dict(
type='Shared2FCBBoxHead',
in_channels=256,
fc_out_chann... | 1,724 | 35.702128 | 153 | py |
DSLA-DSLA | DSLA-DSLA/configs/deepfashion/mask_rcnn_r50_fpn_15e_deepfashion.py | _base_ = [
'../_base_/models/mask_rcnn_r50_fpn.py',
'../_base_/datasets/deepfashion.py', '../_base_/schedules/schedule_1x.py',
'../_base_/default_runtime.py'
]
model = dict(
roi_head=dict(
bbox_head=dict(num_classes=15), mask_head=dict(num_classes=15)))
# runtime settings
runner = dict(type='Epo... | 351 | 31 | 78 | py |
DSLA-DSLA | DSLA-DSLA/configs/gn/mask_rcnn_r50_fpn_gn-all_3x_coco.py | _base_ = './mask_rcnn_r50_fpn_gn-all_2x_coco.py'
# learning policy
lr_config = dict(step=[28, 34])
runner = dict(type='EpochBasedRunner', max_epochs=36)
| 154 | 24.833333 | 53 | py |
DSLA-DSLA | DSLA-DSLA/configs/gn/mask_rcnn_r101_fpn_gn-all_2x_coco.py | _base_ = './mask_rcnn_r50_fpn_gn-all_2x_coco.py'
model = dict(
backbone=dict(
depth=101,
init_cfg=dict(
type='Pretrained',
checkpoint='open-mmlab://detectron/resnet101_gn')))
| 219 | 26.5 | 63 | py |
DSLA-DSLA | DSLA-DSLA/configs/gn/mask_rcnn_r50_fpn_gn-all_2x_coco.py | _base_ = '../mask_rcnn/mask_rcnn_r50_fpn_1x_coco.py'
norm_cfg = dict(type='GN', num_groups=32, requires_grad=True)
model = dict(
backbone=dict(
norm_cfg=norm_cfg,
init_cfg=dict(
type='Pretrained',
checkpoint='open-mmlab://detectron/resnet50_gn')),
neck=dict(norm_cfg=norm_... | 1,755 | 34.12 | 77 | py |
DSLA-DSLA | DSLA-DSLA/configs/gn/mask_rcnn_r50_fpn_gn-all_contrib_2x_coco.py | _base_ = '../mask_rcnn/mask_rcnn_r50_fpn_1x_coco.py'
norm_cfg = dict(type='GN', num_groups=32, requires_grad=True)
model = dict(
backbone=dict(
norm_cfg=norm_cfg,
init_cfg=dict(
type='Pretrained', checkpoint='open-mmlab://contrib/resnet50_gn')),
neck=dict(norm_cfg=norm_cfg),
roi_... | 613 | 33.111111 | 79 | py |
DSLA-DSLA | DSLA-DSLA/configs/gn/mask_rcnn_r50_fpn_gn-all_contrib_3x_coco.py | _base_ = './mask_rcnn_r50_fpn_gn-all_contrib_2x_coco.py'
# learning policy
lr_config = dict(step=[28, 34])
runner = dict(type='EpochBasedRunner', max_epochs=36)
| 162 | 26.166667 | 56 | py |
DSLA-DSLA | DSLA-DSLA/configs/gn/mask_rcnn_r101_fpn_gn-all_3x_coco.py | _base_ = './mask_rcnn_r101_fpn_gn-all_2x_coco.py'
# learning policy
lr_config = dict(step=[28, 34])
runner = dict(type='EpochBasedRunner', max_epochs=36)
| 155 | 25 | 53 | py |
DSLA-DSLA | DSLA-DSLA/docs/en/stat.py | #!/usr/bin/env python
import functools as func
import glob
import os.path as osp
import re
import numpy as np
url_prefix = 'https://github.com/open-mmlab/mmdetection/blob/master/'
files = sorted(glob.glob('../configs/*/README.md'))
stats = []
titles = []
num_ckpts = 0
for f in files:
url = osp.dirname(f.replac... | 1,519 | 22.384615 | 74 | py |
DSLA-DSLA | DSLA-DSLA/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,373 | 28.596491 | 79 | py |
DSLA-DSLA | DSLA-DSLA/docs/zh_cn/stat.py | #!/usr/bin/env python
import functools as func
import glob
import os.path as osp
import re
import numpy as np
url_prefix = 'https://github.com/open-mmlab/mmdetection/blob/master/'
files = sorted(glob.glob('../configs/*/README.md'))
stats = []
titles = []
num_ckpts = 0
for f in files:
url = osp.dirname(f.replac... | 1,519 | 22.384615 | 74 | py |
DSLA-DSLA | DSLA-DSLA/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,395 | 28.275862 | 79 | py |
DSLA-DSLA | DSLA-DSLA/mmdet/version.py | # Copyright (c) OpenMMLab. All rights reserved.
__version__ = '2.20.0'
short_version = __version__
def parse_version_info(version_str):
version_info = []
for x in version_str.split('.'):
if x.isdigit():
version_info.append(int(x))
elif x.find('rc') != -1:
patch_version... | 529 | 25.5 | 56 | py |
DSLA-DSLA | DSLA-DSLA/mmdet/__init__.py | # Copyright (c) OpenMMLab. All rights reserved.
import mmcv
from .version import __version__, short_version
def digit_version(version_str):
digit_version = []
for x in version_str.split('.'):
if x.isdigit():
digit_version.append(int(x))
elif x.find('rc') != -1:
patch_v... | 909 | 29.333333 | 77 | py |
DSLA-DSLA | DSLA-DSLA/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... | 7,980 | 32.116183 | 79 | py |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/mmdet/apis/__init__.py | # Copyright (c) OpenMMLab. All rights reserved.
from .inference import (async_inference_detector, inference_detector,
init_detector, show_result_pyplot)
from .test import multi_gpu_test, single_gpu_test
from .train import (get_root_logger, init_random_seed, set_random_seed,
t... | 563 | 42.384615 | 76 | py |
DSLA-DSLA | DSLA-DSLA/mmdet/apis/train.py | # Copyright (c) OpenMMLab. All rights reserved.
import random
import warnings
import numpy as np
import torch
import torch.distributed as dist
from mmcv.parallel import MMDataParallel, MMDistributedDataParallel
from mmcv.runner import (DistSamplerSeedHook, EpochBasedRunner,
Fp16OptimizerHook, ... | 7,445 | 34.457143 | 79 | py |
DSLA-DSLA | DSLA-DSLA/mmdet/core/__init__.py | # Copyright (c) OpenMMLab. All rights reserved.
from .anchor import * # noqa: F401, F403
from .bbox import * # noqa: F401, F403
from .data_structures import * # noqa: F401, F403
from .evaluation import * # noqa: F401, F403
from .hook import * # noqa: F401, F403
from .mask import * # noqa: F401, F403
from .post_pr... | 399 | 39 | 50 | py |
DSLA-DSLA | DSLA-DSLA/mmdet/core/evaluation/class_names.py | # Copyright (c) OpenMMLab. All rights reserved.
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'... | 5,474 | 45.398305 | 79 | py |
DSLA-DSLA | DSLA-DSLA/mmdet/core/evaluation/recall.py | # Copyright (c) OpenMMLab. All rights reserved.
from collections.abc import Sequence
import numpy as np
from mmcv.utils import print_log
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... | 6,806 | 33.378788 | 79 | py |
DSLA-DSLA | DSLA-DSLA/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... | 4,942 | 37.92126 | 76 | py |
DSLA-DSLA | DSLA-DSLA/mmdet/core/evaluation/__init__.py | # Copyright (c) OpenMMLab. All rights reserved.
from .class_names import (cityscapes_classes, coco_classes, dataset_aliases,
get_classes, imagenet_det_classes,
imagenet_vid_classes, voc_classes)
from .eval_hooks import DistEvalHook, EvalHook
from .mean_ap import avera... | 803 | 46.294118 | 76 | py |
DSLA-DSLA | DSLA-DSLA/mmdet/core/evaluation/bbox_overlaps.py | # Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
def bbox_overlaps(bboxes1,
bboxes2,
mode='iou',
eps=1e-6,
use_legacy_coordinate=False):
"""Calculate the ious between each bbox of bboxes1 and bboxes2.
Args:
bbox... | 2,454 | 36.19697 | 86 | py |
DSLA-DSLA | DSLA-DSLA/mmdet/core/evaluation/mean_ap.py | # Copyright (c) OpenMMLab. All rights reserved.
from multiprocessing import Pool
import mmcv
import numpy as np
from mmcv.utils import print_log
from terminaltables import AsciiTable
from .bbox_overlaps import bbox_overlaps
from .class_names import get_classes
def average_precision(recalls, precisions, mode='area')... | 20,724 | 39.637255 | 79 | py |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/mmdet/core/post_processing/__init__.py | # Copyright (c) OpenMMLab. All rights reserved.
from .bbox_nms import fast_nms, multiclass_nms
from .matrix_nms import mask_matrix_nms
from .merge_augs import (merge_aug_bboxes, merge_aug_masks,
merge_aug_proposals, merge_aug_scores)
__all__ = [
'multiclass_nms', 'merge_aug_proposals', 'me... | 412 | 36.545455 | 72 | py |
DSLA-DSLA | DSLA-DSLA/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... | 40,241 | 36.539179 | 141 | py |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/mmdet/core/mask/utils.py | # Copyright (c) OpenMMLab. All rights reserved.
import mmcv
import numpy as np
import pycocotools.mask as mask_util
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. I... | 2,339 | 35 | 75 | py |
DSLA-DSLA | DSLA-DSLA/mmdet/core/mask/__init__.py | # Copyright (c) OpenMMLab. All rights reserved.
from .mask_target import mask_target
from .structures import BaseInstanceMasks, BitmapMasks, PolygonMasks
from .utils import encode_mask_results, split_combined_polys
__all__ = [
'split_combined_polys', 'mask_target', 'BaseInstanceMasks', 'BitmapMasks',
'PolygonM... | 351 | 34.2 | 78 | py |
DSLA-DSLA | DSLA-DSLA/mmdet/core/hook/set_epoch_info_hook.py | # Copyright (c) OpenMMLab. All rights reserved.
from mmcv.parallel import is_module_wrapper
from mmcv.runner import HOOKS, Hook
@HOOKS.register_module()
class SetEpochInfoHook(Hook):
"""Set runner's epoch information to the model."""
def before_train_epoch(self, runner):
epoch = runner.epoch
... | 442 | 26.6875 | 54 | py |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/mmdet/core/hook/yolox_lrupdater_hook.py | # Copyright (c) OpenMMLab. All rights reserved.
from mmcv.runner.hooks import HOOKS
from mmcv.runner.hooks.lr_updater import (CosineAnnealingLrUpdaterHook,
annealing_cos)
@HOOKS.register_module()
class YOLOXLrUpdaterHook(CosineAnnealingLrUpdaterHook):
"""YOLOX learning ra... | 2,310 | 32.985294 | 78 | py |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/mmdet/core/hook/yolox_mode_switch_hook.py | # Copyright (c) OpenMMLab. All rights reserved.
from mmcv.parallel import is_module_wrapper
from mmcv.runner.hooks import HOOKS, Hook
@HOOKS.register_module()
class YOLOXModeSwitchHook(Hook):
"""Switch the mode of YOLOX during training.
This hook turns off the mosaic and mixup data augmentation and switches
... | 2,270 | 41.849057 | 78 | py |
DSLA-DSLA | DSLA-DSLA/mmdet/core/hook/__init__.py | # Copyright (c) OpenMMLab. All rights reserved.
from .checkloss_hook import CheckInvalidLossHook
from .ema import ExpMomentumEMAHook, LinearMomentumEMAHook
from .set_epoch_info_hook import SetEpochInfoHook
from .sync_norm_hook import SyncNormHook
from .sync_random_size_hook import SyncRandomSizeHook
from .yolox_lrupdat... | 610 | 39.733333 | 72 | py |
DSLA-DSLA | DSLA-DSLA/mmdet/core/hook/ema.py | # Copyright (c) OpenMMLab. All rights reserved.
import math
from mmcv.parallel import is_module_wrapper
from mmcv.runner.hooks import HOOKS, Hook
class BaseEMAHook(Hook):
"""Exponential Moving Average Hook.
Use Exponential Moving Average on all parameters of model in training
process. All parameters hav... | 5,150 | 38.320611 | 78 | py |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/mmdet/core/bbox/__init__.py | # Copyright (c) OpenMMLab. All rights reserved.
from .assigners import (AssignResult, BaseAssigner, CenterRegionAssigner,
MaxIoUAssigner, RegionAssigner)
from .builder import build_assigner, build_bbox_coder, build_sampler
from .coder import (BaseBBoxCoder, DeltaXYWHBBoxCoder, DistancePointBBoxC... | 1,688 | 57.241379 | 78 | py |
DSLA-DSLA | DSLA-DSLA/mmdet/core/bbox/builder.py | # Copyright (c) OpenMMLab. All rights reserved.
from mmcv.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_cf... | 628 | 27.590909 | 60 | py |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/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,753 | 36.640777 | 79 | py |
DSLA-DSLA | DSLA-DSLA/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,381 | 43.635294 | 79 | py |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/mmdet/core/bbox/assigners/base_assigner.py | # Copyright (c) OpenMMLab. All rights reserved.
from abc import ABCMeta, abstractmethod
class BaseAssigner(metaclass=ABCMeta):
"""Base assigner that assigns boxes to ground truth boxes."""
@abstractmethod
def assign(self, bboxes, gt_bboxes, gt_bboxes_ignore=None, gt_labels=None):
"""Assign boxes ... | 375 | 33.181818 | 79 | py |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/mmdet/core/bbox/assigners/__init__.py | # Copyright (c) OpenMMLab. All rights reserved.
from .approx_max_iou_assigner import ApproxMaxIoUAssigner
from .assign_result import AssignResult
from .atss_assigner import ATSSAssigner
from .base_assigner import BaseAssigner
from .center_region_assigner import CenterRegionAssigner
from .grid_assigner import GridAssign... | 926 | 41.136364 | 79 | py |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/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... | 9,798 | 44.78972 | 79 | py |
DSLA-DSLA | DSLA-DSLA/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 |
DSLA-DSLA | DSLA-DSLA/mmdet/core/bbox/match_costs/__init__.py | # Copyright (c) OpenMMLab. All rights reserved.
from .builder import build_match_cost
from .match_cost import BBoxL1Cost, ClassificationCost, FocalLossCost, IoUCost
__all__ = [
'build_match_cost', 'ClassificationCost', 'BBoxL1Cost', 'IoUCost',
'FocalLossCost'
]
| 271 | 29.222222 | 78 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.