Search is not available for this dataset
repo
stringlengths
2
152
file
stringlengths
15
239
code
stringlengths
0
58.4M
file_length
int64
0
58.4M
avg_line_length
float64
0
1.81M
max_line_length
int64
0
12.7M
extension_type
stringclasses
364 values
mmdetection
mmdetection-master/mmdet/datasets/openimages.py
# Copyright (c) OpenMMLab. All rights reserved. import copy import csv import json import os.path as osp import warnings from collections import OrderedDict, defaultdict import mmcv import numpy as np import torch.distributed as dist from mmcv.runner import get_dist_info from mmcv.utils import print_log from mmdet.co...
35,084
38.33296
79
py
mmdetection
mmdetection-master/mmdet/datasets/utils.py
# Copyright (c) OpenMMLab. All rights reserved. import copy import warnings from mmcv.cnn import VGG from mmcv.runner.hooks import HOOKS, Hook from mmdet.datasets.builder import PIPELINES from mmdet.datasets.pipelines import (LoadAnnotations, LoadImageFromFile, LoadPanopticAnnota...
6,670
38.946108
78
py
mmdetection
mmdetection-master/mmdet/datasets/voc.py
# Copyright (c) OpenMMLab. All rights reserved. from collections import OrderedDict from mmcv.utils import print_log from mmdet.core import eval_map, eval_recalls from .builder import DATASETS from .xml_style import XMLDataset @DATASETS.register_module() class VOCDataset(XMLDataset): CLASSES = ('aeroplane', 'b...
4,724
40.814159
90
py
mmdetection
mmdetection-master/mmdet/datasets/wider_face.py
# Copyright (c) OpenMMLab. All rights reserved. import os.path as osp import xml.etree.ElementTree as ET import mmcv from .builder import DATASETS from .xml_style import XMLDataset @DATASETS.register_module() class WIDERFaceDataset(XMLDataset): """Reader for the WIDER Face dataset in PASCAL VOC format. Con...
1,578
27.709091
68
py
mmdetection
mmdetection-master/mmdet/datasets/xml_style.py
# Copyright (c) OpenMMLab. All rights reserved. import os.path as osp import xml.etree.ElementTree as ET import mmcv import numpy as np from PIL import Image from .builder import DATASETS from .custom import CustomDataset @DATASETS.register_module() class XMLDataset(CustomDataset): """XML dataset for detection....
6,243
33.882682
79
py
mmdetection
mmdetection-master/mmdet/datasets/api_wrappers/__init__.py
# Copyright (c) OpenMMLab. All rights reserved. from .coco_api import COCO, COCOeval from .panoptic_evaluation import pq_compute_multi_core, pq_compute_single_core __all__ = [ 'COCO', 'COCOeval', 'pq_compute_multi_core', 'pq_compute_single_core' ]
253
30.75
78
py
mmdetection
mmdetection-master/mmdet/datasets/api_wrappers/coco_api.py
# Copyright (c) OpenMMLab. All rights reserved. # This file add snake case alias for coco api import warnings import pycocotools from pycocotools.coco import COCO as _COCO from pycocotools.cocoeval import COCOeval as _COCOeval class COCO(_COCO): """This class is almost the same as official pycocotools package. ...
1,506
30.395833
126
py
mmdetection
mmdetection-master/mmdet/datasets/api_wrappers/panoptic_evaluation.py
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) 2018, Alexander Kirillov # This file supports `file_client` for `panopticapi`, # the source code is copied from `panopticapi`, # only the way to load the gt images is modified. import multiprocessing import os import mmcv import numpy as np try: fro...
9,113
38.799127
79
py
mmdetection
mmdetection-master/mmdet/datasets/pipelines/__init__.py
# Copyright (c) OpenMMLab. All rights reserved. from .auto_augment import (AutoAugment, BrightnessTransform, ColorTransform, ContrastTransform, EqualizeTransform, Rotate, Shear, Translate) from .compose import Compose from .formatting import (Collect, DefaultFormatB...
1,807
55.5
79
py
mmdetection
mmdetection-master/mmdet/datasets/pipelines/auto_augment.py
# Copyright (c) OpenMMLab. All rights reserved. import copy import cv2 import mmcv import numpy as np from ..builder import PIPELINES from .compose import Compose _MAX_LEVEL = 10 def level_to_value(level, max_value): """Map from level to values based on max_value.""" return (level / _MAX_LEVEL) * max_value...
36,538
39.825698
79
py
mmdetection
mmdetection-master/mmdet/datasets/pipelines/compose.py
# Copyright (c) OpenMMLab. All rights reserved. import collections from mmcv.utils import build_from_cfg from ..builder import PIPELINES @PIPELINES.register_module() class Compose: """Compose multiple transforms sequentially. Args: transforms (Sequence[dict | callable]): Sequence of transform objec...
1,626
28.053571
79
py
mmdetection
mmdetection-master/mmdet/datasets/pipelines/formating.py
# Copyright (c) OpenMMLab. All rights reserved. # flake8: noqa import warnings from .formatting import * warnings.warn('DeprecationWarning: mmdet.datasets.pipelines.formating will be ' 'deprecated, please replace it with ' 'mmdet.datasets.pipelines.formatting.')
293
28.4
79
py
mmdetection
mmdetection-master/mmdet/datasets/pipelines/formatting.py
# Copyright (c) OpenMMLab. All rights reserved. from collections.abc import Sequence import mmcv import numpy as np import torch from mmcv.parallel import DataContainer as DC from ..builder import PIPELINES def to_tensor(data): """Convert objects of various python types to :obj:`torch.Tensor`. Supported ty...
13,853
33.292079
79
py
mmdetection
mmdetection-master/mmdet/datasets/pipelines/instaboost.py
# Copyright (c) OpenMMLab. All rights reserved. import numpy as np from ..builder import PIPELINES @PIPELINES.register_module() class InstaBoost: r"""Data augmentation method in `InstaBoost: Boosting Instance Segmentation Via Probability Map Guided Copy-Pasting <https://arxiv.org/abs/1908.07801>`_. ...
4,508
36.890756
79
py
mmdetection
mmdetection-master/mmdet/datasets/pipelines/loading.py
# Copyright (c) OpenMMLab. All rights reserved. import os.path as osp import mmcv import numpy as np import pycocotools.mask as maskUtils from mmdet.core import BitmapMasks, PolygonMasks from ..builder import PIPELINES try: from panopticapi.utils import rgb2id except ImportError: rgb2id = None @PIPELINES.r...
22,759
34.232198
79
py
mmdetection
mmdetection-master/mmdet/datasets/pipelines/test_time_aug.py
# Copyright (c) OpenMMLab. All rights reserved. import warnings import mmcv from ..builder import PIPELINES from .compose import Compose @PIPELINES.register_module() class MultiScaleFlipAug: """Test-time augmentation with multiple scales and flipping. An example configuration is as followed: .. code-b...
4,466
35.614754
78
py
mmdetection
mmdetection-master/mmdet/datasets/pipelines/transforms.py
# Copyright (c) OpenMMLab. All rights reserved. import copy import inspect import math import warnings import cv2 import mmcv import numpy as np from numpy import random from mmdet.core import BitmapMasks, PolygonMasks, find_inside_bboxes from mmdet.core.evaluation.bbox_overlaps import bbox_overlaps from mmdet.utils ...
118,461
38.89963
79
py
mmdetection
mmdetection-master/mmdet/datasets/samplers/__init__.py
# Copyright (c) OpenMMLab. All rights reserved. from .class_aware_sampler import ClassAwareSampler from .distributed_sampler import DistributedSampler from .group_sampler import DistributedGroupSampler, GroupSampler from .infinite_sampler import InfiniteBatchSampler, InfiniteGroupBatchSampler __all__ = [ 'Distribu...
455
40.454545
77
py
mmdetection
mmdetection-master/mmdet/datasets/samplers/class_aware_sampler.py
# Copyright (c) OpenMMLab. All rights reserved. import math import torch from mmcv.runner import get_dist_info from torch.utils.data import Sampler from mmdet.core.utils import sync_random_seed class ClassAwareSampler(Sampler): r"""Sampler that restricts data loading to the label of the dataset. A class-aw...
6,543
35.971751
104
py
mmdetection
mmdetection-master/mmdet/datasets/samplers/distributed_sampler.py
# Copyright (c) OpenMMLab. All rights reserved. import math import torch from torch.utils.data import DistributedSampler as _DistributedSampler from mmdet.core.utils import sync_random_seed from mmdet.utils import get_device class DistributedSampler(_DistributedSampler): def __init__(self, dat...
2,037
36.054545
79
py
mmdetection
mmdetection-master/mmdet/datasets/samplers/group_sampler.py
# Copyright (c) OpenMMLab. All rights reserved. import math import numpy as np import torch from mmcv.runner import get_dist_info from torch.utils.data import Sampler class GroupSampler(Sampler): def __init__(self, dataset, samples_per_gpu=1): assert hasattr(dataset, 'flag') self.dataset = datas...
5,384
35.14094
78
py
mmdetection
mmdetection-master/mmdet/datasets/samplers/infinite_sampler.py
# Copyright (c) OpenMMLab. All rights reserved. import itertools import numpy as np import torch from mmcv.runner import get_dist_info from torch.utils.data.sampler import Sampler from mmdet.core.utils import sync_random_seed class InfiniteGroupBatchSampler(Sampler): """Similar to `BatchSampler` warping a `Grou...
7,064
36.780749
110
py
mmdetection
mmdetection-master/mmdet/models/__init__.py
# Copyright (c) OpenMMLab. All rights reserved. from .backbones import * # noqa: F401,F403 from .builder import (BACKBONES, DETECTORS, HEADS, LOSSES, NECKS, ROI_EXTRACTORS, SHARED_HEADS, build_backbone, build_detector, build_head, build_loss, build_neck, ...
899
44
78
py
mmdetection
mmdetection-master/mmdet/models/builder.py
# Copyright (c) OpenMMLab. All rights reserved. import warnings from mmcv.cnn import MODELS as MMCV_MODELS from mmcv.utils import Registry MODELS = Registry('models', parent=MMCV_MODELS) BACKBONES = MODELS NECKS = MODELS ROI_EXTRACTORS = MODELS SHARED_HEADS = MODELS HEADS = MODELS LOSSES = MODELS DETECTORS = MODELS ...
1,449
23.166667
71
py
mmdetection
mmdetection-master/mmdet/models/backbones/__init__.py
# Copyright (c) OpenMMLab. All rights reserved. from .csp_darknet import CSPDarknet from .darknet import Darknet from .detectors_resnet import DetectoRS_ResNet from .detectors_resnext import DetectoRS_ResNeXt from .efficientnet import EfficientNet from .hourglass import HourglassNet from .hrnet import HRNet from .mobil...
999
36.037037
77
py
mmdetection
mmdetection-master/mmdet/models/backbones/csp_darknet.py
# Copyright (c) OpenMMLab. All rights reserved. import math import torch import torch.nn as nn from mmcv.cnn import ConvModule, DepthwiseSeparableConvModule from mmcv.runner import BaseModule from torch.nn.modules.batchnorm import _BatchNorm from ..builder import BACKBONES from ..utils import CSPLayer class Focus(n...
10,543
35.996491
77
py
mmdetection
mmdetection-master/mmdet/models/backbones/darknet.py
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) 2019 Western Digital Corporation or its affiliates. import warnings import torch.nn as nn from mmcv.cnn import ConvModule from mmcv.runner import BaseModule from torch.nn.modules.batchnorm import _BatchNorm from ..builder import BACKBONES class ResBlo...
8,233
37.476636
79
py
mmdetection
mmdetection-master/mmdet/models/backbones/detectors_resnet.py
# Copyright (c) OpenMMLab. All rights reserved. import torch.nn as nn import torch.utils.checkpoint as cp from mmcv.cnn import (build_conv_layer, build_norm_layer, constant_init, kaiming_init) from mmcv.runner import Sequential, load_checkpoint from torch.nn.modules.batchnorm import _BatchNorm fr...
12,736
34.980226
79
py
mmdetection
mmdetection-master/mmdet/models/backbones/detectors_resnext.py
# Copyright (c) OpenMMLab. All rights reserved. import math from mmcv.cnn import build_conv_layer, build_norm_layer from ..builder import BACKBONES from .detectors_resnet import Bottleneck as _Bottleneck from .detectors_resnet import DetectoRS_ResNet class Bottleneck(_Bottleneck): expansion = 4 def __init_...
3,920
30.620968
77
py
mmdetection
mmdetection-master/mmdet/models/backbones/efficientnet.py
# Copyright (c) OpenMMLab. All rights reserved. import copy import math from functools import partial import torch import torch.nn as nn import torch.utils.checkpoint as cp from mmcv.cnn.bricks import ConvModule, DropPath from mmcv.runner import BaseModule, Sequential from ..builder import BACKBONES from ..utils impo...
16,218
37.801435
79
py
mmdetection
mmdetection-master/mmdet/models/backbones/hourglass.py
# Copyright (c) OpenMMLab. All rights reserved. import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import ConvModule from mmcv.runner import BaseModule from ..builder import BACKBONES from ..utils import ResLayer from .resnet import BasicBlock class HourglassModule(BaseModule): """Hourglass Modu...
7,494
32.609865
79
py
mmdetection
mmdetection-master/mmdet/models/backbones/hrnet.py
# Copyright (c) OpenMMLab. All rights reserved. import warnings import torch.nn as nn from mmcv.cnn import build_conv_layer, build_norm_layer from mmcv.runner import BaseModule, ModuleList, Sequential from torch.nn.modules.batchnorm import _BatchNorm from ..builder import BACKBONES from .resnet import BasicBlock, Bot...
23,106
38.164407
79
py
mmdetection
mmdetection-master/mmdet/models/backbones/mobilenet_v2.py
# Copyright (c) OpenMMLab. All rights reserved. import warnings import torch.nn as nn from mmcv.cnn import ConvModule from mmcv.runner import BaseModule from torch.nn.modules.batchnorm import _BatchNorm from ..builder import BACKBONES from ..utils import InvertedResidual, make_divisible @BACKBONES.register_module()...
7,599
37.383838
78
py
mmdetection
mmdetection-master/mmdet/models/backbones/pvt.py
# Copyright (c) OpenMMLab. All rights reserved. import math import warnings import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import (Conv2d, build_activation_layer, build_norm_layer, constant_init, normal_init, trunc_normal_init) from mmcv.cnn.br...
23,217
38.219595
89
py
mmdetection
mmdetection-master/mmdet/models/backbones/regnet.py
# Copyright (c) OpenMMLab. All rights reserved. import warnings import numpy as np import torch.nn as nn from mmcv.cnn import build_conv_layer, build_norm_layer from ..builder import BACKBONES from .resnet import ResNet from .resnext import Bottleneck @BACKBONES.register_module() class RegNet(ResNet): """RegNet...
13,605
37.112045
79
py
mmdetection
mmdetection-master/mmdet/models/backbones/res2net.py
# Copyright (c) OpenMMLab. All rights reserved. import math import torch import torch.nn as nn import torch.utils.checkpoint as cp from mmcv.cnn import build_conv_layer, build_norm_layer from mmcv.runner import Sequential from ..builder import BACKBONES from .resnet import Bottleneck as _Bottleneck from .resnet impor...
11,659
34.54878
79
py
mmdetection
mmdetection-master/mmdet/models/backbones/resnest.py
# Copyright (c) OpenMMLab. All rights reserved. import math import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.checkpoint as cp from mmcv.cnn import build_conv_layer, build_norm_layer from mmcv.runner import BaseModule from ..builder import BACKBONES from ..utils import ResLayer fro...
10,579
31.755418
79
py
mmdetection
mmdetection-master/mmdet/models/backbones/resnet.py
# Copyright (c) OpenMMLab. All rights reserved. import warnings import torch.nn as nn import torch.utils.checkpoint as cp from mmcv.cnn import build_conv_layer, build_norm_layer, build_plugin_layer from mmcv.runner import BaseModule from torch.nn.modules.batchnorm import _BatchNorm from ..builder import BACKBONES fro...
23,840
34.424963
79
py
mmdetection
mmdetection-master/mmdet/models/backbones/resnext.py
# Copyright (c) OpenMMLab. All rights reserved. import math from mmcv.cnn import build_conv_layer, build_norm_layer from ..builder import BACKBONES from ..utils import ResLayer from .resnet import Bottleneck as _Bottleneck from .resnet import ResNet class Bottleneck(_Bottleneck): expansion = 4 def __init__...
5,712
35.858065
79
py
mmdetection
mmdetection-master/mmdet/models/backbones/ssd_vgg.py
# Copyright (c) OpenMMLab. All rights reserved. import warnings import torch.nn as nn from mmcv.cnn import VGG from mmcv.runner import BaseModule from ..builder import BACKBONES from ..necks import ssd_neck @BACKBONES.register_module() class SSDVGG(VGG, BaseModule): """VGG Backbone network for single-shot-detec...
4,705
35.48062
79
py
mmdetection
mmdetection-master/mmdet/models/backbones/swin.py
# Copyright (c) OpenMMLab. All rights reserved. import warnings from collections import OrderedDict from copy import deepcopy import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.checkpoint as cp from mmcv.cnn import build_norm_layer, constant_init, trunc_normal_init from mmcv.cnn.bric...
30,579
38.560155
79
py
mmdetection
mmdetection-master/mmdet/models/backbones/trident_resnet.py
# Copyright (c) OpenMMLab. All rights reserved. import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.checkpoint as cp from mmcv.cnn import build_conv_layer, build_norm_layer from mmcv.runner import BaseModule from torch.nn.modules.utils import _pair from mmdet.models.backbones.resnet i...
11,129
36.22408
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/__init__.py
# Copyright (c) OpenMMLab. All rights reserved. from .anchor_free_head import AnchorFreeHead from .anchor_head import AnchorHead from .ascend_anchor_head import AscendAnchorHead from .ascend_retina_head import AscendRetinaHead from .ascend_ssd_head import AscendSSDHead from .atss_head import ATSSHead from .autoassign_h...
2,787
43.253968
76
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/anchor_free_head.py
# Copyright (c) OpenMMLab. All rights reserved. import warnings from abc import abstractmethod import torch import torch.nn as nn from mmcv.cnn import ConvModule from mmcv.runner import force_fp32 from mmdet.core import build_bbox_coder, multi_apply from mmdet.core.anchor.point_generator import MlvlPointGenerator fro...
13,958
38.769231
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/anchor_head.py
# Copyright (c) OpenMMLab. All rights reserved. import warnings import torch import torch.nn as nn from mmcv.runner import force_fp32 from mmdet.core import (anchor_inside_flags, build_assigner, build_bbox_coder, build_prior_generator, build_sampler, images_to_levels, m...
24,605
44.314917
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/ascend_anchor_head.py
# Copyright (c) OpenMMLab. All rights reserved. import torch from ...core.bbox.assigners import AscendMaxIoUAssigner from ...core.bbox.samplers import PseudoSampler from ...utils import (batch_images_to_levels, get_max_num_gt_division_factor, masked_fill) from ..builder import HEADS from .anchor_...
18,527
46.507692
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/ascend_retina_head.py
# Copyright (c) OpenMMLab. All rights reserved. from ..builder import HEADS from .ascend_anchor_head import AscendAnchorHead from .retina_head import RetinaHead @HEADS.register_module() class AscendRetinaHead(RetinaHead, AscendAnchorHead): r"""An anchor-based head used in `RetinaNet <https://arxiv.org/pdf/170...
5,091
42.896552
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/ascend_ssd_head.py
# Copyright (c) OpenMMLab. All rights reserved. import torch import torch.nn.functional as F from mmcv.runner import force_fp32 from ..builder import HEADS from ..losses import smooth_l1_loss from .ascend_anchor_head import AscendAnchorHead from .ssd_head import SSDHead @HEADS.register_module() class AscendSSDHead(S...
14,349
42.617021
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/atss_head.py
# Copyright (c) OpenMMLab. All rights reserved. import torch import torch.nn as nn from mmcv.cnn import ConvModule, Scale from mmcv.runner import force_fp32 from mmdet.core import (anchor_inside_flags, build_assigner, build_sampler, images_to_levels, multi_apply, reduce_mean, unmap) from ..buil...
21,149
41.131474
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/autoassign_head.py
# Copyright (c) OpenMMLab. All rights reserved. import warnings import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import bias_init_with_prob, normal_init from mmcv.runner import force_fp32 from mmdet.core import multi_apply from mmdet.core.anchor.point_generator import MlvlPointGenerato...
23,096
42.744318
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/base_dense_head.py
# Copyright (c) OpenMMLab. All rights reserved. from abc import ABCMeta, abstractmethod import torch from mmcv.cnn.utils.weight_init import constant_init from mmcv.ops import batched_nms from mmcv.runner import BaseModule, force_fp32 from mmdet.core.utils import filter_scores_and_topk, select_single_mlvl class Base...
23,226
43.074004
106
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/base_mask_head.py
# Copyright (c) OpenMMLab. All rights reserved. from abc import ABCMeta, abstractmethod from mmcv.runner import BaseModule class BaseMaskHead(BaseModule, metaclass=ABCMeta): """Base class for mask heads used in One-Stage Instance Segmentation.""" def __init__(self, init_cfg): super(BaseMaskHead, sel...
4,539
37.803419
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/cascade_rpn_head.py
# Copyright (c) OpenMMLab. All rights reserved. from __future__ import division import copy import warnings import torch import torch.nn as nn from mmcv import ConfigDict from mmcv.ops import DeformConv2d, batched_nms from mmcv.runner import BaseModule, ModuleList from mmdet.core import (RegionAssigner, build_assigne...
33,996
41.390274
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/centernet_head.py
# Copyright (c) OpenMMLab. All rights reserved. import torch import torch.nn as nn from mmcv.cnn import bias_init_with_prob, normal_init from mmcv.ops import batched_nms from mmcv.runner import force_fp32 from mmdet.core import multi_apply from mmdet.models import HEADS, build_loss from mmdet.models.utils import gauss...
18,025
42.646489
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/centripetal_head.py
# Copyright (c) OpenMMLab. All rights reserved. import torch.nn as nn from mmcv.cnn import ConvModule, normal_init from mmcv.ops import DeformConv2d from mmcv.runner import force_fp32 from mmdet.core import multi_apply from ..builder import HEADS, build_loss from .corner_head import CornerHead @HEADS.register_module...
19,882
45.132251
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/corner_head.py
# Copyright (c) OpenMMLab. All rights reserved. from logging import warning from math import ceil, log import torch import torch.nn as nn from mmcv.cnn import ConvModule, bias_init_with_prob from mmcv.ops import CornerPool, batched_nms from mmcv.runner import BaseModule, force_fp32 from mmdet.core import multi_apply ...
48,502
43.620975
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/ddod_head.py
# Copyright (c) OpenMMLab. All rights reserved. import torch import torch.nn as nn from mmcv.cnn import ConvModule, Scale, bias_init_with_prob, normal_init from mmcv.runner import force_fp32 from mmdet.core import (anchor_inside_flags, build_assigner, build_sampler, images_to_levels, multi_appl...
34,312
43.047497
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/deformable_detr_head.py
# Copyright (c) OpenMMLab. All rights reserved. import copy import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import Linear, bias_init_with_prob, constant_init from mmcv.runner import force_fp32 from mmdet.core import multi_apply from mmdet.models.utils.transformer import inverse_sigmoi...
13,708
41.974922
98
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/dense_test_mixins.py
# Copyright (c) OpenMMLab. All rights reserved. import sys from inspect import signature import torch from mmcv.ops import batched_nms from mmdet.core import bbox_mapping_back, merge_aug_proposals if sys.version_info >= (3, 7): from mmdet.utils.contextmanagers import completed class BBoxTestMixin(object): ...
8,421
39.68599
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/detr_head.py
# Copyright (c) OpenMMLab. All rights reserved. import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import Conv2d, Linear, build_activation_layer from mmcv.cnn.bricks.transformer import FFN, build_positional_encoding from mmcv.runner import force_fp32 from mmdet.core import (bbox_cxcywh_to...
39,707
45.991716
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/embedding_rpn_head.py
# Copyright (c) OpenMMLab. All rights reserved. import torch import torch.nn as nn from mmcv.runner import BaseModule from mmdet.models.builder import HEADS from ...core import bbox_cxcywh_to_xyxy @HEADS.register_module() class EmbeddingRPNHead(BaseModule): """RPNHead in the `Sparse R-CNN <https://arxiv.org/abs/...
4,629
38.57265
78
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/fcos_head.py
# Copyright (c) OpenMMLab. All rights reserved. import warnings import torch import torch.nn as nn from mmcv.cnn import Scale from mmcv.runner import force_fp32 from mmdet.core import multi_apply, reduce_mean from ..builder import HEADS, build_loss from .anchor_free_head import AnchorFreeHead INF = 1e8 @HEADS.regi...
19,709
42.223684
113
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/fovea_head.py
# Copyright (c) OpenMMLab. All rights reserved. import warnings import torch import torch.nn as nn from mmcv.cnn import ConvModule from mmcv.ops import DeformConv2d from mmcv.runner import BaseModule from mmdet.core import multi_apply from mmdet.core.utils import filter_scores_and_topk from ..builder import HEADS fro...
16,364
41.396373
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/free_anchor_retina_head.py
# Copyright (c) OpenMMLab. All rights reserved. import torch import torch.nn.functional as F from mmdet.core import bbox_overlaps from ..builder import HEADS from .retina_head import RetinaHead EPS = 1e-12 @HEADS.register_module() class FreeAnchorRetinaHead(RetinaHead): """FreeAnchor RetinaHead used in https://...
11,254
40.227106
94
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/fsaf_head.py
# Copyright (c) OpenMMLab. All rights reserved. import numpy as np import torch from mmcv.runner import force_fp32 from mmdet.core import (anchor_inside_flags, images_to_levels, multi_apply, unmap) from ..builder import HEADS from ..losses.accuracy import accuracy from ..losses.utils import wei...
19,337
43.557604
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/ga_retina_head.py
# Copyright (c) OpenMMLab. All rights reserved. import torch.nn as nn from mmcv.cnn import ConvModule from mmcv.ops import MaskedConv2d from ..builder import HEADS from .guided_anchor_head import FeatureAdaption, GuidedAnchorHead @HEADS.register_module() class GARetinaHead(GuidedAnchorHead): """Guided-Anchor-bas...
3,931
33.491228
77
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/ga_rpn_head.py
# Copyright (c) OpenMMLab. All rights reserved. import copy import warnings import torch import torch.nn as nn import torch.nn.functional as F from mmcv import ConfigDict from mmcv.ops import nms from ..builder import HEADS from .guided_anchor_head import GuidedAnchorHead @HEADS.register_module() class GARPNHead(Gu...
7,052
38.623596
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/gfl_head.py
# Copyright (c) OpenMMLab. All rights reserved. import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import ConvModule, Scale from mmcv.runner import force_fp32 from mmdet.core import (anchor_inside_flags, bbox_overlaps, build_assigner, build_sampler, images_to_level...
27,913
42.010786
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/guided_anchor_head.py
# Copyright (c) OpenMMLab. All rights reserved. import warnings import torch import torch.nn as nn from mmcv.ops import DeformConv2d, MaskedConv2d from mmcv.runner import BaseModule, force_fp32 from mmdet.core import (anchor_inside_flags, build_assigner, build_bbox_coder, build_prior_generator...
37,334
41.963176
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/lad_head.py
# Copyright (c) OpenMMLab. All rights reserved. import torch from mmcv.runner import force_fp32 from mmdet.core import bbox_overlaps, multi_apply from ..builder import HEADS from .paa_head import PAAHead, levels_to_images @HEADS.register_module() class LADHead(PAAHead): """Label Assignment Head from the paper: `...
10,058
42.171674
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/ld_head.py
# Copyright (c) OpenMMLab. All rights reserved. import torch from mmcv.runner import force_fp32 from mmdet.core import bbox_overlaps, multi_apply, reduce_mean from ..builder import HEADS, build_loss from .gfl_head import GFLHead @HEADS.register_module() class LDHead(GFLHead): """Localization distillation Head. (...
10,636
39.599237
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/mask2former_head.py
# Copyright (c) OpenMMLab. All rights reserved. import copy import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import Conv2d, build_plugin_layer, caffe2_xavier_init from mmcv.cnn.bricks.transformer import (build_positional_encoding, build_transform...
19,469
44.174014
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/maskformer_head.py
# Copyright (c) OpenMMLab. All rights reserved. import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import Conv2d, build_plugin_layer, caffe2_xavier_init from mmcv.cnn.bricks.transformer import (build_positional_encoding, build_transformer_layer_sequ...
25,113
44.087971
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/nasfcos_head.py
# Copyright (c) OpenMMLab. All rights reserved. import copy import torch.nn as nn from mmcv.cnn import ConvModule, Scale from mmdet.models.dense_heads.fcos_head import FCOSHead from ..builder import HEADS @HEADS.register_module() class NASFCOSHead(FCOSHead): """Anchor-free head used in `NASFCOS <https://arxiv.o...
2,908
34.91358
78
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/paa_head.py
# Copyright (c) OpenMMLab. All rights reserved. import numpy as np import torch from mmcv.runner import force_fp32 from mmdet.core import multi_apply, multiclass_nms from mmdet.core.bbox.iou_calculators import bbox_overlaps from mmdet.models import HEADS from mmdet.models.dense_heads import ATSSHead EPS = 1e-12 try: ...
34,042
43.970938
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/pisa_retinanet_head.py
# Copyright (c) OpenMMLab. All rights reserved. import torch from mmcv.runner import force_fp32 from mmdet.core import images_to_levels from ..builder import HEADS from ..losses import carl_loss, isr_p from .retina_head import RetinaHead @HEADS.register_module() class PISARetinaHead(RetinaHead): """PISA Retinane...
6,267
39.179487
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/pisa_ssd_head.py
# Copyright (c) OpenMMLab. All rights reserved. import torch from mmdet.core import multi_apply from ..builder import HEADS from ..losses import CrossEntropyLoss, SmoothL1Loss, carl_loss, isr_p from .ssd_head import SSDHead # TODO: add loss evaluator for SSD @HEADS.register_module() class PISASSDHead(SSDHead): ...
5,598
38.70922
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/reppoints_head.py
# Copyright (c) OpenMMLab. All rights reserved. import numpy as np import torch import torch.nn as nn from mmcv.cnn import ConvModule from mmcv.ops import DeformConv2d from mmdet.core import (build_assigner, build_sampler, images_to_levels, multi_apply, unmap) from mmdet.core.anchor.point_gener...
34,936
44.669281
101
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/retina_head.py
# Copyright (c) OpenMMLab. All rights reserved. import torch.nn as nn from mmcv.cnn import ConvModule from ..builder import HEADS from .anchor_head import AnchorHead @HEADS.register_module() class RetinaHead(AnchorHead): r"""An anchor-based head used in `RetinaNet <https://arxiv.org/pdf/1708.02002.pdf>`_. ...
4,059
34
76
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/retina_sepbn_head.py
# Copyright (c) OpenMMLab. All rights reserved. import torch.nn as nn from mmcv.cnn import ConvModule, bias_init_with_prob, normal_init from ..builder import HEADS from .anchor_head import AnchorHead @HEADS.register_module() class RetinaSepBNHead(AnchorHead): """"RetinaHead with separate BN. In RetinaHead, ...
4,566
37.378151
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/rpn_head.py
# Copyright (c) OpenMMLab. All rights reserved. import copy import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import ConvModule from mmcv.ops import batched_nms from ..builder import HEADS from .anchor_head import AnchorHead @HEADS.register_module() class RPNHead(AnchorHead): """R...
11,202
41.116541
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/sabl_retina_head.py
# Copyright (c) OpenMMLab. All rights reserved. import warnings import numpy as np import torch import torch.nn as nn from mmcv.cnn import ConvModule from mmcv.runner import force_fp32 from mmdet.core import (build_assigner, build_bbox_coder, build_prior_generator, build_sampler, images_to_lev...
27,410
42.440571
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/solo_head.py
# Copyright (c) OpenMMLab. All rights reserved. import mmcv import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import ConvModule from mmdet.core import InstanceData, mask_matrix_nms, multi_apply from mmdet.core.utils import center_of_mass, generate_coordinate from mmdet...
48,058
39.116027
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/solov2_head.py
# Copyright (c) OpenMMLab. All rights reserved. import warnings import mmcv import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import ConvModule from mmcv.runner import BaseModule, auto_fp16, force_fp32 from mmdet.core import InstanceData, mask_matrix_nms, multi_apply ...
31,361
39.889179
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/ssd_head.py
# Copyright (c) OpenMMLab. All rights reserved. import warnings import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import ConvModule, DepthwiseSeparableConvModule from mmcv.runner import force_fp32 from mmdet.core import (build_assigner, build_bbox_coder, build_pr...
14,790
40.315642
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/tood_head.py
# Copyright (c) OpenMMLab. All rights reserved. import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import ConvModule, Scale, bias_init_with_prob, normal_init from mmcv.ops import deform_conv2d from mmcv.runner import force_fp32 from mmdet.core import (anchor_inside_flags, build_assigner, ...
34,398
43.157895
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/vfnet_head.py
# Copyright (c) OpenMMLab. All rights reserved. import warnings import numpy as np import torch import torch.nn as nn from mmcv.cnn import ConvModule, Scale from mmcv.ops import DeformConv2d from mmcv.runner import force_fp32 from mmdet.core import (MlvlPointGenerator, bbox_overlaps, build_assigner, ...
31,290
41.22807
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/yolact_head.py
# Copyright (c) OpenMMLab. All rights reserved. import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import ConvModule from mmcv.runner import BaseModule, ModuleList, force_fp32 from mmdet.core import build_sampler, fast_nms, images_to_levels, multi_apply from mmdet.core....
43,474
41.664377
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/yolo_head.py
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) 2019 Western Digital Corporation or its affiliates. import warnings import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import (ConvModule, bias_init_with_prob, constant_init, is_norm, ...
26,371
41.398714
106
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/yolof_head.py
# Copyright (c) OpenMMLab. All rights reserved. import torch import torch.nn as nn from mmcv.cnn import (ConvModule, bias_init_with_prob, constant_init, is_norm, normal_init) from mmcv.runner import force_fp32 from mmdet.core import anchor_inside_flags, multi_apply, reduce_mean, unmap from ..buil...
17,409
40.7506
79
py
mmdetection
mmdetection-master/mmdet/models/dense_heads/yolox_head.py
# Copyright (c) OpenMMLab. All rights reserved. import math import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import (ConvModule, DepthwiseSeparableConvModule, bias_init_with_prob) from mmcv.ops.nms import batched_nms from mmcv.runner import force...
20,987
41.48583
79
py
mmdetection
mmdetection-master/mmdet/models/detectors/__init__.py
# Copyright (c) OpenMMLab. All rights reserved. from .atss import ATSS from .autoassign import AutoAssign from .base import BaseDetector from .cascade_rcnn import CascadeRCNN from .centernet import CenterNet from .cornernet import CornerNet from .ddod import DDOD from .deformable_detr import DeformableDETR from .detr i...
2,176
35.898305
77
py
mmdetection
mmdetection-master/mmdet/models/detectors/atss.py
# Copyright (c) OpenMMLab. All rights reserved. from ..builder import DETECTORS from .single_stage import SingleStageDetector @DETECTORS.register_module() class ATSS(SingleStageDetector): """Implementation of `ATSS <https://arxiv.org/abs/1912.02424>`_.""" def __init__(self, backbone, ...
636
30.85
72
py
mmdetection
mmdetection-master/mmdet/models/detectors/autoassign.py
# Copyright (c) OpenMMLab. All rights reserved. from ..builder import DETECTORS from .single_stage import SingleStageDetector @DETECTORS.register_module() class AutoAssign(SingleStageDetector): """Implementation of `AutoAssign: Differentiable Label Assignment for Dense Object Detection <https://arxiv.org/abs/...
682
33.15
79
py
mmdetection
mmdetection-master/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 class BaseDete...
14,929
39.79235
79
py
mmdetection
mmdetection-master/mmdet/models/detectors/cascade_rcnn.py
# Copyright (c) OpenMMLab. All rights reserved. from ..builder import DETECTORS from .two_stage import TwoStageDetector @DETECTORS.register_module() class CascadeRCNN(TwoStageDetector): r"""Implementation of `Cascade R-CNN: Delving into High Quality Object Detection <https://arxiv.org/abs/1906.09756>`_""" ...
1,698
32.98
75
py
mmdetection
mmdetection-master/mmdet/models/detectors/centernet.py
# Copyright (c) OpenMMLab. All rights reserved. import torch from mmdet.core import bbox2result from mmdet.models.builder import DETECTORS from ...core.utils import flip_tensor from .single_stage import SingleStageDetector @DETECTORS.register_module() class CenterNet(SingleStageDetector): """Implementation of Ce...
4,206
36.5625
79
py
mmdetection
mmdetection-master/mmdet/models/detectors/cornernet.py
# Copyright (c) OpenMMLab. All rights reserved. import torch from mmdet.core import bbox2result, bbox_mapping_back from ..builder import DETECTORS from .single_stage import SingleStageDetector @DETECTORS.register_module() class CornerNet(SingleStageDetector): """CornerNet. This detector is the implementatio...
3,668
36.438776
79
py
mmdetection
mmdetection-master/mmdet/models/detectors/ddod.py
# Copyright (c) OpenMMLab. All rights reserved. from ..builder import DETECTORS from .single_stage import SingleStageDetector @DETECTORS.register_module() class DDOD(SingleStageDetector): """Implementation of `DDOD <https://arxiv.org/pdf/2107.02963.pdf>`_.""" def __init__(self, backbone, ...
640
31.05
75
py
mmdetection
mmdetection-master/mmdet/models/detectors/deformable_detr.py
# Copyright (c) OpenMMLab. All rights reserved. from ..builder import DETECTORS from .detr import DETR @DETECTORS.register_module() class DeformableDETR(DETR): def __init__(self, *args, **kwargs): super(DETR, self).__init__(*args, **kwargs)
256
22.363636
51
py